Skip to content

Commit

Permalink
Merge pull request #1245 from chuckatkins/fix-target-namespace-backwa…
Browse files Browse the repository at this point in the history
…rd-compatibility

Use a version check to provide backwards comatible CMake imported target names
  • Loading branch information
nlohmann authored Sep 19, 2018
2 parents 99939d6 + 3b1a5ca commit e4bc98d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@PACKAGE_INIT@
if(NOT TARGET @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
if((NOT TARGET @NLOHMANN_JSON_TARGET_NAME@) AND
(PACKAGE_FIND_VERSION VERSION_LESS 3.2.0))
add_library(@NLOHMANN_JSON_TARGET_NAME@ ALIAS @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@)
endif()
endif()
check_required_components("@PROJECT_NAME@")

0 comments on commit e4bc98d

Please sign in to comment.