mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-19 07:37:42 -05:00
Fix download_command by declaring it a multi-value option (#473)
This commit is contained in:
@@ -528,7 +528,6 @@ function(CPMAddPackage)
|
|||||||
BITBUCKET_REPOSITORY
|
BITBUCKET_REPOSITORY
|
||||||
GIT_REPOSITORY
|
GIT_REPOSITORY
|
||||||
SOURCE_DIR
|
SOURCE_DIR
|
||||||
DOWNLOAD_COMMAND
|
|
||||||
FIND_PACKAGE_ARGUMENTS
|
FIND_PACKAGE_ARGUMENTS
|
||||||
NO_CACHE
|
NO_CACHE
|
||||||
SYSTEM
|
SYSTEM
|
||||||
@@ -537,7 +536,7 @@ function(CPMAddPackage)
|
|||||||
SOURCE_SUBDIR
|
SOURCE_SUBDIR
|
||||||
)
|
)
|
||||||
|
|
||||||
set(multiValueArgs URL OPTIONS)
|
set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND)
|
||||||
|
|
||||||
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
||||||
|
|
||||||
@@ -1098,13 +1097,12 @@ function(cpm_prettify_package_arguments OUT_VAR IS_IN_COMMENT)
|
|||||||
GITLAB_REPOSITORY
|
GITLAB_REPOSITORY
|
||||||
GIT_REPOSITORY
|
GIT_REPOSITORY
|
||||||
SOURCE_DIR
|
SOURCE_DIR
|
||||||
DOWNLOAD_COMMAND
|
|
||||||
FIND_PACKAGE_ARGUMENTS
|
FIND_PACKAGE_ARGUMENTS
|
||||||
NO_CACHE
|
NO_CACHE
|
||||||
SYSTEM
|
SYSTEM
|
||||||
GIT_SHALLOW
|
GIT_SHALLOW
|
||||||
)
|
)
|
||||||
set(multiValueArgs OPTIONS)
|
set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND)
|
||||||
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
foreach(oneArgName ${oneValueArgs})
|
foreach(oneArgName ${oneValueArgs})
|
||||||
|
|||||||
25
test/integration/test_download_command.rb
Normal file
25
test/integration/test_download_command.rb
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
require_relative './lib'
|
||||||
|
|
||||||
|
# Tests using a multi-argumenet download command to fetch a dependency
|
||||||
|
|
||||||
|
class DownloadCommand < IntegrationTest
|
||||||
|
|
||||||
|
def test_fetch_dependency_using_download_command
|
||||||
|
prj = make_project from_template: 'using-adder'
|
||||||
|
|
||||||
|
prj.create_lists_from_default_template package: <<~PACK
|
||||||
|
set(DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/_deps/testpack-adder-src)
|
||||||
|
CPMAddPackage(
|
||||||
|
NAME testpack-adder
|
||||||
|
SOURCE_DIR ${DOWNLOAD_DIR}
|
||||||
|
DOWNLOAD_COMMAND git clone --depth 1 --branch v1.0.0 https://github.com/cpm-cmake/testpack-adder.git ${DOWNLOAD_DIR}
|
||||||
|
OPTIONS "ADDER_BUILD_TESTS OFF"
|
||||||
|
)
|
||||||
|
PACK
|
||||||
|
|
||||||
|
# configure with unpopulated cache
|
||||||
|
assert_success prj.configure
|
||||||
|
assert_success prj.build
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user