Skip to content

Commit 1f5cb90

Browse files
authored
fix superbuild cmake < 3.17 (#193)
* CPM_INDENT in the global scope as suggest * Fix FetchContent failure with cmake < 3.17 * format
1 parent 7000572 commit 1f5cb90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmake/CPM.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ It is recommended to upgrade CPM to the most recent version. \
4141
See https://github.com/TheLartians/CPM.cmake for more information."
4242
)
4343
endif()
44+
if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
45+
include(FetchContent)
46+
endif()
4447
return()
4548
endif()
4649

@@ -133,7 +136,10 @@ include(CMakeParseArguments)
133136

134137
# Initialize logging prefix
135138
if(NOT CPM_INDENT)
136-
set(CPM_INDENT "CPM:")
139+
set(CPM_INDENT
140+
"CPM:"
141+
CACHE INTERNAL ""
142+
)
137143
endif()
138144

139145
function(cpm_find_package NAME VERSION)

0 commit comments

Comments
 (0)