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.

28 lines
1.2 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. ExternalProject_Add(glpk
  7. DOWNLOAD_COMMAND ""
  8. PREFIX ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57
  9. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57
  10. 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}
  11. BUILD_COMMAND make "CFLAGS=-O2 -w"
  12. INSTALL_COMMAND make install
  13. BUILD_IN_SOURCE 0
  14. LOG_CONFIGURE ON
  15. LOG_BUILD ON
  16. LOG_INSTALL ON
  17. )
  18. set(GLPK_LIBRARIES ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/lib/libglpk${DYNAMIC_EXT})
  19. set(GLPK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/include)
  20. set(GLPK_VERSION_STRING 4.57)
  21. add_dependencies(resources glpk)
  22. endif()
  23. # Since there is a shipped version, always use GLPK
  24. set(STORM_HAVE_GLPK ON)
  25. message (STATUS "StoRM - Linking with glpk ${GLPK_VERSION_STRING}")
  26. include_directories(${GLPK_INCLUDE_DIR})
  27. list(APPEND STORM_LINK_LIBRARIES ${GLPK_LIBRARIES})