Skip to content

Commit 07450b5

Browse files
committed
Export cmake as jsoncons::jsoncons
Fix #517 https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html explains what it means. It's possible to temporarily make the old name to be alias for the new name for compatibility, if desired. Not implemented in this commit yet.
1 parent 5c8a669 commit 07450b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ install(TARGETS jsoncons
4545

4646
# Makes the project importable from the build directory
4747
export(EXPORT ${PROJECT_NAME}-targets
48+
NAMESPACE jsoncons::
4849
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
4950

5051
install(DIRECTORY ${JSONCONS_INCLUDE_DIR}/jsoncons
@@ -75,5 +76,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
7576
DESTINATION ${JSONCONS_CMAKECONFIG_INSTALL_DIR})
7677
install(EXPORT ${PROJECT_NAME}-targets
7778
FILE ${PROJECT_NAME}Targets.cmake
79+
NAMESPACE jsoncons::
7880
DESTINATION ${JSONCONS_CMAKECONFIG_INSTALL_DIR})
7981

0 commit comments

Comments
 (0)