From a013354bc6484e05d8b3cb52181836e8f96993ab Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Sat, 18 Feb 2017 08:15:27 +0100 Subject: [PATCH] cmake: only install json-schema.hpp if not a subdir (install rule needs more work, however) --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66fe392..cf4b878 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,12 +35,14 @@ target_link_libraries(json-schema-validator PUBLIC json-hpp) -install( - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/src/json-schema-validator.hpp - DESTINATION +if(NOT TARGET json-hpp) # if used as a subdirectory do not install json-schema.hpp + install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/src/json-schema.hpp + DESTINATION ${CMAKE_INSTALL_PREFIX}/include -) + ) +endif() # simple json-schema-validator-executable add_executable(json-schema-validate app/json-schema-validate.cpp)