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.

41 lines
1.4 KiB

2 months ago
  1. # - Try to find libspot
  2. # Once done this will define
  3. # SPOT_FOUND - System has glpk
  4. # SPOT_INCLUDE_DIR - The glpk include directory
  5. # SPOT_LIBRARIES - The libraries needed to use glpk
  6. # SPOT_VERSION - The version of spot
  7. # use pkg-config to get the directories and then use these values
  8. # in the find_path() and find_library() calls
  9. find_package(PkgConfig QUIET)
  10. PKG_CHECK_MODULES(PC_SPOT QUIET spot)
  11. find_path(SPOT_INCLUDE_DIR NAMES spot/misc/_config.h
  12. HINTS
  13. ${PC_SPOT_INCLUDEDIR}
  14. ${PC_SPOT_INCLUDE_DIRS}
  15. )
  16. find_library(SPOT_LIBRARIES NAMES spot
  17. HINTS
  18. ${PC_SPOT_LIBDIR}
  19. ${PC_SPOT_LIBRARY_DIRS}
  20. )
  21. if(PC_SPOT_VERSION)
  22. set(SPOT_VERSION ${PC_SPOT_VERSION})
  23. elseif(SPOT_INCLUDE_DIR AND EXISTS "${SPOT_INCLUDE_DIR}/spot/misc/_config.h")
  24. file(STRINGS "${SPOT_INCLUDE_DIR}/spot/misc/_config.h" SPOT_VERSION
  25. REGEX "^#define[\t ]+SPOT_VERSION[\t ]+\".+\"")
  26. string(REGEX REPLACE "^#define[\t ]+SPOT_VERSION[\t ]+\"(.+)\"" "\\1" SPOT_VERSION "${SPOT_VERSION}")
  27. endif()
  28. # handle the QUIETLY and REQUIRED arguments and set SPOT_FOUND to TRUE if
  29. # all listed variables are TRUE
  30. include(FindPackageHandleStandardArgs)
  31. FIND_PACKAGE_HANDLE_STANDARD_ARGS(SPOT
  32. REQUIRED_VARS SPOT_LIBRARIES SPOT_INCLUDE_DIR
  33. VERSION_VAR SPOT_VERSION)
  34. mark_as_advanced(SPOT_INCLUDE_DIR SPOT_LIBRARIES)