From 724f62858b61735d3ab13e20292ae5c56187f82c Mon Sep 17 00:00:00 2001 From: Anthony Wertz Date: Thu, 15 Mar 2018 11:44:15 -0400 Subject: [PATCH] Updated CMakeLists.txt to add install target when needed. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da3c4f..a606c70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ cmake_minimum_required(VERSION 3.2) # and associate the path to json.hpp via target_include_directories() if(NOT TARGET json-hpp) set(NLOHMANN_JSON_DIR "" CACHE STRING "path to json.hpp") + set(ADD_INSTALL_TARGET TRUE) # find nlohmann's json.hpp find_path(JSON_HPP nlohmann/json.hpp @@ -71,7 +72,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() -if(NOT TARGET json-hpp) # if used as a subdirectory do not install json-schema.hpp +if(ADD_INSTALL_TARGET) # if used as a subdirectory do not install json-schema.hpp install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/json-schema.hpp