variables.cmake 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. set(no_special_target 0)
  7. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
  8. set(no_special_target 1)
  9. endif()
  10. set(linux_special_target 0)
  11. if (LINUX AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
  12. set(linux_special_target 1)
  13. endif()
  14. set(osx_special_target 0)
  15. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx")
  16. set(osx_special_target 1)
  17. endif()
  18. set(disable_autoupdate 0)
  19. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL ""
  20. OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp"
  21. OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64"
  22. OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore")
  23. set(disable_autoupdate 1)
  24. endif()
  25. option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON)
  26. option(DESKTOP_APP_DISABLE_DBUS_INTEGRATION "Disable all code for D-Bus integration (Linux only)." OFF)
  27. option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF)
  28. option(DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION "Disable all code for WebRTC integration." OFF)
  29. option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." OFF)
  30. option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ${no_special_target})
  31. option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)
  32. option(DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES "Bundle recommended Qt platform themes for self-contained packages. (Linux only)" ${DESKTOP_APP_USE_PACKAGED_LAZY})
  33. option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF)
  34. option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target})
  35. option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
  36. option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
  37. option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
  38. option(DESKTOP_APP_USE_ENCHANT "Use Enchant instead of bundled Hunspell. (Linux only)" OFF)
  39. set(DESKTOP_APP_QTWAYLANDCLIENT_PRIVATE_HEADERS "" CACHE STRING "QtWaylandClient headers location.")
  40. set(dont_bundle_fonts 0)
  41. if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
  42. set(dont_bundle_fonts 1)
  43. endif()
  44. option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${dont_bundle_fonts})
  45. set(add_hunspell_library 0)
  46. if ((WIN32
  47. OR (LINUX AND NOT DESKTOP_APP_USE_ENCHANT)
  48. OR DESKTOP_APP_USE_HUNSPELL_ONLY)
  49. AND NOT DESKTOP_APP_DISABLE_SPELLCHECK)
  50. set(add_hunspell_library 1)
  51. endif()
  52. set(build_osx 0)
  53. set(build_macstore 0)
  54. set(build_winstore 0) # 32 or 64 bit
  55. set(build_linux32 0)
  56. set(build_win64 0) # normal or uwp
  57. set(build_winstore64 0)
  58. if (WIN32)
  59. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64")
  60. set(build_win64 1)
  61. elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp")
  62. set(build_winstore 1)
  63. elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64")
  64. set(build_win64 1)
  65. set(build_winstore 1)
  66. set(build_winstore64 1)
  67. endif()
  68. elseif (APPLE)
  69. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx")
  70. set(build_osx 1)
  71. elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore")
  72. set(build_macstore 1)
  73. endif()
  74. else()
  75. if (CMAKE_SIZEOF_VOID_P EQUAL 4)
  76. set(build_linux32 1)
  77. endif()
  78. if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux")
  79. if (build_linux32)
  80. report_bad_special_target()
  81. endif()
  82. elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux32")
  83. if (NOT build_linux32)
  84. report_bad_special_target()
  85. endif()
  86. endif()
  87. if (DESKTOP_APP_SPECIAL_TARGET)
  88. set(CMAKE_AR "gcc-ar")
  89. set(CMAKE_RANLIB "gcc-ranlib")
  90. set(CMAKE_NM "gcc-nm")
  91. endif()
  92. endif()
  93. if (build_win64)
  94. get_filename_component(libs_loc "../Libraries/win64" REALPATH)
  95. elseif (NOT APPLE OR build_osx)
  96. get_filename_component(libs_loc "../Libraries" REALPATH)
  97. else()
  98. get_filename_component(libs_loc "../Libraries/macos" REALPATH)
  99. endif()