From 8bfa699519e144bb9ace895b63dbcc322a782e0e Mon Sep 17 00:00:00 2001 From: sjunges Date: Thu, 6 Apr 2017 23:30:17 +0200 Subject: [PATCH] attempt to fix link error --- resources/3rdparty/CMakeLists.txt | 38 +++++++++++++------------------ src/storm/CMakeLists.txt | 3 ++- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index b62cfb3d0..4e56c4c04 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -265,8 +265,15 @@ if(USE_CARL) if(STORM_USE_CLN_RF AND NOT STORM_HAVE_CLN) message(FATAL_ERROR "Cannot use CLN numbers if carl is build without.") endif() - - list(APPEND STORM_DEP_IMP_TARGETS lib_carl) + + #The library that needs symbols must be first, then the library that resolves the symbol. + + list(APPEND STORM_DEP_IMP_TARGETS lib_carl) + if(STORM_USE_CLN_EA OR STORM_USE_CLN_RF) + list(APPEND STORM_DEP_IMP_TARGETS CLN_SHARED) + endif() + list(APPEND STORM_DEP_IMP_TARGETS GMPXX_SHARED GMP_SHARED) + endif() @@ -314,26 +321,13 @@ endif() ## gmp ## ############################################################# - -if (NOT STORM_USE_CLN_EA OR NOT "${MSAT_ROOT}" STREQUAL "") - find_package(GMP QUIET REQUIRED) -else() - # GMP is optional in this case - find_package(GMP QUIET) -endif() - -if(GMP_FOUND) - set(STORM_HAVE_GMP ON) - message(STATUS "Storm - Linking with gmp.") - include_directories("${GMP_INCLUDE_DIR}") - list(APPEND STORM_LINK_LIBRARIES ${GMP_LIBRARY}) -elseif(MPIR_FOUND) - set(STORM_HAVE_GMP ON) - message(STATUS "Storm - Linking with mpir (gmp).") - include_directories("${GMP_INCLUDE_DIR}") - list(APPEND STORM_LINK_LIBRARIES ${GMP_MPIR_LIBRARY}) - list(APPEND STORM_LINK_LIBRARIES ${GMP_MPIRXX_LIBRARY}) -endif(GMP_FOUND) +# +#find_package(GMP QUIET REQUIRED) +# +set(STORM_HAVE_GMP ON) +#message(STATUS "Storm - Linking with gmp.") +#include_directories("${GMP_INCLUDE_DIR}") +#list(APPEND STORM_LINK_LIBRARIES ${GMP_LIBRARY}) ############################################################# ## diff --git a/src/storm/CMakeLists.txt b/src/storm/CMakeLists.txt index 18ac14200..f3e915fbd 100644 --- a/src/storm/CMakeLists.txt +++ b/src/storm/CMakeLists.txt @@ -42,7 +42,8 @@ add_library(storm SHARED ${STORM_LIB_SOURCES} ${STORM_LIB_HEADERS}) # Remove define symbol for shared libstorm. set_target_properties(storm PROPERTIES DEFINE_SYMBOL "") add_dependencies(storm resources) -target_link_libraries(storm PUBLIC ${STORM_DEP_TARGETS} ${STORM_DEP_IMP_TARGETS} ${STORM_LINK_LIBRARIES}) +#The library that needs symbols must be first, then the library that resolves the symbol. +target_link_libraries(storm PUBLIC ${STORM_DEP_TARGETS} ${STORM_DEP_IMP_TARGETS} ${STORM_LINK_LIBRARIES}) list(APPEND STORM_TARGETS storm) set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)