CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. project(razer C)
  2. cmake_minimum_required(VERSION 2.4)
  3. if (COMMAND cmake_policy)
  4. # Libraries linked via full path no longer produce linker search paths.
  5. cmake_policy(SET CMP0003 NEW)
  6. # Preprocessor definition values shall be escaped automatically.
  7. cmake_policy(SET CMP0005 NEW)
  8. endif (COMMAND cmake_policy)
  9. include("${razer_SOURCE_DIR}/scripts/cmake.global")
  10. include(CheckIncludeFile)
  11. macro(CHECK_LIB _LIB _HEADER)
  12. check_include_file(${_HEADER} ${_HEADER}_ERR)
  13. if (NOT ${_HEADER}_ERR)
  14. message(FATAL_ERROR "Could not find library \"lib${_LIB}\" "
  15. "with header ${_HEADER}")
  16. endif (NOT ${_HEADER}_ERR)
  17. endmacro(CHECK_LIB)
  18. check_lib(usb-1.0 libusb.h)
  19. add_subdirectory(librazer)
  20. configure_file("udev.rules.template" "udev.rules")
  21. if(UDEV_DIR)
  22. install(FILES ${CMAKE_BINARY_DIR}/udev.rules
  23. DESTINATION ${UDEV_DIR}/rules.d
  24. RENAME 80-razer.rules)
  25. endif(UDEV_DIR)
  26. configure_file("pm-hook.sh.template" "pm-hook.sh" @ONLY)
  27. install(FILES ${CMAKE_BINARY_DIR}/pm-hook.sh
  28. DESTINATION /etc/pm/sleep.d
  29. RENAME 50-razer
  30. PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
  31. GROUP_READ GROUP_EXECUTE
  32. WORLD_READ WORLD_EXECUTE)
  33. configure_file("razerd.service.template" "razerd.service")
  34. if(SYSTEMD_UNIT_DIR)
  35. install(FILES ${CMAKE_BINARY_DIR}/razerd.service
  36. DESTINATION ${SYSTEMD_UNIT_DIR})
  37. endif(SYSTEMD_UNIT_DIR)
  38. install(FILES ${CMAKE_SOURCE_DIR}/tmpfile.conf
  39. DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d
  40. RENAME razerd.conf)
  41. add_subdirectory(razerd)
  42. add_subdirectory(ui)