From 621cc58a678a4490eed7e89e3ab1f888d2151551 Mon Sep 17 00:00:00 2001 From: Mavo Date: Fri, 4 Nov 2016 14:57:35 +0100 Subject: [PATCH] Ninja recognizes dependencies + build shared libs Former-commit-id: 569c0da147b93e88a19e1163dfad132e6c7f9319 --- CMakeLists.txt | 8 ++++++++ resources/3rdparty/CMakeLists.txt | 8 ++++---- resources/3rdparty/include_cudd.cmake | 6 +++++- resources/3rdparty/include_xerces.cmake | 2 +- src/CMakeLists.txt | 2 -- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47afbbc11..f789197ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,14 @@ endif() message(STATUS "Assuming extension for shared libraries: ${DYNAMIC_EXT}") message(STATUS "Assuming extension for static libraries: ${STATIC_EXT}") +if(BUILD_SHARED_LIBS) + set(LIB_EXT ${DYNAMIC_EXT}) + message(STATUS "Build dynamic libraries.") +else() + set(LIB_EXT ${STATIC_EXT}) + message(STATUS "Build static libraries.") +endif() + ############################################################# ## ## Compiler detection and initial configuration diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index 8ce6ed7bd..b96370117 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -355,10 +355,10 @@ ExternalProject_Add( PREFIX "sylvan" SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/sylvan CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DSYLVAN_BUILD_TEST=Off -DSYLVAN_BUILD_EXAMPLES=Off -DCMAKE_BUILD_TYPE=Release - BINARY_DIR "${PROJECT_BINARY_DIR}/sylvan" + BINARY_DIR ${PROJECT_BINARY_DIR}/sylvan BUILD_IN_SOURCE 0 INSTALL_COMMAND "" - INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/sylvan" + INSTALL_DIR ${STORM_3RDPARTY_BINARY_DIR}/sylvan LOG_CONFIGURE ON LOG_BUILD ON BUILD_BYPRODUCTS ${PROJECT_BINARY_DIR}/sylvan/src/libsylvan${STATIC_EXT} @@ -366,7 +366,7 @@ ExternalProject_Add( ExternalProject_Get_Property(sylvan source_dir) ExternalProject_Get_Property(sylvan binary_dir) set(Sylvan_INCLUDE_DIR "${source_dir}/src") -set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan.a") +set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan${STATIC_EXT}") message(STATUS "Storm - Using shipped version of sylvan.") message(STATUS "Storm - Linking with sylvan.") include_directories("${Sylvan_INCLUDE_DIR}") @@ -414,7 +414,7 @@ ExternalProject_Get_Property(googletest source_dir) set(GTEST_INCLUDE_DIR ${source_dir}/include) # Specify MainTest's link libraries ExternalProject_Get_Property(googletest binary_dir) -set(GTEST_LIBRARIES ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a) +set(GTEST_LIBRARIES ${binary_dir}/libgtest${LIB_EXT} ${binary_dir}/libgtest_main${LIB_EXT}) add_dependencies(test-resources googletest) list(APPEND STORM_TEST_LINK_LIBRARIES ${GTEST_LIBRARIES}) diff --git a/resources/3rdparty/include_cudd.cmake b/resources/3rdparty/include_cudd.cmake index 6a5911a2f..f10f34ea3 100644 --- a/resources/3rdparty/include_cudd.cmake +++ b/resources/3rdparty/include_cudd.cmake @@ -25,7 +25,11 @@ set(CUDD_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/include) set(CUDD_SHARED_LIBRARY ${CUDD_LIB_DIR}/libcudd${DYNAMIC_EXT}) set(CUDD_STATIC_LIBRARY ${CUDD_LIB_DIR}/libcudd${STATIC_EXT}) set(CUDD_VERSION_STRING 3.0.0) -list(APPEND STORM_LINK_LIBRARIES ${CUDD_SHARED_LIBRARY}) +if(BUILD_SHARED_LIBS) + list(APPEND STORM_LINK_LIBRARIES ${CUDD_SHARED_LIBRARY}) +else() + list(APPEND STORM_LINK_LIBRARIES ${CUDD_STATIC_LIBRARY}) +endif() add_dependencies(resources cudd3) message(STATUS "Storm - Linking with CUDD ${CUDD_VERSION_STRING}.") diff --git a/resources/3rdparty/include_xerces.cmake b/resources/3rdparty/include_xerces.cmake index d2c52e094..565f8e414 100644 --- a/resources/3rdparty/include_xerces.cmake +++ b/resources/3rdparty/include_xerces.cmake @@ -20,7 +20,7 @@ if(USE_XERCES) set(XERCES_ROOT ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2) set(XERCESC_INCLUDE ${XERCES_ROOT}/include) - set(XERCES_LIBRARY_PATH ${XERCES_ROOT}/lib) + set(XERCES_LIBRARY_PATH ${XERCES_LIB_DIR}) if(BUILD_STATIC) set(XERCESC_LIBRARIES ${XERCES_LIBRARY_PATH}/libxerces-c${STATIC_EXT}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 936c1181b..0fec9497c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,4 @@ add_subdirectory(storm) add_subdirectory(storm-pgcl) add_subdirectory(storm-pgcl-cli) - - add_subdirectory(test)