mirror of
https://github.com/nlohmann/json.git
synced 2026-07-03 17:24:18 +00:00
Enable target namespaces and build dir project config
CMake convention is to use a project namespace, i.e. Foo::, for imported targets. When multiple targets are imported from a project, this looks like Foo::Bar1 Foo::Bar2, etc. This adds the nlohmann_json:: namespace to the exported target names. This also allows the generated project config files to be used from the build directory instead of just the install directory.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
@PACKAGE_INIT@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS_EXPORT_NAME@.cmake")
|
||||
if(NOT TARGET @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS_EXPORT_NAME@.cmake")
|
||||
endif()
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
Reference in New Issue
Block a user