You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.3 KiB

  1. find_package(GLPK QUIET)
  2. if(GLPK_FOUND)
  3. message (STATUS "Storm - Using system version of glpk.")
  4. else()
  5. message (STATUS "Storm - Using shipped version of glpk.")
  6. set(GLPK_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib)
  7. ExternalProject_Add(glpk_ext
  8. DOWNLOAD_COMMAND ""
  9. PREFIX ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57
  10. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57
  11. 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}
  12. BUILD_COMMAND make "CFLAGS=-O2 -w"
  13. INSTALL_COMMAND make install
  14. BUILD_IN_SOURCE 0
  15. LOG_CONFIGURE ON
  16. LOG_BUILD ON
  17. LOG_INSTALL ON
  18. BUILD_BYPRODUCTS ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT} ${GLPK_LIB_DIR}/libglpk${STATIC_EXT}
  19. )
  20. set(GLPK_LIBRARIES ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT})
  21. set(GLPK_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/include)
  22. set(GLPK_VERSION_STRING 4.57)
  23. add_dependencies(resources glpk_ext)
  24. endif()
  25. # Since there is a shipped version, always use GLPK
  26. set(STORM_HAVE_GLPK ON)
  27. message (STATUS "Storm - Linking with glpk ${GLPK_VERSION_STRING}")
  28. add_imported_library(glpk SHARED ${GLPK_LIBRARIES} ${GLPK_INCLUDE_DIR})
  29. list(APPEND STORM_DEP_TARGETS glpk_SHARED)