From 0b65e34772e38f8eaa852424d5d2d18372540850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Sat, 9 Mar 2024 12:27:05 +0100 Subject: [PATCH] Fix config.h location problem --- CMakeLists.txt | 2 +- Makefile | 5 +++++ config/CMakeLists.txt | 2 +- sample/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fedd2e7..0d3669e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,4 +84,4 @@ install(TARGETS BayesNet LIBRARY DESTINATION lib CONFIGURATIONS Release) install(DIRECTORY bayesnet/ DESTINATION include/bayesnet FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h") -install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/config.h DESTINATION include/bayesnet CONFIGURATIONS Release) \ No newline at end of file +install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release) \ No newline at end of file diff --git a/Makefile b/Makefile index e7ce446..9c9ac82 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,11 @@ clean: ## Clean the tests info $(call ClearTests) @echo ">>> Done"; +uninstall: ## Uninstall library + @echo ">>> Uninstalling BayesNet..."; + xargs rm < $(f_release)/install_manifest.txt + @echo ">>> Done"; + install: ## Install library @echo ">>> Installing BayesNet..."; @cmake --install $(f_release) diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index c6c4cde..3741116 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -1,4 +1,4 @@ configure_file( "config.h.in" - "${CMAKE_BINARY_DIR}/configured_files/include/config.h" ESCAPE_QUOTES + "${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h" ESCAPE_QUOTES ) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 85486ad..9d256a8 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -5,13 +5,13 @@ project(bayesnet_sample) set(CMAKE_CXX_STANDARD 17) find_package(Torch REQUIRED) -find_library(BayesNet NAMES BayesNet libBayesNet REQUIRED) +find_library(BayesNet NAMES BayesNet.a libBayesNet.a REQUIRED) include_directories( lib/Files lib/mdlp lib/json/include - /usr/local/include/ + SYSTEM include ) add_subdirectory(lib/Files) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7613253..d1ab7ba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,7 +6,7 @@ if(ENABLE_TESTING) ${BayesNet_SOURCE_DIR}/lib/folding ${BayesNet_SOURCE_DIR}/lib/json/include ${BayesNet_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/configured_files/include + ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet ) file(GLOB_RECURSE BayesNet_SOURCES "${BayesNet_SOURCE_DIR}/bayesnet/*.cc") set(TEST_SOURCES_BAYESNET TestBayesModels.cc TestBayesNetwork.cc TestBayesMetrics.cc TestUtils.cc ${BayesNet_SOURCES})