You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A behavior recently added in #604 attempts to emulate a FetchContent behavior for allowing find_package in CONFIG mode to be redirected to some CMake files.
In this section added in the PR's changelist:
if(DEFINED CMAKE_FIND_PACKAGE_REDIRECTS_DIR)
# Redirect find_package calls to the CPM package. This is what FetchContent does when you set# OVERRIDE_FIND_PACKAGE. The CMAKE_FIND_PACKAGE_REDIRECTS_DIR works for find_package in CONFIG# mode, unlike the Find${Name}.cmake fallback. CMAKE_FIND_PACKAGE_REDIRECTS_DIR is not defined# in script mode, or in CMake < 3.24.# https://cmake.org/cmake/help/latest/module/FetchContent.html#fetchcontent-find-package-integration-examples string(TOLOWER ${Name} NameLower)
file(WRITE ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/${NameLower}-config.cmake
"include(\"${CMAKE_CURRENT_LIST_DIR}/${NameLower}-extra.cmake\" OPTIONAL)\n""include(\"${CMAKE_CURRENT_LIST_DIR}/${Name}Extra.cmake\" OPTIONAL)\n"
)
file(WRITE ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/${NameLower}-version.cmake
"set(PACKAGE_VERSION_COMPATIBLE TRUE)\n""set(PACKAGE_VERSION_EXACT TRUE)\n"
)
else()
file(WRITE ${CPM_MODULE_PATH}/Find${Name}.cmake
"include(\"${CPM_FILE}\")\n${ARGN}\nset(${Name}_FOUND TRUE)"
)
endif()
To match cmake's behavior. I believe this was actually the intent of @patstew's change, but the ${CMAKE_CURRENT_LIST_DIR} is being evaluated prior to writing out the file.
The text was updated successfully, but these errors were encountered:
A behavior recently added in #604 attempts to emulate a FetchContent behavior for allowing
find_package
in CONFIG mode to be redirected to some CMake files.In this section added in the PR's changelist:
These two lines:
should be
To match cmake's behavior. I believe this was actually the intent of @patstew's change, but the
${CMAKE_CURRENT_LIST_DIR}
is being evaluated prior to writing out the file.The text was updated successfully, but these errors were encountered: