The source code and dockerfile for the GSW2024 AI Lab.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

55 lines
1.5 KiB

2 months ago
  1. #
  2. # FindCusp
  3. #
  4. # This module finds the CUSP header files and extracts their version. It
  5. # sets the following variables.
  6. #
  7. # CUSP_INCLUDE_DIR - Include directory for cusp header files. (All header
  8. # files will actually be in the cusp subdirectory.)
  9. # CUSP_VERSION - Version of cusp in the form "major.minor.patch".
  10. #
  11. # CUSP_FOUND - Indicates whether Cusp has been found
  12. #
  13. find_path(CUSP_INCLUDE_DIR
  14. HINTS
  15. /usr/include/cusp
  16. /usr/local/include
  17. /usr/local/cusp/include
  18. ${CUSP_INCLUDE_DIRS}
  19. ${CUSP_HINT}
  20. NAMES cusp/version.h
  21. DOC "Cusp headers"
  22. )
  23. if(CUSP_INCLUDE_DIR)
  24. list(REMOVE_DUPLICATES CUSP_INCLUDE_DIR)
  25. # Find cusp version
  26. file(STRINGS ${CUSP_INCLUDE_DIR}/cusp/version.h
  27. version
  28. REGEX "#define CUSP_VERSION[ \t]+([0-9x]+)"
  29. )
  30. string(REGEX REPLACE
  31. "#define CUSP_VERSION[ \t]+"
  32. ""
  33. version
  34. "${version}"
  35. )
  36. #define CUSP_MAJOR_VERSION (CUSP_VERSION / 100000)
  37. #define CUSP_MINOR_VERSION (CUSP_VERSION / 100 % 1000)
  38. #define CUSP_SUBMINOR_VERSION (CUSP_VERSION % 100)
  39. math(EXPR CUSP_MAJOR_VERSION "${version} / 100000")
  40. math(EXPR CUSP_MINOR_VERSION "${version} / 100 % 1000")
  41. math(EXPR CUSP_PATCH_VERSION "${version} % 100")
  42. set(CUSP_VERSION "${CUSP_MAJOR_VERSION}.${CUSP_MINOR_VERSION}.${CUSP_PATCH_VERSION}")
  43. # Check for required components
  44. include(FindPackageHandleStandardArgs)
  45. find_package_handle_standard_args(Cusp REQUIRED_VARS CUSP_INCLUDE_DIR VERSION_VAR CUSP_VERSION)
  46. set(CUSP_INCLUDE_DIRS ${CUSP_INCLUDE_DIR})
  47. mark_as_advanced(CUSP_INCLUDE_DIR)
  48. endif(CUSP_INCLUDE_DIR)