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.

64 lines
2.7 KiB

  1. set(STORM_HAVE_SPOT OFF)
  2. if (STORM_FORCE_SHIPPED_SPOT AND NOT STORM_USE_SPOT)
  3. message(FATAL_ERROR "Storm - Incompatible cmake options: STORM_FORCE_SHIPPED_SPOT=ON and STORM_USE_SPOT=OFF.")
  4. endif()
  5. if (STORM_FORCE_LTL_SUPPORT AND NOT STORM_USE_SPOT)
  6. message(FATAL_ERROR "Storm - Incompatible cmake options: STORM_FORCE_LTL_SUPPORT=ON and STORM_USE_SPOT=OFF. LTL support requires Spot.")
  7. endif()
  8. if(STORM_USE_SPOT AND NOT STORM_SHIPPED_SPOT AND NOT STORM_FORCE_SHIPPED_SPOT)
  9. # try to find Spot on the system
  10. if (NOT "${SPOT_ROOT}" STREQUAL "")
  11. message(STATUS "Storm - searching for Spot in ${SPOT_ROOT}")
  12. find_package(SPOT QUIET PATHS ${SPOT_ROOT} NO_DEFAULT_PATH)
  13. endif()
  14. if (NOT SPOT_FOUND)
  15. find_package(SPOT QUIET)
  16. endif()
  17. if (SPOT_FOUND)
  18. message(STATUS "Storm - Linking with shipped Spot ${SPOT_VERSION} (include: ${SPOT_INCLUDE_DIR}, library: ${SPOT_LIBRARIES}).")
  19. set(STORM_HAVE_SPOT ON)
  20. elseif(NOT STORM_FORCE_LTL_SUPPORT)
  21. message (WARNING "Storm - Could not find Spot. Model checking of LTL formulas (beyond PCTL) will not be supported. You may want to set cmake option STORM_FORCE_LTL_SUPPORT to install Spot automatically. If you already installed Spot, consider setting cmake option SPOT_ROOT")
  22. endif()
  23. elseif()
  24. endif()
  25. set(STORM_SHIPPED_SPOT OFF)
  26. if(STORM_FORCE_SHIPPED_SPOT OR (STORM_FORCE_LTL_SUPPORT AND NOT STORM_HAVE_SPOT))
  27. # download and install shipped Spot
  28. ExternalProject_Add(spot
  29. URL http://www.lrde.epita.fr/dload/spot/spot-2.9.6.tar.gz # When updating, also change version output below
  30. DOWNLOAD_NO_PROGRESS TRUE
  31. DOWNLOAD_DIR ${STORM_3RDPARTY_BINARY_DIR}/spot_src
  32. SOURCE_DIR ${STORM_3RDPARTY_BINARY_DIR}/spot_src
  33. PREFIX ${STORM_3RDPARTY_BINARY_DIR}/spot
  34. CONFIGURE_COMMAND ${STORM_3RDPARTY_BINARY_DIR}/spot_src/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/spot --disable-python
  35. BUILD_COMMAND make -j
  36. INSTALL_COMMAND make install
  37. LOG_CONFIGURE ON
  38. LOG_BUILD ON
  39. LOG_INSTALL ON
  40. BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/spot/lib/libspot${DYNAMIC_EXT}
  41. )
  42. add_dependencies(resources spot)
  43. set(SPOT_INCLUDE_DIR "${STORM_3RDPARTY_BINARY_DIR}/spot/include/")
  44. set(SPOT_DIR "${STORM_3RDPARTY_BINARY_DIR}/spot/")
  45. set(SPOT_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/spot/lib/libspot${DYNAMIC_EXT})
  46. set(STORM_HAVE_SPOT ON)
  47. set(STORM_SHIPPED_SPOT ON)
  48. message(STATUS "Storm - Linking with shipped Spot 2.9.6 (include: ${SPOT_INCLUDE_DIR}, library ${SPOT_LIBRARIES}).")
  49. endif()
  50. if (STORM_HAVE_SPOT)
  51. include_directories("${SPOT_INCLUDE_DIR}")
  52. list(APPEND STORM_LINK_LIBRARIES ${SPOT_LIBRARIES})
  53. endif()