mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
Only use FetchContent on CMake >= 3.11
This commit is contained in:
parent
b3d4dba7e0
commit
ea45158d7d
@ -1,8 +1,11 @@
|
|||||||
|
set(FetchContent_INCLUDED FALSE)
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
find_package(Git QUIET)
|
find_package(Git QUIET)
|
||||||
find_package(Subversion QUIET)
|
find_package(Subversion QUIET)
|
||||||
if(Git_FOUND OR Subversion_FOUND)
|
# no FetchContent until 3.11
|
||||||
|
if((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.11.0") AND (Git_FOUND OR Subversion_FOUND))
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
set(FetchContent_INCLUDED TRUE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -42,7 +45,7 @@ function(FetchDependency name)
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "The provided path to ${ARGS_DIR} does not exist (Use ${name}_PATH)")
|
message(FATAL_ERROR "The provided path to ${ARGS_DIR} does not exist (Use ${name}_PATH)")
|
||||||
endif()
|
endif()
|
||||||
elseif((Subversion_FOUND AND ARGS_SVN_REPOSITORY) OR (Git_FOUND AND ARGS_GIT_REPOSITORY) OR (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0" AND ARGS_FILE_DOWNLOAD))
|
elseif(FetchContent_INCLUDED AND ((Subversion_FOUND AND ARGS_SVN_REPOSITORY) OR (Git_FOUND AND ARGS_GIT_REPOSITORY) OR (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0" AND ARGS_FILE_DOWNLOAD)))
|
||||||
set(${name}_PATH ${VGM_SOURCE_DIR}/dependencies/${ARGS_DIR})
|
set(${name}_PATH ${VGM_SOURCE_DIR}/dependencies/${ARGS_DIR})
|
||||||
set(${name}_PATH ${${name}_PATH} PARENT_SCOPE)
|
set(${name}_PATH ${${name}_PATH} PARENT_SCOPE)
|
||||||
set(${name}_SOURCE "(download)" PARENT_SCOPE)
|
set(${name}_SOURCE "(download)" PARENT_SCOPE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user