mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 14:47:30 -05:00
Allow passing lists in the options (#302)
* allow list options by passing option parameter as string, not value * add test * remove debug message * run formatter
This commit is contained in:
@@ -13,7 +13,9 @@ include(@CPM_PATH@/CPM.cmake)
|
||||
CPMAddPackage(
|
||||
NAME Dependency
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/dependency
|
||||
OPTIONS "DEFINE_ALTERNATIVE_FUNCTION YES"
|
||||
OPTIONS
|
||||
"DEFINE_ALTERNATIVE_FUNCTION YES"
|
||||
"LIST_ARGUMENT a\\\\;b\\\\;c"
|
||||
EXCLUDE_FROM_ALL YES
|
||||
)
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ if(NOT DEFINE_ALTERNATIVE_FUNCTION)
|
||||
message("called external method")
|
||||
endfunction()
|
||||
else()
|
||||
|
||||
# check if list was passed correctly
|
||||
if(NOT "${LIST_ARGUMENT}" STREQUAL "a;b;c")
|
||||
message(FATAL_ERROR "list argument not properly passed to dependency: '${LIST_ARGUMENT}'")
|
||||
endif()
|
||||
|
||||
function(alternative_dependency_function)
|
||||
message("called alternative external method")
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user