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