From 1f5cb903e585cc55ff8cf2dacce206e42c36b17c Mon Sep 17 00:00:00 2001 From: Xavier Muller Date: Sun, 7 Feb 2021 17:07:47 +0100 Subject: [PATCH] fix superbuild cmake < 3.17 (#193) * CPM_INDENT in the global scope as suggest * Fix FetchContent failure with cmake < 3.17 * format --- cmake/CPM.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 2bd2def..cc4418b 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -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." ) endif() + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + include(FetchContent) + endif() return() endif() @@ -133,7 +136,10 @@ include(CMakeParseArguments) # Initialize logging prefix if(NOT CPM_INDENT) - set(CPM_INDENT "CPM:") + set(CPM_INDENT + "CPM:" + CACHE INTERNAL "" + ) endif() function(cpm_find_package NAME VERSION)