Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export into the build tree the installed targets #2272

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MiguelBarro
Copy link

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.

@tencent-adm
Copy link

tencent-adm commented Apr 2, 2024

CLA assistant check
All committers have signed the CLA.

@MiguelBarro MiguelBarro marked this pull request as ready for review April 2, 2024 23:15
…nd expected by many projects.

Signed-off-by: Guybrush <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants