Commit 901b3c24f3b323011e999cb57c18950406d6b670
Committed by
Henry Schreiner
1 parent
09bff904
Add CMake install command for include files if CUR_PROJ is true
Showing
1 changed file
with
6 additions
and
2 deletions
CMakeLists.txt
| ... | ... | @@ -53,6 +53,9 @@ file(GLOB CLI_headers "${CMAKE_CURRENT_SOURCE_DIR}/include/CLI/*") |
| 53 | 53 | # To see in IDE, must be listed for target |
| 54 | 54 | add_library(CLI11 INTERFACE) |
| 55 | 55 | target_include_directories(CLI11 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") |
| 56 | +if (CUR_PROJ) | |
| 57 | + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/CLI DESTINATION include) | |
| 58 | +endif() | |
| 56 | 59 | |
| 57 | 60 | # Single file test |
| 58 | 61 | find_package(PythonInterp) |
| ... | ... | @@ -73,7 +76,9 @@ if(CLI_SINGLE_FILE) |
| 73 | 76 | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/CLI11.hpp") |
| 74 | 77 | set_target_properties(generate_cli_single_file |
| 75 | 78 | PROPERTIES FOLDER "Scripts") |
| 76 | - | |
| 79 | + if (CUR_PROJ) | |
| 80 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/CLI11.hpp DESTINATION include) | |
| 81 | + endif() | |
| 77 | 82 | add_library(CLI11_SINGLE INTERFACE) |
| 78 | 83 | target_link_libraries(CLI11_SINGLE INTERFACE CLI11) |
| 79 | 84 | add_dependencies(CLI11_SINGLE generate_cli_single_file) |
| ... | ... | @@ -93,4 +98,3 @@ option(CLI_EXAMPLES "Build the examples" ${CUR_PROJ}) |
| 93 | 98 | if(CLI_EXAMPLES) |
| 94 | 99 | add_subdirectory(examples) |
| 95 | 100 | endif() |
| 96 | - | ... | ... |