fix superbuild cmake < 3.17 (#193)

* CPM_INDENT in the global scope as suggest

* Fix FetchContent failure with cmake < 3.17

* format
This commit is contained in:
Xavier Muller
2021-02-07 17:07:47 +01:00
committed by GitHub
parent 7000572bbe
commit 1f5cb903e5

View File

@@ -41,6 +41,9 @@ It is recommended to upgrade CPM to the most recent version. \
See https://github.com/TheLartians/CPM.cmake for more information." See https://github.com/TheLartians/CPM.cmake for more information."
) )
endif() endif()
if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
include(FetchContent)
endif()
return() return()
endif() endif()
@@ -133,7 +136,10 @@ include(CMakeParseArguments)
# Initialize logging prefix # Initialize logging prefix
if(NOT CPM_INDENT) if(NOT CPM_INDENT)
set(CPM_INDENT "CPM:") set(CPM_INDENT
"CPM:"
CACHE INTERNAL ""
)
endif() endif()
function(cpm_find_package NAME VERSION) function(cpm_find_package NAME VERSION)