From 6f04f5cdb3dc24f8a2a7b3c48cc4b4b70ba4b9e3 Mon Sep 17 00:00:00 2001 From: AndreySorokin7 Date: Fri, 28 Mar 2025 00:19:22 +0300 Subject: [PATCH 1/2] fix --- app/Graph/CMakeLists.txt | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/app/Graph/CMakeLists.txt b/app/Graph/CMakeLists.txt index 6948dd48..04447535 100644 --- a/app/Graph/CMakeLists.txt +++ b/app/Graph/CMakeLists.txt @@ -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") +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() + 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 From 5a525b382cecaf268a7069c9f850067f80a150e5 Mon Sep 17 00:00:00 2001 From: Semyon1104 <129722895+Semyon1104@users.noreply.github.com> Date: Mon, 31 Mar 2025 21:05:08 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e5d9a95..07079be4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ 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:** @@ -30,7 +31,6 @@ To build and run this project locally on Windows, follow these steps: ```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