From ab1262200924a6b79e6330574b52da59e3471fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Mon, 22 Jul 2024 22:01:33 +0200 Subject: [PATCH] Add install cmake/make target --- CMakeLists.txt | 10 +++++++++- Makefile | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31ce186..06a336e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,4 +33,12 @@ include_directories( ) add_library(fimdlp src/CPPFImdlp.cpp src/Metrics.cpp src/BinDisc.cpp src/Discretizer.cpp) -target_link_libraries(fimdlp "${TORCH_LIBRARIES}") \ No newline at end of file +target_link_libraries(fimdlp "${TORCH_LIBRARIES}") + +# Installation +# ------------ +install(TARGETS fimdlp + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + CONFIGURATIONS Release) +install(DIRECTORY src/ DESTINATION include/fimdlp FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h") diff --git a/Makefile b/Makefile index 263c515..b737bb4 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ build: @cmake -B build_release -S . -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF -DENABLE_SAMPLE=ON @cmake --build build_release -j 8 +install: + @cmake --build build_release --target install -j 8 + test: @if [ -d build_debug ]; then rm -fr build_debug; fi @mkdir build_debug