You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
669 B
15 lines
669 B
|
5 years ago
|
# Like `FetchContent_MakeAvailable` but passes EXCLUDE_FROM_ALL to `add_subdirectory`.
|
||
|
|
macro(FetchContent_MakeAvailableExcludeFromAll)
|
||
|
|
foreach(contentName IN ITEMS ${ARGV})
|
||
|
|
string(TOLOWER ${contentName} contentNameLower)
|
||
|
|
FetchContent_GetProperties(${contentName})
|
||
|
|
if(NOT ${contentNameLower}_POPULATED)
|
||
|
|
FetchContent_Populate(${contentName})
|
||
|
|
if(EXISTS ${${contentNameLower}_SOURCE_DIR}/CMakeLists.txt)
|
||
|
|
add_subdirectory(${${contentNameLower}_SOURCE_DIR}
|
||
|
|
${${contentNameLower}_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||
|
|
endif()
|
||
|
|
endif()
|
||
|
|
endforeach()
|
||
|
|
endmacro()
|