From d135bc8ecb0821cef7dfeab47f7e6907eb0de5b1 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Thu, 3 Sep 2020 14:22:15 +0200 Subject: [PATCH] cmake: Workaround for the FATAL_ERROR that occurred whenever building shipped carl was aborted (bypassing github issue #62). --- resources/3rdparty/CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index d939ab369..170e72033 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -260,14 +260,26 @@ if (NOT STORM_FORCE_SHIPPED_CARL) find_package(carl QUIET) endif() endif() + +set(STORM_SHIPPED_CARL OFF) if(carl_FOUND AND NOT STORM_FORCE_SHIPPED_CARL) get_target_property(carlLOCATION lib_carl LOCATION) if("${carlLOCATION}" STREQUAL "carlLOCATION-NOTFOUND") - message(FATAL_ERROR "Library location for carl is not found, did you build carl?") + if(EXISTS ${STORM_3RDPARTY_BINARY_DIR}/carl) + message(WARNING "Storm - Library for carl location is not found but the directory ${STORM_3RDPARTY_BINARY_DIR}/carl exists. Will (re-)try to build a shipped version of carl.") + set(STORM_SHIPPED_CARL ON) + else() + message(FATAL_ERROR "Library location for carl is not found, did you build carl?") + endif() elseif(EXISTS ${carlLOCATION}) #empty on purpose else() - message(FATAL_ERROR "File ${carlLOCATION} does not exist, did you build carl?") + if(EXISTS ${STORM_3RDPARTY_BINARY_DIR}/carl) + message(WARNING "Storm - File ${carlLOCATION} does not exist but the directory ${STORM_3RDPARTY_BINARY_DIR}/carl exists. Will (re-)try to build a shipped version of carl.") + set(STORM_SHIPPED_CARL ON) + else() + message(FATAL_ERROR "File ${carlLOCATION} does not exist, did you build carl?") + endif() endif() if("${carl_VERSION_MAJOR}" STREQUAL "${CARL_C14VERSION}") message(STATUS "Storm - Found carl using master14 branch.") @@ -276,14 +288,16 @@ if(carl_FOUND AND NOT STORM_FORCE_SHIPPED_CARL) message(FATAL_ERROR "Carl outdated, require ${CARL_MINVERSION}, have ${carl_VERSION}") endif() - set(STORM_SHIPPED_CARL OFF) set(STORM_HAVE_CARL ON) message(STATUS "Storm - Use system version of carl.") message(STATUS "Storm - Linking with preinstalled carl ${carl_VERSION} (include: ${carl_INCLUDE_DIR}, library ${carl_LIBRARIES}, CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}, CARL_USE_GINAC: ${CARL_USE_GINAC}).") set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS}) set(STORM_HAVE_GINAC ${CARL_USE_GINAC}) else() - set(STORM_SHIPPED_CARL ON) + set(STORM_SHIPPED_CARL ON) +endif() + +if (STORM_SHIPPED_CARL) # The first external project will be built at *configure stage* message(STATUS "Carl - Start of config process") file(MAKE_DIRECTORY ${STORM_3RDPARTY_BINARY_DIR}/carl_download)