Skip to content

Commit 37ba43d

Browse files
AndreySorokin7AndreySorokin7Semyon1104
authored
Fix dll files opencv for win32 (graph) (#169)
Co-authored-by: AndreySorokin7 <andrey_sorokin_nn@mail,ru> Co-authored-by: Semyon1104 <[email protected]>
1 parent 937d39a commit 37ba43d

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ To build and run this project locally on Windows, follow these steps:
2222
```bash
2323
mkdir build
2424
cd build
25-
cmake ..
25+
cmake .. -DCMAKE_BUILD_TYPE=Release
26+
If you want to build in a debug, change the release to debug
2627
```
2728
*Note: Make sure you have CMake installed to build the project.*
2829
4. **Build the project:**
2930
Next, to build the project, we will need to enter the command
3031
```bash
3132
cmake --build . --config Release
3233
```
33-
If you want to build in a debug, change the release to debug
3434
5. **Run the project**
3535
After building the project, you can find the executable file in the following path from the *build* folder
3636
```bash

app/Graph/CMakeLists.txt

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,34 @@ target_link_libraries(Graph_Build BuildGraph)
3131
add_executable(ACC_MNIST acc_check_mnist.cpp)
3232
target_link_libraries(ACC_MNIST BuildGraph)
3333

34+
if (NOT CMAKE_BUILD_TYPE)
35+
set(CMAKE_BUILD_TYPE "Debug")
36+
endif()
37+
3438
if (WIN32)
35-
add_custom_command(TARGET Graph_Build POST_BUILD
36-
COMMAND ${CMAKE_COMMAND} -E copy_directory
37-
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}"
38-
"${CMAKE_BINARY_DIR}/app/ReaderImage/${CMAKE_BUILD_TYPE}/")
39+
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
40+
set(CMAKE_BUILD_TYPE "Debug")
41+
endif()
42+
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
43+
set(CMAKE_BUILD_TYPE "Release")
44+
endif()
45+
add_custom_command(TARGET Graph_Build POST_BUILD
46+
COMMAND ${CMAKE_COMMAND} -E copy_directory
47+
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}/."
48+
"${CMAKE_BINARY_DIR}/bin/")
3949
endif()
4050

4151
if (WIN32)
42-
add_custom_command(TARGET ACC_MNIST POST_BUILD
43-
COMMAND ${CMAKE_COMMAND} -E copy_directory
44-
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}"
45-
"${CMAKE_BINARY_DIR}/app/ReaderImage/${CMAKE_BUILD_TYPE}/")
52+
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
53+
set(CMAKE_BUILD_TYPE "Debug")
54+
endif()
55+
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
56+
set(CMAKE_BUILD_TYPE "Release")
57+
endif()
58+
add_custom_command(TARGET ACC_MNIST POST_BUILD
59+
COMMAND ${CMAKE_COMMAND} -E copy_directory
60+
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}/."
61+
"${CMAKE_BINARY_DIR}/bin/")
4662
endif()
4763

4864
file(DOWNLOAD

0 commit comments

Comments
 (0)