CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. if(NOT DEFINED APPDATA_RELEASE_DATE)
  2. if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  3. execute_process(
  4. COMMAND git log --tags -1 --pretty=%cd --date=short
  5. OUTPUT_VARIABLE APPDATA_RELEASE_DATE
  6. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
  7. OUTPUT_STRIP_TRAILING_WHITESPACE
  8. )
  9. else()
  10. file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE "%Y-%m-%d")
  11. endif()
  12. endif()
  13. if(NOT DEFINED GIT_HASH)
  14. if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  15. execute_process(
  16. COMMAND git rev-parse HEAD
  17. OUTPUT_VARIABLE GIT_HASH
  18. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
  19. OUTPUT_STRIP_TRAILING_WHITESPACE
  20. )
  21. else()
  22. set(GIT_HASH "master")
  23. endif()
  24. endif()
  25. configure_file(com.obsproject.Studio.metainfo.xml.in com.obsproject.Studio.metainfo.xml)
  26. install(
  27. FILES ${CMAKE_CURRENT_BINARY_DIR}/com.obsproject.Studio.metainfo.xml
  28. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo
  29. )
  30. install(FILES com.obsproject.Studio.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
  31. install(
  32. FILES icons/obs-logo-128.png
  33. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps
  34. RENAME com.obsproject.Studio.png
  35. )
  36. install(
  37. FILES icons/obs-logo-256.png
  38. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
  39. RENAME com.obsproject.Studio.png
  40. )
  41. install(
  42. FILES icons/obs-logo-512.png
  43. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps
  44. RENAME com.obsproject.Studio.png
  45. )
  46. install(
  47. FILES icons/obs-logo-scalable.svg
  48. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
  49. RENAME com.obsproject.Studio.svg
  50. )