rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

Export into the build tree the installed targets

Open MiguelBarro opened this issue 1 year ago • 1 comments

Currently the CMake is modifying the CMake user's package registry by doing:

# Export package for use from the build tree
EXPORT( PACKAGE ${PROJECT_NAME} )

the above hints the binary directory as a path to find a config dir. Accordingly the config is set up and made available via:

INCLUDE(CMakePackageConfigHelpers)
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
    ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in
    ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @ONLY)

unfortunately the config file reference the targets which are not installed in the build tree. This makes projects that find RapidJSON using the user's package registry (it must be disabled on purpose) fail because the target file cannot be found. This pull request exports the targets installed.

MiguelBarro avatar Apr 02 '24 21:04 MiguelBarro

CLA assistant check
All committers have signed the CLA.

tencent-adm avatar Apr 02 '24 21:04 tencent-adm