CMakeLists.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(hhsuite C CXX)
  3. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
  4. set(ENABLE_SANITIZERS 0 CACHE BOOL "Enable Sanitizers")
  5. if (NOT CMAKE_BUILD_TYPE)
  6. set(CMAKE_BUILD_TYPE Release)
  7. endif ()
  8. if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  9. message("-- Compiler is clang(++)")
  10. set(CMAKE_COMPILER_IS_CLANG 1)
  11. elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  12. message("-- Compiler is GNU ")
  13. if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0")
  14. message(FATAL_ERROR "Insufficient gcc version")
  15. endif ()
  16. elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
  17. message("-- Compiler is icc(++)")
  18. set(CMAKE_COMPILER_IS_ICC 1)
  19. endif ()
  20. if (ENABLE_SANITIZERS)
  21. include(FindUBSan)
  22. include(FindASan)
  23. include(FindMSan)
  24. include(FindTSan)
  25. endif ()
  26. set(HHSUITE_VERSION_MAJOR 3)
  27. set(HHSUITE_VERSION_MINOR 3)
  28. set(HHSUITE_VERSION_PATCH 0)
  29. include_directories(${CMAKE_BINARY_DIR}/generated)
  30. include_directories(${PROJECT_BINARY_DIR}/generated)
  31. include_directories(src)
  32. include_directories(lib/ffindex/src)
  33. include_directories(lib/simde)
  34. include_directories(lib/simd)
  35. add_subdirectory(lib/ffindex)
  36. add_subdirectory(data)
  37. add_subdirectory(src)
  38. add_subdirectory(scripts)
  39. set(CPACK_GENERATOR "DEB;TGZ;ZIP;RPM")
  40. set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Markus Meier")
  41. set(CPACK_SOURCE_IGNORE_FILES
  42. "/rpm/"
  43. "^${PROJECT_SOURCE_DIR}/build/"
  44. "^${PROJECT_SOURCE_DIR}/.git/"
  45. "^${PROJECT_SOURCE_DIR}/.gitignore"
  46. "^${PROJECT_SOURCE_DIR}/.gitattributes"
  47. "^${PROJECT_SOURCE_DIR}/lib/ffindex/.git"
  48. )
  49. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
  50. set(CPACK_PACKAGE_VERSION_MAJOR "${HHSUITE_VERSION_MAJOR}")
  51. set(CPACK_PACKAGE_VERSION_MINOR "${HHSUITE_VERSION_MINOR}")
  52. set(CPACK_PACKAGE_VERSION_MINOR "${HHSUITE_VERSION_PATCH}")
  53. include(CPack)