Browse Source

only build glpk if not found on system

Former-commit-id: 1a758fe2d1
tempestpy_adaptions
sjunges 9 years ago
parent
commit
bcbda8bf68
  1. 31
      resources/3rdparty/CMakeLists.txt
  2. 28
      resources/3rdparty/include_glpk.cmake

31
resources/3rdparty/CMakeLists.txt

@ -6,20 +6,6 @@ set(STORM_3RDPARTY_BINARY_DIR ${PROJECT_BINARY_DIR}/resources/3rdparty)
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=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57/lib 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
)
ExternalProject_Add(
cudd3
DOWNLOAD_COMMAND ""
@ -206,22 +192,7 @@ endif(Z3_FOUND)
##
#############################################################
find_package(GLPK QUIET)
if(GLPK_FOUND)
message (STATUS "StoRM - Using system version of GLPK")
else()
message (STATUS "StoRM - Using shipped version of GLPK")
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_VERSION_STRING 4.57)
add_dependencies(resources glpk)
endif()
# Since there is a shipped version, always use GLPK
set(STORM_HAVE_GLPK ON)
message (STATUS "StoRM - Linking with glpk ${GLPK_VERSION_STRING}")
include_directories(${GLPK_INCLUDE_DIR})
list(APPEND STORM_LINK_LIBRARIES ${GLPK_LIBRARIES})
include(${STORM_3RDPARTY_SOURCE_DIR}/include_glpk.cmake)
#############################################################
##

28
resources/3rdparty/include_glpk.cmake

@ -0,0 +1,28 @@
find_package(GLPK QUIET)
if(GLPK_FOUND)
message (STATUS "StoRM - Using system version of GLPK")
else()
message (STATUS "StoRM - Using shipped version of GLPK")
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=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57/lib 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
)
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_VERSION_STRING 4.57)
add_dependencies(resources glpk)
endif()
# Since there is a shipped version, always use GLPK
set(STORM_HAVE_GLPK ON)
message (STATUS "StoRM - Linking with glpk ${GLPK_VERSION_STRING}")
include_directories(${GLPK_INCLUDE_DIR})
list(APPEND STORM_LINK_LIBRARIES ${GLPK_LIBRARIES})
Loading…
Cancel
Save