Browse Source

refactored further parts of the external library building

Former-commit-id: 81ab395bb1
tempestpy_adaptions
sjunges 9 years ago
parent
commit
471ae19438
  1. 42
      resources/3rdparty/CMakeLists.txt
  2. 3
      src/CMakeLists.txt
  3. 8
      test/CMakeLists.txt

42
resources/3rdparty/CMakeLists.txt

@ -1,20 +1,58 @@
add_custom_target(resources)
add_custom_target(test-resources)
include(ExternalProject)
ExternalProject_Add(
xercesc
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xercesc-3.1.2
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2 CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-O3 CXXFLAGS=-O3
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2
BUILD_COMMAND make
BUILD_IN_SOURCE 0
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)
add_dependencies(resources xercesc)
ExternalProject_Add(
glpk
DOWNLOAD_COMMAND ""
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57 CC=${CMAKE_C_COMPILER}
BUILD_COMMAND make "CFLAGS=-O2 -w"
INSTALL_COMMAND make install
BUILD_IN_SOURCE 0
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)
add_dependencies(resources glpk)
ExternalProject_Add(
googletest
#For downloads (may be useful later!)
#SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
#TIMEOUT 10
DOWNLOAD_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.7.0"
# Force separate output paths for debug and release builds to allow easy
# identification of correct lib in subsequent TARGET_LINK_LIBRARIES
CMAKE_ARGS -Dgtest_force_shared_crt=ON
# Disable install step
INSTALL_COMMAND ""
# Wrap download, configure and build steps in a script to log output
LOG_CONFIGURE ON
LOG_BUILD ON)
# Specify include dir
ExternalProject_Get_Property(googletest source_dir)
set(GTEST_INCLUDE_DIR ${source_dir}/include PARENT_SCOPE)
# Specify MainTest's link libraries
ExternalProject_Get_Property(googletest binary_dir)
set(GTEST_LIBRARIES ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a PARENT_SCOPE)
add_dependencies(test-resources googletest)

3
src/CMakeLists.txt

@ -107,9 +107,8 @@ endif(ADDITIONAL_LINK_DIRS)
## #
###############################################################################
add_library(storm ${STORM_LIB_SOURCES} ${STORM_LIB_HEADERS} ${STORM_GENERATED_SOURCES}) # Adding headers for xcode
add_dependencies(storm xercesc)
add_dependencies(storm sylvan)
add_dependencies(storm glpk)
add_dependencies(storm resources)
add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS})
target_link_libraries(storm-main storm) # Adding headers for xcode
set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm")

8
test/CMakeLists.txt

@ -12,11 +12,13 @@ add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_MAIN_FILE} ${STORM
target_link_libraries(storm-functional-tests storm)
add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_MAIN_FILE} ${STORM_PERFORMANCE_TEST_FILES})
target_link_libraries(storm-performance-tests storm)
add_dependencies(storm-functional-tests test-resources)
add_dependencies(storm-performance-tests test-resources)
include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0/include")
include_directories(${GTEST_INCLUDE_DIR})
enable_testing()
target_link_libraries(storm-functional-tests gtest)
target_link_libraries(storm-performance-tests gtest)
target_link_libraries(storm-functional-tests ${GTEST_LIBRARIES})
target_link_libraries(storm-performance-tests ${GTEST_LIBRARIES})
add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
add_test(NAME storm-performance-tests COMMAND storm-performance-tests)

Loading…
Cancel
Save