mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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
13 lines
296 B
CMake
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)
|