Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sylvain Joubert
CMake
Commits
d610407c
Commit
d610407c
authored
8 years ago
by
Ruslan Baratov
Committed by
Brad King
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ExternalProject: Use uppercase placeholders for script generation
Use uppercase variables for future 'configure_file' command.
parent
e0da6c3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/ExternalProject.cmake
+27
-27
27 additions, 27 deletions
Modules/ExternalProject.cmake
with
27 additions
and
27 deletions
Modules/ExternalProject.cmake
+
27
−
27
View file @
d610407c
...
...
@@ -847,25 +847,25 @@ endif()
endfunction
(
_ep_write_gitupdate_script
)
function
(
_ep_write_downloadfile_script script_filename
remote local
timeout no_progress hash tls_verify tls_cainfo
)
function
(
_ep_write_downloadfile_script script_filename
REMOTE LOCAL
timeout no_progress hash tls_verify tls_cainfo
)
if
(
timeout
)
set
(
timeout_args
TIMEOUT
${
timeout
}
)
set
(
timeout_msg
"
${
timeout
}
seconds"
)
set
(
TIMEOUT_ARGS
TIMEOUT
${
timeout
}
)
set
(
TIMEOUT_MSG
"
${
timeout
}
seconds"
)
else
()
set
(
timeout_args
"# no TIMEOUT"
)
set
(
timeout_msg
"none"
)
set
(
TIMEOUT_ARGS
"# no TIMEOUT"
)
set
(
TIMEOUT_MSG
"none"
)
endif
()
if
(
no_progress
)
set
(
show_progress
""
)
set
(
SHOW_PROGRESS
""
)
else
()
set
(
show_progress
"SHOW_PROGRESS"
)
set
(
SHOW_PROGRESS
"SHOW_PROGRESS"
)
endif
()
if
(
"
${
hash
}
"
MATCHES
"
${
_ep_hash_regex
}
"
)
string
(
CONCAT hash_check
"if(EXISTS
\"
${
local
}
\"
)
\n
"
" file(
\"
${
CMAKE_MATCH_1
}
\"
\"
${
local
}
\"
hash_value)
\n
"
"if(EXISTS
\"
${
LOCAL
}
\"
)
\n
"
" file(
\"
${
CMAKE_MATCH_1
}
\"
\"
${
LOCAL
}
\"
hash_value)
\n
"
" if(
\"
x
\$
{hash_value}
\"
STREQUAL
\"
x
${
CMAKE_MATCH_2
}
\"
)
\n
"
" return()
\n
"
" endif()
\n
"
...
...
@@ -875,15 +875,15 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
set
(
hash_check
""
)
endif
()
set
(
tls_verify_code
""
)
set
(
tls_cainfo_code
""
)
set
(
TLS_VERIFY_CODE
""
)
set
(
TLS_CAINFO_CODE
""
)
# check for curl globals in the project
if
(
DEFINED CMAKE_TLS_VERIFY
)
set
(
tls_verify_code
"set(CMAKE_TLS_VERIFY
${
CMAKE_TLS_VERIFY
}
)"
)
set
(
TLS_VERIFY_CODE
"set(CMAKE_TLS_VERIFY
${
CMAKE_TLS_VERIFY
}
)"
)
endif
()
if
(
DEFINED CMAKE_TLS_CAINFO
)
set
(
tls_cainfo_code
"set(CMAKE_TLS_CAINFO
\"
${
CMAKE_TLS_CAINFO
}
\"
)"
)
set
(
TLS_CAINFO_CODE
"set(CMAKE_TLS_CAINFO
\"
${
CMAKE_TLS_CAINFO
}
\"
)"
)
endif
()
# now check for curl locals so that the local values
...
...
@@ -892,28 +892,28 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
# check for tls_verify argument
string
(
LENGTH
"
${
tls_verify
}
"
tls_verify_len
)
if
(
tls_verify_len GREATER 0
)
set
(
tls_verify_code
"set(CMAKE_TLS_VERIFY
${
tls_verify
}
)"
)
set
(
TLS_VERIFY_CODE
"set(CMAKE_TLS_VERIFY
${
tls_verify
}
)"
)
endif
()
# check for tls_cainfo argument
string
(
LENGTH
"
${
tls_cainfo
}
"
tls_cainfo_len
)
if
(
tls_cainfo_len GREATER 0
)
set
(
tls_cainfo_code
"set(CMAKE_TLS_CAINFO
\"
${
tls_cainfo
}
\"
)"
)
set
(
TLS_CAINFO_CODE
"set(CMAKE_TLS_CAINFO
\"
${
tls_cainfo
}
\"
)"
)
endif
()
file
(
WRITE
${
script_filename
}
"
${
hash_check
}
message(STATUS
\"
downloading...
src='
${
remote
}
'
dst='
${
local
}
'
timeout='
${
timeout_msg
}
'
\"
)
src='
${
REMOTE
}
'
dst='
${
LOCAL
}
'
timeout='
${
TIMEOUT_MSG
}
'
\"
)
${
tls_verify_code
}
${
tls_cainfo_code
}
${
TLS_VERIFY_CODE
}
${
TLS_CAINFO_CODE
}
file(DOWNLOAD
\"
${
remote
}
\"
\"
${
local
}
\"
${
show_progress
}
${
timeout_args
}
\"
${
REMOTE
}
\"
\"
${
LOCAL
}
\"
${
SHOW_PROGRESS
}
${
TIMEOUT_ARGS
}
STATUS status
LOG log)
...
...
@@ -921,7 +921,7 @@ list(GET status 0 status_code)
list(GET status 1 status_string)
if(NOT status_code EQUAL 0)
message(FATAL_ERROR
\"
error: downloading '
${
remote
}
' failed
message(FATAL_ERROR
\"
error: downloading '
${
REMOTE
}
' failed
status_code:
\$
{status_code}
status_string:
\$
{status_string}
log:
\$
{log}
...
...
@@ -935,7 +935,7 @@ message(STATUS \"downloading... done\")
endfunction
()
function
(
_ep_write_verifyfile_script script_filename
local
hash retries download_script
)
function
(
_ep_write_verifyfile_script script_filename
LOCAL
hash retries download_script
)
if
(
"
${
hash
}
"
MATCHES
"
${
_ep_hash_regex
}
"
)
set
(
algo
"
${
CMAKE_MATCH_1
}
"
)
string
(
TOLOWER
"
${
CMAKE_MATCH_2
}
"
expect_value
)
...
...
@@ -972,7 +972,7 @@ endif()")
else
()
set
(
script_content
"message(STATUS
\"
verifying file... warning: did not verify file - no URL_HASH specified?
\"
)"
)
endif
()
file
(
WRITE
${
script_filename
}
"set(file
\"
${
local
}
\"
)
file
(
WRITE
${
script_filename
}
"set(file
\"
${
LOCAL
}
\"
)
message(STATUS
\"
verifying file...
file='
\$
{file}'
\"
)
${
script_content
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment