Updated CMakeLists.txt to add install target when needed.
This commit is contained in:
parent
5f199477d4
commit
724f62858b
@ -6,6 +6,7 @@ cmake_minimum_required(VERSION 3.2)
|
|||||||
# and associate the path to json.hpp via target_include_directories()
|
# and associate the path to json.hpp via target_include_directories()
|
||||||
if(NOT TARGET json-hpp)
|
if(NOT TARGET json-hpp)
|
||||||
set(NLOHMANN_JSON_DIR "" CACHE STRING "path to json.hpp")
|
set(NLOHMANN_JSON_DIR "" CACHE STRING "path to json.hpp")
|
||||||
|
set(ADD_INSTALL_TARGET TRUE)
|
||||||
|
|
||||||
# find nlohmann's json.hpp
|
# find nlohmann's json.hpp
|
||||||
find_path(JSON_HPP nlohmann/json.hpp
|
find_path(JSON_HPP nlohmann/json.hpp
|
||||||
@ -71,7 +72,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||||||
endif()
|
endif()
|
||||||
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(
|
install(
|
||||||
FILES
|
FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/json-schema.hpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/json-schema.hpp
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user