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.

36 lines
733 B

2 months ago
  1. # Include dir
  2. find_path(BLISS_INCLUDE_DIR
  3. NAMES bliss/bliss_C.h
  4. PATHS
  5. /usr/include
  6. /usr/local/include
  7. )
  8. # Library files
  9. find_library(BLISS_LIBRARY
  10. NAMES bliss
  11. PATHS
  12. /usr/lib
  13. /usr/local/lib
  14. )
  15. if(BLISS_INCLUDE_DIR AND BLISS_LIBRARY)
  16. set(BLISS_FOUND TRUE)
  17. # Version
  18. file(STRINGS ${BLISS_INCLUDE_DIR}/bliss/defs.hh BLISS_VERSION REGEX "const version = \".*\";")
  19. string(REGEX MATCH "[0-9]+\\.[0-9]+" BLISS_VERSION "${BLISS_VERSION}")
  20. if(BLISS_FIND_VERSION VERSION_GREATER BLISS_VERSION)
  21. message(WARNING "Required bliss ${BLISS_FIND_VERSION} but found only bliss ${BLISS_VERSION}.")
  22. return()
  23. endif()
  24. endif()
  25. # Cleanup
  26. mark_as_advanced(
  27. BLISS_FOUND
  28. BLISS_INCLUDE_DIR
  29. BLISS_LIBRARY
  30. BLISS_VERSION
  31. )