Fix config.h location problem

This commit is contained in:
2024-03-09 12:27:05 +01:00
parent 635ef22520
commit 0b65e34772
5 changed files with 10 additions and 5 deletions

View File

@@ -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)
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release)

View File

@@ -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)

View File

@@ -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
)

View File

@@ -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)

View File

@@ -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})