diff --git a/CMakeLists.txt b/CMakeLists.txt index 306a13c..48bcf5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,23 +8,4 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -find_package(Qt6 COMPONENTS - Core - REQUIRED) - -find_package(fmt) - - -add_executable(task1_7 task1/main.cpp) -add_custom_command(OUTPUT dataset.dat - DEPENDS task1/dataset.dat - COMMAND cmake -E copy_if_different ${CMAKE_SOURCE_DIR}/task1/dataset.dat ${CMAKE_BINARY_DIR}/dataset.dat - COMMENT "Copying dataset") - -add_custom_target(task1_7_dataset DEPENDS dataset.dat) -add_dependencies(task1_7 task1_7_dataset) - - -target_link_libraries(task1_7 - fmt::fmt - Qt::Core) +add_subdirectory(task1) \ No newline at end of file diff --git a/task1/CMakeLists.txt b/task1/CMakeLists.txt new file mode 100644 index 0000000..c8b3947 --- /dev/null +++ b/task1/CMakeLists.txt @@ -0,0 +1,26 @@ +find_package(Qt6 COMPONENTS Core REQUIRED) +find_package(fmt) + +find_package(Python3 COMPONENTS Interpreter REQUIRED) + +add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dataset.dat + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dataset-gen.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dataset-gen.py + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating random dataset") +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dataset.dat + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dataset.dat + COMMAND cmake -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/dataset.dat ${CMAKE_CURRENT_BINARY_DIR}/dataset.dat + COMMENT "Copying dataset") + +add_custom_target(task1_7_dataset + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/dataset.dat + ${CMAKE_CURRENT_BINARY_DIR}/dataset.dat) + +add_executable(task1_7 main.cpp) +target_link_libraries(task1_7 + fmt::fmt + Qt::Core) + +add_dependencies(task1_7 task1_7_dataset)