Fix general linking issue for tests linking to multiple libs, and explicitly link mpfr_real test to GMP.

This commit is contained in:
Benoit Jacob
2010-10-17 11:04:43 -04:00
parent 8356bc8d06
commit 1e3a035275
2 changed files with 12 additions and 7 deletions

View File

@@ -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)