mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-11 08:53:14 +08:00
fix bug #92 - we were doing stupid things when passing the list of libraries to link to.
This commit is contained in:
parent
868f753d10
commit
bd249d1121
@ -37,13 +37,16 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARGC} GREATER 3)
|
if(${ARGC} GREATER 3)
|
||||||
foreach(lib_to_link ${ARGV3})
|
set(libs_to_link ${ARGV3})
|
||||||
string(STRIP "${lib_to_link}" lib_to_link_stripped)
|
# it could be that some cmake module provides a bad library string " " (just spaces),
|
||||||
string(LENGTH "${lib_to_link_stripped}" lib_to_link_stripped_length)
|
# and that severely breaks target_link_libraries ("can't link to -l-lstdc++" errors).
|
||||||
if(${lib_to_link_stripped_length} GREATER 0)
|
# so we check for strings containing only spaces.
|
||||||
target_link_libraries(${targetname} "${lib_to_link}")
|
string(STRIP "${libs_to_link}" libs_to_link_stripped)
|
||||||
|
string(LENGTH "${libs_to_link_stripped}" libs_to_link_stripped_length)
|
||||||
|
if(${libs_to_link_stripped_length} GREATER 0)
|
||||||
|
# notice: no double quotes around ${libs_to_link} here. It may be a list.
|
||||||
|
target_link_libraries(${targetname} ${libs_to_link})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user