CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. cmake_minimum_required(VERSION 3.5)
  2. project(razer C)
  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. install(FILES ${CMAKE_BINARY_DIR}/udev.rules
  22. DESTINATION /etc/udev/rules.d
  23. RENAME 80-razer.rules)
  24. configure_file("pm-hook.sh.template" "pm-hook.sh" @ONLY)
  25. install(FILES ${CMAKE_BINARY_DIR}/pm-hook.sh
  26. DESTINATION /etc/pm/sleep.d
  27. RENAME 50-razer
  28. PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
  29. GROUP_READ GROUP_EXECUTE
  30. WORLD_READ WORLD_EXECUTE)
  31. configure_file("razerd.service.template" "razerd.service")
  32. install(FILES ${CMAKE_BINARY_DIR}/razerd.service
  33. DESTINATION /usr/lib/systemd/system)
  34. install(FILES ${CMAKE_SOURCE_DIR}/tmpfile.conf
  35. DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d
  36. RENAME razerd.conf)
  37. add_subdirectory(razerd)
  38. add_subdirectory(ui)