mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Polyfill fetchcontent_makeAvailable for cmake < 3.14
This commit is contained in:
parent
498d8d464c
commit
6e3e216156
1 changed files with 26 additions and 0 deletions
|
@ -46,6 +46,32 @@ option(USE_BUNDLED_TWEENY "Use the bundled version of tweeny."
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
|
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
|
||||||
|
message("Adding FetchContent_MakeAvailable")
|
||||||
|
# from cmakes sources
|
||||||
|
macro(FetchContent_MakeAvailable)
|
||||||
|
|
||||||
|
foreach(contentName IN ITEMS ${ARGV})
|
||||||
|
string(TOLOWER ${contentName} contentNameLower)
|
||||||
|
FetchContent_GetProperties(${contentName})
|
||||||
|
if(NOT ${contentNameLower}_POPULATED)
|
||||||
|
FetchContent_Populate(${contentName})
|
||||||
|
|
||||||
|
# Only try to call add_subdirectory() if the populated content
|
||||||
|
# can be treated that way. Protecting the call with the check
|
||||||
|
# allows this function to be used for projects that just want
|
||||||
|
# to ensure the content exists, such as to provide content at
|
||||||
|
# a known location.
|
||||||
|
if(EXISTS ${${contentNameLower}_SOURCE_DIR}/CMakeLists.txt)
|
||||||
|
add_subdirectory(${${contentNameLower}_SOURCE_DIR}
|
||||||
|
${${contentNameLower}_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Include Qt basic functions
|
# Include Qt basic functions
|
||||||
|
|
Loading…
Reference in a new issue