Skip to content

Commit 65c760a

Browse files
authored
Expand absolute path later in get_cpm.cmake (#397)
* Expand absolute path later in get_cpm.cmake Supports expanding tildes in the environment. * Apply cmake-format to get_cpm.cmake * Use .cmake-format file
1 parent b5e60e7 commit 65c760a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/get_cpm.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
set(CPM_DOWNLOAD_VERSION 1.0.0-development-version)
22

33
if(CPM_SOURCE_CACHE)
4-
# Expand relative path. This is important if the provided path contains a tilde (~)
5-
get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE)
64
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
75
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
86
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
97
else()
108
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
119
endif()
1210

11+
# Expand relative path. This is important if the provided path contains a tilde (~)
12+
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
1313
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
1414
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
1515
file(DOWNLOAD

0 commit comments

Comments
 (0)