Files
CMake/Tests/RunCMake/FetchContent_find_package/Try_find_package-NEVER.cmake
Craig Scott 29e31e2825 Packages: Integrate FetchContent and find_package()
Allow FetchContent_MakeAvailable() to try a call to
find_package() first, or redirect a find_package() call to
FetchContent_MakeAvailable(). The user can set variables
to control which of these are allowed or tried by default.

Fixes: #21687
2022-05-03 16:48:11 +10:00

13 lines
296 B
CMake

include(FetchContent)
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageConfigs)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
FetchContent_Declare(
AddedProject
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/AddedProject
FIND_PACKAGE_ARGS REQUIRED
)
FetchContent_MakeAvailable(AddedProject)