From ccb634196725fed4bfee0d15e3635c97b54befc3 Mon Sep 17 00:00:00 2001 From: Shunsuke Kanda Date: Tue, 29 Jun 2021 12:22:55 +0900 Subject: [PATCH] add install options --- CMakeLists.txt | 6 +++++- tools/CMakeLists.txt | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20b9115..03700a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,14 @@ message(STATUS "CXX_FLAGS_RELEASE are ${CMAKE_CXX_FLAGS_RELEASE}") include_directories(include) add_subdirectory(sample) - add_subdirectory(tools) enable_testing() add_subdirectory(tests) file(COPY ${CMAKE_SOURCE_DIR}/tests/keys.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tests) + +# Install the library +file(GLOB XCDAT_HEADER_FILES include/xcdat/*.hpp) +install(FILES include/xcdat.hpp DESTINATION include) +install(FILES ${XCDAT_HEADER_FILES} DESTINATION include/xcdat) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6d782db..38b379a 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,7 +1,13 @@ -add_executable(xcdat_build xcdat_build.cpp) -add_executable(xcdat_lookup xcdat_lookup.cpp) -add_executable(xcdat_decode xcdat_decode.cpp) -add_executable(xcdat_prefix_search xcdat_prefix_search.cpp) -add_executable(xcdat_predictive_search xcdat_predictive_search.cpp) -add_executable(xcdat_enumerate xcdat_enumerate.cpp) +set(XCDAT_FILES + "xcdat_build" + "xcdat_lookup" + "xcdat_decode" + "xcdat_prefix_search" + "xcdat_predictive_search" + "xcdat_enumerate" +) +foreach(XCDAT_FILE ${XCDAT_FILES}) + add_executable(${XCDAT_FILE} ${XCDAT_FILE}.cpp) + install(TARGETS ${XCDAT_FILE} RUNTIME DESTINATION bin) +endforeach(XCDAT_FILE)