Skip to content

Commit

Permalink
- isolated namespace targets into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyrachev authored and cdunn2001 committed May 5, 2021
1 parent 2af4a4c commit 993e4e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ if(JSONCPP_WITH_CMAKE_PACKAGE)
COMPATIBILITY SameMajorVersion)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake ${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfig.cmake
${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp-namespaced-targets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp)
endif()

Expand Down
7 changes: 7 additions & 0 deletions jsoncpp-namespaced-targets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (TARGET jsoncpp_static)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
elseif (TARGET jsoncpp_lib)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
endif ()
9 changes: 1 addition & 8 deletions jsoncppConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ cmake_policy(VERSION 3.0)
@PACKAGE_INIT@

include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )

if(TARGET jsoncpp_static)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED )
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
elseif(TARGET jsoncpp_lib)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED )
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
endif()
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-namespaced-targets.cmake" )

check_required_components(JsonCpp)

Expand Down

0 comments on commit 993e4e2

Please sign in to comment.