From 855027546929acc503f2d6c4bc73ddfa53a412a5 Mon Sep 17 00:00:00 2001 From: "Watal M. Iwasaki" Date: Tue, 2 Jul 2024 11:14:49 +0900 Subject: [PATCH] :art: Install clipp and json without copying to ./include/ --- .gitignore | 2 -- CMakeLists.txt | 17 ++++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 3314af9..796b96d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ /build -/include/clippson/*.h -/include/clippson/json* diff --git a/CMakeLists.txt b/CMakeLists.txt index 62ac5a8..4d3aac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,19 +42,12 @@ endfunction() git_fetch(clipp v1.2.3.1 heavywatal/clipp) git_fetch(json v3.11.3 heavywatal/json) -set(subrepo_files - ${clipp_SOURCE_DIR}/include/clipp.h - ${json_SOURCE_DIR}/src/json.hpp - ${json_SOURCE_DIR}/src/json_fwd.hpp -) -foreach(file IN LISTS subrepo_files) - configure_file(${file} ${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/ COPYONLY) -endforeach() - add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) target_include_directories(${PROJECT_NAME} INTERFACE $ + $ + $ $ ) target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) @@ -62,6 +55,12 @@ target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install(FILES + ${clipp_SOURCE_DIR}/include/clipp.h + ${json_SOURCE_DIR}/src/json.hpp + ${json_SOURCE_DIR}/src/json_fwd.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} +) install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-config )