Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Özgür Ozan Sen
ogs
Commits
c5f69413
Commit
c5f69413
authored
1 year ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
[cmake] Update CPM to 0.38.2.
parent
0e52c46c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/cmake/CPM.cmake
+51
-28
51 additions, 28 deletions
scripts/cmake/CPM.cmake
with
51 additions
and
28 deletions
scripts/cmake/CPM.cmake
+
51
−
28
View file @
c5f69413
...
@@ -42,7 +42,7 @@ if(NOT COMMAND cpm_message)
...
@@ -42,7 +42,7 @@ if(NOT COMMAND cpm_message)
endfunction
()
endfunction
()
endif
()
endif
()
set
(
CURRENT_CPM_VERSION 0.3
7.0
)
set
(
CURRENT_CPM_VERSION 0.3
8.2
)
get_filename_component
(
CPM_CURRENT_DIRECTORY
"
${
CMAKE_CURRENT_LIST_DIR
}
"
REALPATH
)
get_filename_component
(
CPM_CURRENT_DIRECTORY
"
${
CMAKE_CURRENT_LIST_DIR
}
"
REALPATH
)
if
(
CPM_DIRECTORY
)
if
(
CPM_DIRECTORY
)
...
@@ -513,8 +513,8 @@ function(CPMAddPackage)
...
@@ -513,8 +513,8 @@ function(CPMAddPackage)
if
(
argnLength EQUAL 1
)
if
(
argnLength EQUAL 1
)
cpm_parse_add_package_single_arg
(
"
${
ARGN
}
"
ARGN
)
cpm_parse_add_package_single_arg
(
"
${
ARGN
}
"
ARGN
)
# The shorthand syntax implies EXCLUDE_FROM_ALL
# The shorthand syntax implies EXCLUDE_FROM_ALL
and SYSTEM
set
(
ARGN
"
${
ARGN
}
;EXCLUDE_FROM_ALL;YES"
)
set
(
ARGN
"
${
ARGN
}
;EXCLUDE_FROM_ALL;YES
;SYSTEM;YES;
"
)
endif
()
endif
()
set
(
oneValueArgs
set
(
oneValueArgs
...
@@ -531,6 +531,7 @@ function(CPMAddPackage)
...
@@ -531,6 +531,7 @@ function(CPMAddPackage)
DOWNLOAD_COMMAND
DOWNLOAD_COMMAND
FIND_PACKAGE_ARGUMENTS
FIND_PACKAGE_ARGUMENTS
NO_CACHE
NO_CACHE
SYSTEM
GIT_SHALLOW
GIT_SHALLOW
EXCLUDE_FROM_ALL
EXCLUDE_FROM_ALL
SOURCE_SUBDIR
SOURCE_SUBDIR
...
@@ -626,6 +627,7 @@ function(CPMAddPackage)
...
@@ -626,6 +627,7 @@ function(CPMAddPackage)
NAME
"
${
CPM_ARGS_NAME
}
"
NAME
"
${
CPM_ARGS_NAME
}
"
SOURCE_DIR
"
${
PACKAGE_SOURCE
}
"
SOURCE_DIR
"
${
PACKAGE_SOURCE
}
"
EXCLUDE_FROM_ALL
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
EXCLUDE_FROM_ALL
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
SYSTEM
"
${
CPM_ARGS_SYSTEM
}
"
OPTIONS
"
${
CPM_ARGS_OPTIONS
}
"
OPTIONS
"
${
CPM_ARGS_OPTIONS
}
"
SOURCE_SUBDIR
"
${
CPM_ARGS_SOURCE_SUBDIR
}
"
SOURCE_SUBDIR
"
${
CPM_ARGS_SOURCE_SUBDIR
}
"
DOWNLOAD_ONLY
"
${
DOWNLOAD_ONLY
}
"
DOWNLOAD_ONLY
"
${
DOWNLOAD_ONLY
}
"
...
@@ -646,19 +648,21 @@ function(CPMAddPackage)
...
@@ -646,19 +648,21 @@ function(CPMAddPackage)
return
()
return
()
endif
()
endif
()
if
(
CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY
)
if
(
NOT CPM_ARGS_FORCE
)
cpm_find_package
(
${
CPM_ARGS_NAME
}
"
${
CPM_ARGS_VERSION
}
"
${
CPM_ARGS_FIND_PACKAGE_ARGUMENTS
}
)
if
(
CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY
)
cpm_find_package
(
${
CPM_ARGS_NAME
}
"
${
CPM_ARGS_VERSION
}
"
${
CPM_ARGS_FIND_PACKAGE_ARGUMENTS
}
)
if
(
CPM_PACKAGE_FOUND
)
if
(
CPM_PACKAGE_FOUND
)
cpm_export_variables
(
${
CPM_ARGS_NAME
}
)
cpm_export_variables
(
${
CPM_ARGS_NAME
}
)
return
()
return
()
endif
()
endif
()
if
(
CPM_LOCAL_PACKAGES_ONLY
)
if
(
CPM_LOCAL_PACKAGES_ONLY
)
message
(
message
(
SEND_ERROR
SEND_ERROR
"
${
CPM_INDENT
}
${
CPM_ARGS_NAME
}
not found via find_package(
${
CPM_ARGS_NAME
}
${
CPM_ARGS_VERSION
}
)"
"
${
CPM_INDENT
}
${
CPM_ARGS_NAME
}
not found via find_package(
${
CPM_ARGS_NAME
}
${
CPM_ARGS_VERSION
}
)"
)
)
endif
()
endif
()
endif
()
endif
()
endif
()
...
@@ -713,9 +717,15 @@ function(CPMAddPackage)
...
@@ -713,9 +717,15 @@ function(CPMAddPackage)
get_filename_component
(
download_directory
${
download_directory
}
ABSOLUTE
)
get_filename_component
(
download_directory
${
download_directory
}
ABSOLUTE
)
list
(
APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR
${
download_directory
}
)
list
(
APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR
${
download_directory
}
)
file
(
LOCK
${
download_directory
}
/../cmake.lock
)
if
(
CPM_SOURCE_CACHE
)
file
(
LOCK
${
download_directory
}
/../cmake.lock
)
endif
()
if
(
EXISTS
${
download_directory
}
)
if
(
EXISTS
${
download_directory
}
)
if
(
CPM_SOURCE_CACHE
)
file
(
LOCK
${
download_directory
}
/../cmake.lock RELEASE
)
endif
()
cpm_store_fetch_properties
(
cpm_store_fetch_properties
(
${
CPM_ARGS_NAME
}
"
${
download_directory
}
"
${
CPM_ARGS_NAME
}
"
${
download_directory
}
"
"
${
CPM_FETCHCONTENT_BASE_DIR
}
/
${
lower_case_name
}
-build"
"
${
CPM_FETCHCONTENT_BASE_DIR
}
/
${
lower_case_name
}
-build"
...
@@ -733,9 +743,13 @@ function(CPMAddPackage)
...
@@ -733,9 +743,13 @@ function(CPMAddPackage)
endif
()
endif
()
cpm_add_subdirectory
(
cpm_add_subdirectory
(
"
${
CPM_ARGS_NAME
}
"
"
${
DOWNLOAD_ONLY
}
"
"
${
CPM_ARGS_NAME
}
"
"
${${
CPM_ARGS_NAME
}
_SOURCE_DIR
}
/
${
CPM_ARGS_SOURCE_SUBDIR
}
"
"
${${
CPM_ARGS_NAME
}
_BINARY_DIR
}
"
"
${
DOWNLOAD_ONLY
}
"
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
"
${
CPM_ARGS_OPTIONS
}
"
"
${${
CPM_ARGS_NAME
}
_SOURCE_DIR
}
/
${
CPM_ARGS_SOURCE_SUBDIR
}
"
"
${${
CPM_ARGS_NAME
}
_BINARY_DIR
}
"
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
"
${
CPM_ARGS_SYSTEM
}
"
"
${
CPM_ARGS_OPTIONS
}
"
)
)
set
(
PACKAGE_INFO
"
${
PACKAGE_INFO
}
at
${
download_directory
}
"
)
set
(
PACKAGE_INFO
"
${
PACKAGE_INFO
}
at
${
download_directory
}
"
)
...
@@ -783,20 +797,23 @@ function(CPMAddPackage)
...
@@ -783,20 +797,23 @@ function(CPMAddPackage)
"
${
CPM_ARGS_NAME
}
"
"
${
CPM_ARGS_VERSION
}
"
"
${
PACKAGE_INFO
}
"
"
${
CPM_ARGS_UNPARSED_ARGUMENTS
}
"
"
${
CPM_ARGS_NAME
}
"
"
${
CPM_ARGS_VERSION
}
"
"
${
PACKAGE_INFO
}
"
"
${
CPM_ARGS_UNPARSED_ARGUMENTS
}
"
)
)
cpm_fetch_package
(
"
${
CPM_ARGS_NAME
}
"
populated
)
cpm_fetch_package
(
"
${
CPM_ARGS_NAME
}
"
populated
)
if
(
CPM_SOURCE_CACHE AND download_directory
)
file
(
LOCK
${
download_directory
}
/../cmake.lock RELEASE
)
endif
()
if
(
${
populated
}
)
if
(
${
populated
}
)
cpm_add_subdirectory
(
cpm_add_subdirectory
(
"
${
CPM_ARGS_NAME
}
"
"
${
DOWNLOAD_ONLY
}
"
"
${
CPM_ARGS_NAME
}
"
"
${${
CPM_ARGS_NAME
}
_SOURCE_DIR
}
/
${
CPM_ARGS_SOURCE_SUBDIR
}
"
"
${${
CPM_ARGS_NAME
}
_BINARY_DIR
}
"
"
${
DOWNLOAD_ONLY
}
"
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
"
${
CPM_ARGS_OPTIONS
}
"
"
${${
CPM_ARGS_NAME
}
_SOURCE_DIR
}
/
${
CPM_ARGS_SOURCE_SUBDIR
}
"
"
${${
CPM_ARGS_NAME
}
_BINARY_DIR
}
"
"
${
CPM_ARGS_EXCLUDE_FROM_ALL
}
"
"
${
CPM_ARGS_SYSTEM
}
"
"
${
CPM_ARGS_OPTIONS
}
"
)
)
endif
()
endif
()
cpm_get_fetch_properties
(
"
${
CPM_ARGS_NAME
}
"
)
cpm_get_fetch_properties
(
"
${
CPM_ARGS_NAME
}
"
)
endif
()
endif
()
if
(
EXISTS
${
download_directory
}
/../cmake.lock
)
file
(
LOCK
${
download_directory
}
/../cmake.lock RELEASE
)
endif
()
set
(
${
CPM_ARGS_NAME
}
_ADDED YES
)
set
(
${
CPM_ARGS_NAME
}
_ADDED YES
)
cpm_export_variables
(
"
${
CPM_ARGS_NAME
}
"
)
cpm_export_variables
(
"
${
CPM_ARGS_NAME
}
"
)
endfunction
()
endfunction
()
...
@@ -942,13 +959,18 @@ function(
...
@@ -942,13 +959,18 @@ function(
SOURCE_DIR
SOURCE_DIR
BINARY_DIR
BINARY_DIR
EXCLUDE
EXCLUDE
SYSTEM
OPTIONS
OPTIONS
)
)
if
(
NOT DOWNLOAD_ONLY AND EXISTS
${
SOURCE_DIR
}
/CMakeLists.txt
)
if
(
NOT DOWNLOAD_ONLY AND EXISTS
${
SOURCE_DIR
}
/CMakeLists.txt
)
set
(
addSubdirectoryExtraArgs
""
)
if
(
EXCLUDE
)
if
(
EXCLUDE
)
set
(
addSubdirectoryExtraArgs EXCLUDE_FROM_ALL
)
list
(
APPEND addSubdirectoryExtraArgs EXCLUDE_FROM_ALL
)
else
()
endif
()
set
(
addSubdirectoryExtraArgs
""
)
if
(
"
${
SYSTEM
}
"
AND
"
${
CMAKE_VERSION
}
"
VERSION_GREATER_EQUAL
"3.25"
)
# https://cmake.org/cmake/help/latest/prop_dir/SYSTEM.html#prop_dir:SYSTEM
list
(
APPEND addSubdirectoryExtraArgs SYSTEM
)
endif
()
endif
()
if
(
OPTIONS
)
if
(
OPTIONS
)
foreach
(
OPTION
${
OPTIONS
}
)
foreach
(
OPTION
${
OPTIONS
}
)
...
@@ -1079,6 +1101,7 @@ function(cpm_prettify_package_arguments OUT_VAR IS_IN_COMMENT)
...
@@ -1079,6 +1101,7 @@ function(cpm_prettify_package_arguments OUT_VAR IS_IN_COMMENT)
DOWNLOAD_COMMAND
DOWNLOAD_COMMAND
FIND_PACKAGE_ARGUMENTS
FIND_PACKAGE_ARGUMENTS
NO_CACHE
NO_CACHE
SYSTEM
GIT_SHALLOW
GIT_SHALLOW
)
)
set
(
multiValueArgs OPTIONS
)
set
(
multiValueArgs OPTIONS
)
...
...
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