diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cab5f3..0c0723f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 17) cmake_policy(SET CMP0135 NEW) # Find dependencies -find_package(Torch REQUIRED) +find_package(Torch CONFIG REQUIRED) # Options # ------- @@ -28,7 +28,6 @@ endif() if (ENABLE_TESTING) message("Debug mode") - enable_testing() set(CODE_COVERAGE ON) set(GCC_COVERAGE_LINK_FLAGS "${GCC_COVERAGE_LINK_FLAGS} -lgcov --coverage") @@ -62,11 +61,10 @@ write_basic_package_version_file( install(TARGETS fimdlp EXPORT fimdlpTargets ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - CONFIGURATIONS Release) + LIBRARY DESTINATION lib) -install(DIRECTORY src/ DESTINATION include/fimdlp FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h") -install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/config.h DESTINATION include/fimdlp CONFIGURATIONS Release) +install(DIRECTORY src/ DESTINATION include/fimdlp FILES_MATCHING PATTERN "*.h") +install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/config.h DESTINATION include/fimdlp) install(EXPORT fimdlpTargets FILE fimdlpTargets.cmake diff --git a/Makefile b/Makefile index 8cf166d..aa3e8af 100644 --- a/Makefile +++ b/Makefile @@ -39,4 +39,12 @@ test: ## Build Debug version and run tests exit 1; \ fi @echo ">>> Updating coverage badge..." - @env python update_coverage.py $(f_debug)/tests \ No newline at end of file + @env python update_coverage.py $(f_debug)/tests + +conan-create: ## Create the conan package + @echo ">>> Creating the conan package..." + conan create . --build=missing --pr:b=release -pr:h=release + # conan create . --build=missing -pr:b=debug -pr:h=debug + + + diff --git a/test_package/CMakeUserPresets.json b/test_package/CMakeUserPresets.json index 402e164..74e2323 100644 --- a/test_package/CMakeUserPresets.json +++ b/test_package/CMakeUserPresets.json @@ -4,6 +4,7 @@ "conan": {} }, "include": [ - "build/gcc-14-x86_64-gnu17-release/generators/CMakePresets.json" + "build/gcc-14-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-14-x86_64-gnu17-debug/generators/CMakePresets.json" ] } \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1f873ea..de03314 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,7 @@ find_package(arff-files REQUIRED) find_package(GTest REQUIRED) +find_package(Torch CONFIG REQUIRED) include_directories( ${libtorch_INCLUDE_DIRS_DEBUG}