Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ To build and run this project locally on Windows, follow these steps:
```bash
mkdir build
cd build
cmake ..
cmake .. -DCMAKE_BUILD_TYPE=Release
If you want to build in a debug, change the release to debug
```
*Note: Make sure you have CMake installed to build the project.*
4. **Build the project:**
Next, to build the project, we will need to enter the command
```bash
cmake --build . --config Release
```
If you want to build in a debug, change the release to debug
5. **Run the project**
After building the project, you can find the executable file in the following path from the *build* folder
```bash
Expand Down
32 changes: 24 additions & 8 deletions app/Graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,34 @@ target_link_libraries(Graph_Build BuildGraph)
add_executable(ACC_MNIST acc_check_mnist.cpp)
target_link_libraries(ACC_MNIST BuildGraph)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to make "Release" as a default type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found an error with copying files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before that, opencv was always going to debug. I will add in the instructions instead of the cmake command cmake .. the cmake command -DCMAKE_BUILD_TYPE=Release command, and only then will our idea of copying dll files from the release or debug folder work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got it

endif()

if (WIN32)
add_custom_command(TARGET Graph_Build POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}"
"${CMAKE_BINARY_DIR}/app/ReaderImage/${CMAKE_BUILD_TYPE}/")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(CMAKE_BUILD_TYPE "Debug")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set(CMAKE_BUILD_TYPE "Release")
endif()
add_custom_command(TARGET Graph_Build POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}/."
"${CMAKE_BINARY_DIR}/bin/")
endif()

if (WIN32)
add_custom_command(TARGET ACC_MNIST POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}"
"${CMAKE_BINARY_DIR}/app/ReaderImage/${CMAKE_BUILD_TYPE}/")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(CMAKE_BUILD_TYPE "Debug")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set(CMAKE_BUILD_TYPE "Release")
endif()
Comment on lines +52 to +57
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass the type as is (no need to convert it to specific case)

add_custom_command(TARGET ACC_MNIST POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/3rdparty/opencv/build/bin/${CMAKE_BUILD_TYPE}/."
"${CMAKE_BINARY_DIR}/bin/")
endif()

file(DOWNLOAD
Expand Down
Loading