options.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # This file is part of Desktop App Toolkit,
  2. # a set of libraries for developing nice desktop applications.
  3. #
  4. # For license and copyright information please follow this link:
  5. # https://github.com/desktop-app/legal/blob/master/LEGAL
  6. add_library(common_options INTERFACE)
  7. add_library(desktop-app::common_options ALIAS common_options)
  8. target_compile_definitions(common_options
  9. INTERFACE
  10. $<IF:$<CONFIG:Debug>,_DEBUG,NDEBUG>
  11. )
  12. if (DESKTOP_APP_DISABLE_CRASH_REPORTS)
  13. target_compile_definitions(common_options
  14. INTERFACE
  15. DESKTOP_APP_DISABLE_CRASH_REPORTS
  16. )
  17. endif()
  18. if (DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
  19. target_compile_definitions(common_options
  20. INTERFACE
  21. DESKTOP_APP_DISABLE_DBUS_INTEGRATION
  22. )
  23. endif()
  24. if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
  25. target_compile_definitions(common_options
  26. INTERFACE
  27. DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
  28. )
  29. endif()
  30. if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
  31. target_compile_definitions(common_options
  32. INTERFACE
  33. DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION
  34. )
  35. endif()
  36. if (DESKTOP_APP_USE_PACKAGED)
  37. target_compile_definitions(common_options
  38. INTERFACE
  39. DESKTOP_APP_USE_PACKAGED
  40. )
  41. endif()
  42. if (DESKTOP_APP_USE_PACKAGED_LAZY)
  43. target_compile_definitions(common_options
  44. INTERFACE
  45. DESKTOP_APP_USE_PACKAGED_LAZY
  46. )
  47. endif()
  48. if (DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES)
  49. target_compile_definitions(common_options
  50. INTERFACE
  51. DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
  52. )
  53. endif()
  54. if (DESKTOP_APP_USE_PACKAGED_FONTS)
  55. target_compile_definitions(common_options
  56. INTERFACE
  57. DESKTOP_APP_USE_PACKAGED_FONTS
  58. )
  59. endif()
  60. if (rlottie_FOUND OR RLOTTIE_FOUND)
  61. target_compile_definitions(common_options
  62. INTERFACE
  63. DESKTOP_APP_USE_PACKAGED_RLOTTIE
  64. )
  65. endif()
  66. if (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
  67. target_compile_definitions(common_options
  68. INTERFACE
  69. DESKTOP_APP_SPECIAL_TARGET=${DESKTOP_APP_SPECIAL_TARGET}
  70. )
  71. endif()
  72. if (WIN32)
  73. include(cmake/options_win.cmake)
  74. elseif (APPLE)
  75. include(cmake/options_mac.cmake)
  76. elseif (LINUX)
  77. include(cmake/options_linux.cmake)
  78. else()
  79. message(FATAL_ERROR "Unknown platform type")
  80. endif()