mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-24 22:04:28 +08:00
Fix parsing of command-line arguments when already specified as a cmake list.
(cherry picked from commit 555cec17edc2cae91b3310ef8915acbeb3951cab)
This commit is contained in:
parent
2e708d48ca
commit
ece7cec604
@ -94,6 +94,20 @@ else()
|
||||
ei_add_cxx_compiler_flag("-std=c++03")
|
||||
endif()
|
||||
|
||||
function(ei_maybe_separate_arguments variable mode args)
|
||||
# Use separate_arguments if the input is a single string containing a space.
|
||||
# Otherwise, if it is already a list or doesn't have a space, just propagate
|
||||
# the original value. This is to better support multi-argument lists.
|
||||
list(LENGTH args list_length)
|
||||
if (${list_length} EQUAL 1)
|
||||
string(FIND "${args}" " " has_space)
|
||||
if (${has_space} GREATER -1)
|
||||
separate_arguments(args ${mode} "${args}")
|
||||
endif()
|
||||
endif()
|
||||
set(${variable} ${args} PARENT_SCOPE)
|
||||
endfunction(ei_maybe_separate_arguments)
|
||||
|
||||
#############################################################################
|
||||
# find how to link to the standard libraries #
|
||||
#############################################################################
|
||||
@ -104,6 +118,10 @@ find_package(StandardMathLibrary)
|
||||
set(EIGEN_TEST_CUSTOM_LINKER_FLAGS "" CACHE STRING "Additional linker flags when linking unit tests.")
|
||||
set(EIGEN_TEST_CUSTOM_CXX_FLAGS "" CACHE STRING "Additional compiler flags when compiling unit tests.")
|
||||
|
||||
# Convert space-separated arguments into CMake lists for downstream consumption.
|
||||
ei_maybe_separate_arguments(EIGEN_TEST_CUSTOM_LINKER_FLAGS NATIVE_COMMAND "${EIGEN_TEST_CUSTOM_LINKER_FLAGS}")
|
||||
ei_maybe_separate_arguments(EIGEN_TEST_CUSTOM_CXX_FLAGS NATIVE_COMMAND "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
|
||||
|
||||
set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "")
|
||||
|
||||
if(NOT STANDARD_MATH_LIBRARY_FOUND)
|
||||
|
Loading…
x
Reference in New Issue
Block a user