diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/EigenTesting.cmake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index 60d99adc9..b2b5a7a8e 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -35,13 +35,16 @@ macro(ei_add_test_internal testname testname_with_suffix) if(EXTERNAL_LIBS) target_link_libraries(${targetname} ${EXTERNAL_LIBS}) endif() + if(${ARGC} GREATER 3) - string(STRIP "${ARGV3}" ARGV3_stripped) - string(LENGTH "${ARGV3_stripped}" ARGV3_stripped_length) - if(${ARGV3_stripped_length} GREATER 0) - target_link_libraries(${targetname} ${ARGV3}) - endif(${ARGV3_stripped_length} GREATER 0) - endif(${ARGC} GREATER 3) + foreach(lib_to_link ${ARGV3}) + string(STRIP lib_to_link lib_to_link_stripped) + string(LENGTH "${lib_to_link_stripped}" lib_to_link_stripped_length) + if(${lib_to_link_stripped_length} GREATER 0) + target_link_libraries(${targetname} "${lib_to_link}") + endif() + endforeach() + endif() if(WIN32) if(CYGWIN) |