From c0e61505e79db6e4cc515582486fd444ca6abd3f Mon Sep 17 00:00:00 2001 From: Mavo Date: Thu, 17 Nov 2016 15:55:21 +0100 Subject: [PATCH] Added byproducts for ninja Former-commit-id: ab8a7506450acf0be12eb7917e66517d5d0fd1e2 [formerly 26a765f9b460efd351600071b9233c3681c4a5e6] Former-commit-id: 52b0b27595df6c115a8152e6c92af3339df8b3c8 --- resources/3rdparty/CMakeLists.txt | 23 ++++++++------------ resources/3rdparty/include_cpptemplate.cmake | 10 ++++++++- resources/3rdparty/include_cudd.cmake | 9 +++++--- resources/3rdparty/include_glpk.cmake | 8 ++++--- resources/3rdparty/include_xerces.cmake | 6 +++-- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index b055712ff..cd5294df0 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -102,16 +102,6 @@ include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk") message (STATUS "Storm - Including Sparsepp.") include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/sparsepp") -############################################################# -## -## utf8cpp -## -############################################################# - -# Use the shipped version of utf8cpp -message (STATUS "Storm - Including utf8cpp.") -include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/utf8_v2_3_4/source") - ############################################################# ## ## ModernJSON @@ -232,6 +222,7 @@ if(USE_CARL) LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON + BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT} ) add_dependencies(resources carl) @@ -371,6 +362,7 @@ ExternalProject_Add( INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/sylvan" LOG_CONFIGURE ON LOG_BUILD ON + BUILD_BYPRODUCTS ${PROJECT_BINARY_DIR}/sylvan/src/libsylvan${STATIC_EXT} ) ExternalProject_Get_Property(sylvan source_dir) ExternalProject_Get_Property(sylvan binary_dir) @@ -397,6 +389,7 @@ endif() ## Google Test gtest ## ############################################################# +set(GOOGLETEST_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0) ExternalProject_Add( googletest #For downloads (may be useful later!) @@ -406,14 +399,16 @@ ExternalProject_Add( SOURCE_DIR "${STORM_3RDPARTY_SOURCE_DIR}/gtest-1.7.0" # Force the same output paths for debug and release builds so that # we know in which place the binaries end up when using the Xcode generator - CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0 -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0 + CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${GOOGLETEST_LIB_DIR} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${GOOGLETEST_LIB_DIR} # Disable install step INSTALL_COMMAND "" - BINARY_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0" - INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0" + BINARY_DIR ${GOOGLETEST_LIB_DIR} + INSTALL_DIR ${GOOGLETEST_LIB_DIR} # Wrap download, configure and build steps in a script to log output LOG_CONFIGURE ON - LOG_BUILD ON) + LOG_BUILD ON + BUILD_BYPRODUCTS ${GOOGLETEST_LIB_DIR}/libgtest${STATIC_EXT} ${GOOGLETEST_LIB_DIR}/libgtest_main${STATIC_EXT} +) # Specify include dir ExternalProject_Get_Property(googletest source_dir) diff --git a/resources/3rdparty/include_cpptemplate.cmake b/resources/3rdparty/include_cpptemplate.cmake index ff3c605fe..d37e37bf7 100644 --- a/resources/3rdparty/include_cpptemplate.cmake +++ b/resources/3rdparty/include_cpptemplate.cmake @@ -1,14 +1,22 @@ string(REPLACE " " ";" CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS}) +if(CMAKE_BUILD_TYPE MATCHES DEBUG) + list(APPEND CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS_DEBUG}) +else() + list(APPEND CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS_RELEASE}) +endif() +set(CPPTEMPLATE_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate) ExternalProject_Add( cpptemplate DOWNLOAD_COMMAND "" SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate PREFIX ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate CONFIGURE_COMMAND "" - BUILD_COMMAND ${CMAKE_CXX_COMPILER} -c ${CMAKE_CXX_FLAGS_AS_LIST} -fPIC -I${Boost_INCLUDE_DIRS} -I${STORM_3RDPARTY_SOURCE_DIR}/utf8_v2_3_4/source ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate/cpptempl.cpp -o ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate/cpptemplate${STATIC_EXT} + BUILD_COMMAND ${CMAKE_CXX_COMPILER} -c ${CMAKE_CXX_FLAGS_AS_LIST} ${CMAKE_CXX_FLAGS_RELEASE_AS_LIST} -fPIC -I${Boost_INCLUDE_DIRS} ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate/cpptempl.cpp -o ${CPPTEMPLATE_LIB_DIR}/cpptemplate${STATIC_EXT} + BUILD_ALWAYS 1 INSTALL_COMMAND "" BUILD_IN_SOURCE 0 LOG_BUILD ON + BUILD_BYPRODUCTS ${CPPTEMPLATE_LIB_DIR}/cpptemplate${DYNAMIC_EXT} ${CPPTEMPLATE_LIB_DIR}/cpptemplate${STATIC_EXT} ) set(CPPTEMPLATE_INCLUDE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate) diff --git a/resources/3rdparty/include_cudd.cmake b/resources/3rdparty/include_cudd.cmake index 04b19bfbe..6a5911a2f 100644 --- a/resources/3rdparty/include_cudd.cmake +++ b/resources/3rdparty/include_cudd.cmake @@ -2,25 +2,28 @@ if (NOT AUTORECONF) message(FATAL_ERROR "Cannot find autoreconf, cannot compile cudd3.") endif() +set(CUDD_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/lib) + ExternalProject_Add( cudd3 DOWNLOAD_COMMAND "" SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cudd-3.0.0 PREFIX ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0 PATCH_COMMAND ${AUTORECONF} - CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/cudd-3.0.0/configure --enable-shared --enable-obj --prefix=${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0 --libdir=${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/lib CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} + CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/cudd-3.0.0/configure --enable-shared --enable-obj --prefix=${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0 --libdir=${CUDD_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} BUILD_COMMAND make "CFLAGS=-O2 -w" INSTALL_COMMAND make install BUILD_IN_SOURCE 0 LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON + BUILD_BYPRODUCTS ${CUDD_LIB_DIR}/libcudd${DYNAMIC_EXT} ${CUDD_LIB_DIR}/libcudd${STATIC_EXT} ) # Do not use system CUDD, StoRM has a modified version set(CUDD_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/include) -set(CUDD_SHARED_LIBRARY ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/lib/libcudd${DYNAMIC_EXT}) -set(CUDD_STATIC_LIBRARY $${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/cudd-3.0.0/lib/libcudd${STATIC_EXT}) +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}) add_dependencies(resources cudd3) diff --git a/resources/3rdparty/include_glpk.cmake b/resources/3rdparty/include_glpk.cmake index fd89523c4..7d75e89b9 100644 --- a/resources/3rdparty/include_glpk.cmake +++ b/resources/3rdparty/include_glpk.cmake @@ -3,20 +3,22 @@ if(GLPK_FOUND) message (STATUS "Storm - Using system version of glpk.") else() message (STATUS "Storm - Using shipped version of glpk.") + set(GLPK_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib) ExternalProject_Add(glpk DOWNLOAD_COMMAND "" PREFIX ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57 SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57 - CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57 --libdir=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib CC=${CMAKE_C_COMPILER} + CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57 --libdir=${GLPK_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} BUILD_COMMAND make "CFLAGS=-O2 -w" INSTALL_COMMAND make install BUILD_IN_SOURCE 0 LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON + BUILD_BYPRODUCTS ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT} ${GLPK_LIB_DIR}/libglpk${STATIC_EXT} ) - set(GLPK_LIBRARIES ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/lib/libglpk${DYNAMIC_EXT}) - set(GLPK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/include) + set(GLPK_LIBRARIES ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT}) + set(GLPK_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/include) set(GLPK_VERSION_STRING 4.57) add_dependencies(resources glpk) endif() diff --git a/resources/3rdparty/include_xerces.cmake b/resources/3rdparty/include_xerces.cmake index 1d7b91b81..dabf8cb2c 100644 --- a/resources/3rdparty/include_xerces.cmake +++ b/resources/3rdparty/include_xerces.cmake @@ -4,23 +4,25 @@ if(USE_XERCES) message(STATUS "Storm - Use system version of xerces.") else() message(STATUS "Storm - Use shipped version of xerces.") + set(XERCES_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2/lib) ExternalProject_Add( xercesc SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/xercesc-3.1.2 - CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2 --libdir=${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2/lib CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-O3 CXXFLAGS=-O3 + CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2 --libdir=${XERCES_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-O3 CXXFLAGS=-O3 PREFIX ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2 BUILD_COMMAND make BUILD_IN_SOURCE 0 LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON + BUILD_BYPRODUCTS ${XERCES_LIB_DIR}/libxerces-c${DYNAMIC_EXT} ${XERCES_LIB_DIR}/libxerces-c${STATIC_EXT} ) set(XERCES_ROOT ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2) set(XERCESC_INCLUDE ${XERCES_ROOT}/include) set(XERCES_LIBRARY_PATH ${XERCES_ROOT}/lib) if(BUILD_STATIC) - set(XERCESC_LIBRARIES ${XERCES_LIBRARY_PATH}/libxerces-c.a) + set(XERCESC_LIBRARIES ${XERCES_LIBRARY_PATH}/libxerces-c${STATIC_EXT}) else() set(XERCESC_LIBRARIES ${XERCES_LIBRARY_PATH}/libxerces-c${DYNAMIC_EXT}) endif()