CMakeLists.txt 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. cmake_minimum_required(VERSION 3.12)
  2. project(linux-wallpaperengine)
  3. # prevent installing to /usr by default so we don't bork anything
  4. if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  5. set(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}" CACHE PATH "..." FORCE)
  6. endif()
  7. set_property(GLOBAL PROPERTY OS_FOLDERS ON)
  8. set(CMAKE_CXX_STANDARD 20)
  9. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
  10. set(OpenGL_GL_PREFERENCE "LEGACY")
  11. set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  12. # puts the app in demomode, which records a 5 second webm video and quits
  13. if(NOT DEMOMODE)
  14. set(DEMOMODE 0)
  15. endif()
  16. # if you're developing you might find this debug option useful for shader output, although RenderDoc is encouraged
  17. if(NOT ERRORONLY)
  18. set(ERRORONLY 0)
  19. endif()
  20. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
  21. find_package(X11)
  22. find_package(OpenGL REQUIRED)
  23. find_package(GLEW REQUIRED)
  24. find_package(DBus REQUIRED)
  25. find_package(GLUT REQUIRED)
  26. find_package(ZLIB REQUIRED)
  27. find_package(SDL2 REQUIRED)
  28. find_package(MPV REQUIRED)
  29. find_package(LZ4 REQUIRED)
  30. find_package(FFMPEG REQUIRED)
  31. find_package(PulseAudio REQUIRED)
  32. find_package(Freetype REQUIRED)
  33. find_package(PkgConfig REQUIRED)
  34. pkg_check_modules(HARFBUZZ REQUIRED IMPORTED_TARGET harfbuzz)
  35. # scene scripts run on V8 like Wallpaper Engine's scenescript64.dll, taken from the system's Node.js library
  36. find_package(V8 10.2 REQUIRED)
  37. set(ENABLE_OPT OFF)
  38. set(SPIRV_CROSS_FORCE_PIC ON)
  39. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  40. set(KISSFFT_TEST OFF)
  41. set(KISSFFT_TOOLS OFF)
  42. # Download CEF of specified version for current platform
  43. set(CEF_VERSION "135.0.17+gcbc1c5b+chromium-135.0.7049.52")
  44. # CEF_DISTRIBUTION_TYPE default value should be different based on the type of build
  45. # debug builds should use standard versions
  46. # while release version can do with the minimal version
  47. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  48. set(default_cef_dist "standard")
  49. else()
  50. set(default_cef_dist "minimal")
  51. endif()
  52. set(CEF_DISTRIBUTION_TYPE "${default_cef_dist}" CACHE STRING "CEF distribution variant")
  53. set_property(CACHE CEF_DISTRIBUTION_TYPE PROPERTY STRINGS "minimal" "standard")
  54. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
  55. if("${PROJECT_ARCH}" STREQUAL "arm64")
  56. set(CEF_PLATFORM "macosarm64")
  57. set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
  58. elseif("${PROJECT_ARCH}" STREQUAL "x86_64")
  59. set(CEF_PLATFORM "macosx64")
  60. set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
  61. elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
  62. set(PROJECT_ARCH "arm64")
  63. set(CEF_PLATFORM "macosarm64")
  64. set(CEF_ARCH_DETECTION "${CMAKE_HOST_SYSTEM_PROCESSOR}")
  65. else()
  66. set(PROJECT_ARCH "x86_64")
  67. set(CEF_PLATFORM "macosx64")
  68. set(CEF_ARCH_DETECTION "Default for Darwin")
  69. endif()
  70. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  71. if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
  72. set(CEF_PLATFORM "linuxarm")
  73. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  74. elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
  75. set(PROJECT_ARCH "arm64")
  76. set(CEF_PLATFORM "linuxarm64")
  77. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  78. elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
  79. set(PROJECT_ARCH "arm64")
  80. set(CEF_PLATFORM "linuxarm64")
  81. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  82. elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
  83. set(CEF_PLATFORM "linux64")
  84. set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P} (${CMAKE_SYSTEM_PROCESSOR})")
  85. else()
  86. message(FATAL_ERROR "Linux x86 32-bit builds are discontinued.")
  87. endif()
  88. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  89. if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64")
  90. set(CEF_PLATFORM "windowsarm64")
  91. set(CEF_ARCH_DETECTION "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
  92. elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
  93. set(CEF_PLATFORM "windows64")
  94. set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P}")
  95. else()
  96. set(CEF_PLATFORM "windows32")
  97. set(CEF_ARCH_DETECTION "Default for Windows")
  98. endif()
  99. endif()
  100. if(CEF_DISTRIBUTION_TYPE AND NOT CEF_DISTRIBUTION_TYPE STREQUAL "standard")
  101. set(CEF_PLATFORM "${CEF_PLATFORM}_${CEF_DISTRIBUTION_TYPE}")
  102. endif()
  103. message(STATUS "Using CEF for ${CMAKE_SYSTEM_NAME} - ${CEF_PLATFORM} (${CEF_ARCH_DETECTION})")
  104. include(DownloadCEF)
  105. DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_CURRENT_BINARY_DIR}/cef")
  106. # add cef's cmake files to the lookup so we can use those directly
  107. list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
  108. find_package(CEF REQUIRED)
  109. # remove some switches that forbid us from using things that are commonplace in our codebase
  110. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-exceptions)
  111. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-rtti)
  112. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -std=c++17)
  113. list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility=hidden)
  114. list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility-inlines-hidden)
  115. list(APPEND CEF_CXX_COMPILER_FLAGS -std=c++20)
  116. list(APPEND CEF_EXE_LINKER_FLAGS -rdynamic)
  117. # remove the vulkan library from the files to copy so it doesn't fail after removing it
  118. list(REMOVE_ITEM CEF_BINARY_FILES libvulkan.so.1)
  119. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
  120. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
  121. set(TARGET_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
  122. # RPATH configuration: use build directories during development, but $ORIGIN after installation
  123. # NOTE: \$ORIGIN must be escaped because CMake treats $VAR as variable expansion.
  124. # IMPORTANT: This must be set BEFORE any add_executable()/add_library() calls in this directory.
  125. set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  126. set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib;\$ORIGIN/lib64")
  127. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
  128. add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
  129. add_subdirectory(src/External/glslang-WallpaperEngine glslang)
  130. # SPIRV-Cross and kissfft want CMake < 3.13, the options set above only stick with CMP0077 NEW
  131. set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
  132. add_subdirectory(src/External/SPIRV-Cross-WallpaperEngine spirv-cross)
  133. add_subdirectory(src/External/kissfft kissfft)
  134. unset(CMAKE_POLICY_DEFAULT_CMP0077)
  135. # only msdfgen's core is needed (text MSDF glyphs), its own CMake project wants vcpkg/skia/tinyxml for the rest
  136. file(GLOB MSDFGEN_CORE_SOURCES src/External/msdfgen/core/*.cpp)
  137. add_library(msdfgen-core STATIC ${MSDFGEN_CORE_SOURCES})
  138. target_include_directories(msdfgen-core PUBLIC src/External/msdfgen)
  139. # an empty export macro makes base.h skip the msdfgen-config.h its CMake project would generate
  140. target_compile_definitions(msdfgen-core PUBLIC "MSDFGEN_PUBLIC=")
  141. add_subdirectory(src/External/argparse argparse)
  142. if(BUILD_TESTING)
  143. add_subdirectory(src/External/Catch2)
  144. endif()
  145. # try to enable wayland builds when possible
  146. pkg_check_modules(WAYLAND_SUPPORT wayland-cursor wayland-protocols egl wayland-egl)
  147. option(DISABLE_KDE_FEATURES "Build without the KDE Plasma integration (plasma-shell surfaces, KWin fullscreen detection and cursor tracking)" OFF)
  148. if(WAYLAND_SUPPORT_FOUND)
  149. find_program(WaylandScanner NAMES wayland-scanner)
  150. message(STATUS "Found WaylandScanner at ${WaylandScanner}")
  151. execute_process(
  152. COMMAND pkg-config --variable=pkgdatadir wayland-protocols
  153. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  154. OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
  155. OUTPUT_STRIP_TRAILING_WHITESPACE)
  156. message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")
  157. set(WAYLAND_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/wayland)
  158. file(MAKE_DIRECTORY ${WAYLAND_OUTPUT_DIR})
  159. message(STATUS "Building protocols...")
  160. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
  161. COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-foreign-toplevel-management-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h)
  162. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
  163. COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-foreign-toplevel-management-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c)
  164. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
  165. COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h)
  166. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
  167. COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c)
  168. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h
  169. COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/color-management-v1.xml ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h)
  170. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c
  171. COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/color-management-v1.xml ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c)
  172. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
  173. COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h)
  174. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
  175. COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c)
  176. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h
  177. COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h)
  178. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
  179. COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c)
  180. include_directories(${WAYLAND_SUPPORT_INCLUDE_DIRS})
  181. include_directories(${WAYLAND_OUTPUT_DIR})
  182. set(WAYLAND_LIBRARIES
  183. pthread
  184. wayland-cursor
  185. wayland-client
  186. wayland-egl
  187. ${OPENGL_egl_LIBRARY})
  188. set(WAYLAND_SOURCES
  189. src/WallpaperEngine/Render/Drivers/HeadlessOpenGLDriver.h
  190. src/WallpaperEngine/Render/Drivers/HeadlessOpenGLDriver.cpp
  191. src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.h
  192. src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.cpp
  193. src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.cpp
  194. src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.h
  195. src/WallpaperEngine/Render/Drivers/Detectors/GnomeFullScreenDetector.cpp
  196. src/WallpaperEngine/Render/Drivers/Detectors/GnomeFullScreenDetector.h
  197. src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.cpp
  198. src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.h
  199. src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.cpp
  200. src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.h
  201. src/WallpaperEngine/Input/Drivers/WaylandMouseInput.cpp
  202. src/WallpaperEngine/Input/Drivers/WaylandMouseInput.h
  203. ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
  204. ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
  205. ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
  206. ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
  207. ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
  208. ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
  209. ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
  210. ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h
  211. ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c
  212. ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h)
  213. if(NOT DISABLE_KDE_FEATURES)
  214. pkg_check_modules(DBUS dbus-1)
  215. if(NOT DBUS_FOUND)
  216. message(FATAL_ERROR "The KDE integration needs the dbus-1 development files (libdbus-1-dev, dbus-devel or dbus depending on the distro). Install them or configure with -DDISABLE_KDE_FEATURES=ON")
  217. endif()
  218. set(KDE_FEATURES_ENABLED TRUE)
  219. message(STATUS "KDE integration enabled")
  220. include_directories(${DBUS_INCLUDE_DIRS})
  221. list(APPEND WAYLAND_LIBRARIES ${DBUS_LIBRARIES})
  222. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h
  223. COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
  224. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
  225. COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c)
  226. list(APPEND WAYLAND_SOURCES
  227. src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.cpp
  228. src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.h
  229. src/WallpaperEngine/Input/Drivers/KDECursorInput.cpp
  230. src/WallpaperEngine/Input/Drivers/KDECursorInput.h
  231. src/WallpaperEngine/Desktop/KDESession.cpp
  232. src/WallpaperEngine/Desktop/KDESession.h
  233. ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
  234. ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
  235. endif()
  236. endif()
  237. if(X11_FOUND)
  238. if(NOT X11_Xrandr_FOUND)
  239. message(WARNING "X11 support disabled. Xrandr package is missing")
  240. set(X11_SUPPORT_FOUND FALSE)
  241. elseif(NOT X11_xf86vmode_FOUND)
  242. message(WARNING "X11 support disabled. Xxf86vm package is missing")
  243. set(X11_SUPPORT_FOUND FALSE)
  244. else()
  245. message("X11 support enabled")
  246. set(X11_SUPPORT_FOUND TRUE)
  247. endif()
  248. endif()
  249. if(X11_SUPPORT_FOUND)
  250. include_directories(${X11_INCLUDE_DIR} ${XRANDR_INCLUDE_DIR})
  251. set(X11_LIBRARIES
  252. ${X11_LIBRARIES}
  253. ${X11_Xrandr_LIB}
  254. ${X11_Xext_LIB})
  255. set(X11_SOURCES
  256. src/WallpaperEngine/Render/Drivers/Output/X11Output.cpp
  257. src/WallpaperEngine/Render/Drivers/Output/X11Output.h
  258. src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.cpp
  259. src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.h)
  260. SET(X11_INCLUDES
  261. ${X11_INCLUDE_DIR}
  262. ${XRANDR_INCLUDE_DIR})
  263. set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
  264. endif()
  265. if(DEMOMODE)
  266. set(DEMOMODE_SOURCES
  267. src/recording.cpp
  268. src/recording.h)
  269. message(WARNING "Enabling demo mode will automatically record 5 seconds and stop the software. This is used internally to produce the video seen on the website as a sort of status report")
  270. endif()
  271. if(NOT WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
  272. message(WARNING "No window server detected at build time. You will only be able to preview backgrounds")
  273. endif()
  274. add_library(ceflib SHARED IMPORTED)
  275. set_target_properties(ceflib
  276. PROPERTIES IMPORTED_LOCATION ${TARGET_OUTPUT_DIRECTORY}/libcef.so)
  277. ADD_LOGICAL_TARGET(libcef_lib "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}")
  278. PRINT_CEF_CONFIG()
  279. # Embed scene-script builtins (builtins.js) into a generated header, so the JS can
  280. # live in its own file (lint/syntax-highlight friendly) instead of an inline literal.
  281. # Added to the global include_directories so both the library and the tests target
  282. # (which recompiles the common sources) can find the generated header.
  283. set(WPENGINE_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
  284. set(WPENGINE_BUILTINS_JS "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/builtins.js")
  285. file(READ "${WPENGINE_BUILTINS_JS}" WPENGINE_SCRIPT_BUILTINS)
  286. configure_file(
  287. "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/Builtins.generated.h.in"
  288. "${WPENGINE_GENERATED_DIR}/WallpaperEngine/Scripting/Builtins.generated.h"
  289. @ONLY)
  290. # re-run configuration (regenerating the header) whenever the .js changes
  291. set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${WPENGINE_BUILTINS_JS}")
  292. include_directories(
  293. ${WPENGINE_GENERATED_DIR}
  294. src
  295. src/External/glslang-WallpaperEngine
  296. src/External/SPIRV-Cross-WallpaperEngine
  297. src/External/MimeTypes
  298. src/External/nanosvg
  299. src/External/json/include
  300. src/External/stb
  301. src/External/kissfft
  302. ${MPV_INCLUDE_DIR}
  303. ${GLEW_INCLUDE_DIR}
  304. ${LZ4_INCLUDE_DIR}
  305. ${SDL2_INCLUDE_DIRS}
  306. ${FFMPEG_INCLUDE_DIR}
  307. ${PULSEAUDIO_INCLUDE_DIR}
  308. ${CEF_INCLUDE_PATH}
  309. ${CMAKE_SOURCE_DIR}
  310. ${X11_INCLUDES}
  311. ${DBUS_INCLUDE_DIRS})
  312. set(COMMON_SOURCES
  313. src/External/MimeTypes/MimeTypes.cpp
  314. src/External/MimeTypes/MimeTypes.h
  315. src/Steam/FileSystem/FileSystem.cpp
  316. src/Steam/FileSystem/FileSystem.h
  317. src/WallpaperEngine/Logging/Log.cpp
  318. src/WallpaperEngine/Logging/Log.h
  319. src/WallpaperEngine/Debugging/CallStack.cpp
  320. src/WallpaperEngine/Debugging/CallStack.h
  321. src/WallpaperEngine/Application/ApplicationContext.cpp
  322. src/WallpaperEngine/Application/ApplicationContext.h
  323. src/WallpaperEngine/Application/WallpaperApplication.cpp
  324. src/WallpaperEngine/Application/WallpaperApplication.h
  325. src/WallpaperEngine/Assets/AssetLoadException.cpp
  326. src/WallpaperEngine/Assets/AssetLoadException.h
  327. src/WallpaperEngine/Assets/AssetLocator.cpp
  328. src/WallpaperEngine/Assets/AssetLocator.h
  329. src/WallpaperEngine/FileSystem/Container.h
  330. src/WallpaperEngine/FileSystem/Container.cpp
  331. src/WallpaperEngine/FileSystem/Adapters/Types.h
  332. src/WallpaperEngine/FileSystem/Adapters/Directory.cpp
  333. src/WallpaperEngine/FileSystem/Adapters/Directory.h
  334. src/WallpaperEngine/FileSystem/Adapters/Package.cpp
  335. src/WallpaperEngine/FileSystem/Adapters/Package.h
  336. src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp
  337. src/WallpaperEngine/FileSystem/Adapters/Virtual.h
  338. src/WallpaperEngine/FileSystem/Adapters/MediaCover.h
  339. src/WallpaperEngine/FileSystem/Adapters/MediaCover.cpp
  340. src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.cpp
  341. src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.h
  342. src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.cpp
  343. src/WallpaperEngine/Desktop/IconTheme.cpp
  344. src/WallpaperEngine/Desktop/IconTheme.h
  345. src/WallpaperEngine/Desktop/UserShortcut.cpp
  346. src/WallpaperEngine/Desktop/UserShortcut.h
  347. src/WallpaperEngine/Audio/SpectrumAnalyzer.cpp
  348. src/WallpaperEngine/Audio/SpectrumAnalyzer.h
  349. src/WallpaperEngine/Audio/SpectrumProcessor.cpp
  350. src/WallpaperEngine/Audio/SpectrumProcessor.h
  351. src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.h
  352. src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.cpp
  353. src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.h
  354. src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.cpp
  355. src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.h
  356. src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.cpp
  357. src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.h
  358. src/WallpaperEngine/Audio/Drivers/AudioDriver.cpp
  359. src/WallpaperEngine/Audio/Drivers/AudioDriver.h
  360. src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp
  361. src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h
  362. src/WallpaperEngine/Audio/AudioContext.cpp
  363. src/WallpaperEngine/Audio/AudioContext.h
  364. src/WallpaperEngine/Audio/AudioStream.cpp
  365. src/WallpaperEngine/Audio/AudioStream.h
  366. src/WallpaperEngine/Input/InputContext.cpp
  367. src/WallpaperEngine/Input/InputContext.h
  368. src/WallpaperEngine/Input/MouseInput.h
  369. src/WallpaperEngine/Input/ForwardedButton.h
  370. src/WallpaperEngine/Input/ForwardedButton.cpp
  371. src/WallpaperEngine/Input/Drivers/GLFWMouseInput.cpp
  372. src/WallpaperEngine/Input/Drivers/GLFWMouseInput.h
  373. src/WallpaperEngine/Media/CoverDownloader.h
  374. src/WallpaperEngine/Media/CoverDownloader.cpp
  375. src/WallpaperEngine/Media/CoverImage.h
  376. src/WallpaperEngine/Media/CoverImage.cpp
  377. src/WallpaperEngine/Media/MediaSource.h
  378. src/WallpaperEngine/Media/MediaSource.cpp
  379. src/WallpaperEngine/Media/DBusMediaSource.h
  380. src/WallpaperEngine/Media/DBusMediaSource.cpp
  381. src/WallpaperEngine/Desktop/GnomeShell.h
  382. src/WallpaperEngine/Desktop/GnomeShell.cpp
  383. src/WallpaperEngine/Desktop/WindowState.h
  384. src/WallpaperEngine/Desktop/WindowState.cpp
  385. src/WallpaperEngine/Desktop/KWinScript.h
  386. src/WallpaperEngine/Desktop/KWinScript.cpp
  387. src/WallpaperEngine/Media/ThumbnailPalette.h
  388. src/WallpaperEngine/Media/ThumbnailPalette.cpp
  389. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.h
  390. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.cpp
  391. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.h
  392. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.cpp
  393. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.h
  394. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.cpp
  395. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.h
  396. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.cpp
  397. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.h
  398. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.cpp
  399. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.h
  400. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.cpp
  401. src/WallpaperEngine/Render/Shaders/Shader.h
  402. src/WallpaperEngine/Render/Shaders/Shader.cpp
  403. src/WallpaperEngine/Render/Shaders/ShaderUnit.cpp
  404. src/WallpaperEngine/Render/Shaders/ShaderUnit.h
  405. src/WallpaperEngine/Render/Shaders/GLSLContext.cpp
  406. src/WallpaperEngine/Render/Shaders/GLSLContext.h
  407. src/WallpaperEngine/Render/Shaders/ShaderCache.cpp
  408. src/WallpaperEngine/Render/Shaders/ShaderCache.h
  409. src/WallpaperEngine/Render/Helpers/ContextAware.cpp
  410. src/WallpaperEngine/Render/Helpers/ContextAware.h
  411. src/WallpaperEngine/Render/Drivers/VideoFactories.cpp
  412. src/WallpaperEngine/Render/Drivers/VideoFactories.h
  413. src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.cpp
  414. src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.h
  415. src/WallpaperEngine/Render/Drivers/Output/Output.cpp
  416. src/WallpaperEngine/Render/Drivers/Output/Output.h
  417. src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.cpp
  418. src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.h
  419. src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.cpp
  420. src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.h
  421. src/WallpaperEngine/Render/Drivers/Output/OutputViewport.cpp
  422. src/WallpaperEngine/Render/Drivers/Output/OutputViewport.h
  423. src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.h
  424. src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.cpp
  425. src/WallpaperEngine/Render/Drivers/VideoDriver.h
  426. src/WallpaperEngine/Render/Drivers/VideoDriver.cpp
  427. src/WallpaperEngine/Render/RenderContext.h
  428. src/WallpaperEngine/Render/RenderContext.cpp
  429. src/WallpaperEngine/Render/TextureCache.h
  430. src/WallpaperEngine/Render/TextureCache.cpp
  431. src/WallpaperEngine/Render/ImageDecoder.h
  432. src/WallpaperEngine/Render/ImageDecoder.cpp
  433. src/WallpaperEngine/Render/GifAnimation.h
  434. src/WallpaperEngine/Render/GifAnimation.cpp
  435. src/WallpaperEngine/Render/FBOProvider.cpp
  436. src/WallpaperEngine/Render/FBOProvider.h
  437. src/WallpaperEngine/Render/Helpers/ContextAware.cpp
  438. src/WallpaperEngine/Render/Helpers/ContextAware.h
  439. src/WallpaperEngine/Render/CWallpaper.h
  440. src/WallpaperEngine/Render/CWallpaper.cpp
  441. src/WallpaperEngine/Render/WallpaperState.h
  442. src/WallpaperEngine/Render/WallpaperState.cpp
  443. src/WallpaperEngine/Render/Wallpapers/CScene.h
  444. src/WallpaperEngine/Render/Wallpapers/CScene.cpp
  445. src/WallpaperEngine/Render/Wallpapers/CVideo.h
  446. src/WallpaperEngine/Render/Wallpapers/CVideo.cpp
  447. src/WallpaperEngine/Render/Wallpapers/CWeb.h
  448. src/WallpaperEngine/Render/Wallpapers/CWeb.cpp
  449. src/WallpaperEngine/Render/Wallpapers/CSplat.h
  450. src/WallpaperEngine/Render/Wallpapers/CSplat.cpp
  451. src/WallpaperEngine/Splat/SogLoader.h
  452. src/WallpaperEngine/Splat/SogLoader.cpp
  453. src/WallpaperEngine/Render/Camera.h
  454. src/WallpaperEngine/Render/Camera.cpp
  455. src/WallpaperEngine/Render/CObject.h
  456. src/WallpaperEngine/Render/CObject.cpp
  457. src/WallpaperEngine/Render/CTexture.cpp
  458. src/WallpaperEngine/Render/CTexture.h
  459. src/WallpaperEngine/Render/AlbumTexture.h
  460. src/WallpaperEngine/Render/AlbumTexture.cpp
  461. src/WallpaperEngine/Render/MissingTexture.h
  462. src/WallpaperEngine/Render/MissingTexture.cpp
  463. src/WallpaperEngine/Render/TextureProvider.h
  464. src/WallpaperEngine/Render/Objects/CRenderable.cpp
  465. src/WallpaperEngine/Render/Objects/CRenderable.h
  466. src/WallpaperEngine/Render/Objects/CImage.h
  467. src/WallpaperEngine/Render/Objects/CImage.cpp
  468. src/WallpaperEngine/Render/Objects/PuppetClipping.h
  469. src/WallpaperEngine/Render/Objects/PuppetClipping.cpp
  470. src/WallpaperEngine/Render/Objects/PuppetIK.h
  471. src/WallpaperEngine/Render/Objects/PuppetIK.cpp
  472. src/WallpaperEngine/Render/Objects/PuppetPhysics.h
  473. src/WallpaperEngine/Render/Objects/PuppetPhysics.cpp
  474. src/WallpaperEngine/Render/Objects/PuppetRootMotion.h
  475. src/WallpaperEngine/Render/Objects/PuppetRootMotion.cpp
  476. src/WallpaperEngine/Render/Objects/PuppetRig.h
  477. src/WallpaperEngine/Render/Objects/PuppetRig.cpp
  478. src/WallpaperEngine/Render/Objects/CSound.h
  479. src/WallpaperEngine/Render/Objects/CSound.cpp
  480. src/WallpaperEngine/Render/Objects/CParticle.h
  481. src/WallpaperEngine/Render/Objects/CParticle.cpp
  482. src/WallpaperEngine/Render/Objects/CText.h
  483. src/WallpaperEngine/Render/Objects/CText.cpp
  484. src/WallpaperEngine/Render/Objects/TextLayout.h
  485. src/WallpaperEngine/Render/Objects/TextLayout.cpp
  486. src/WallpaperEngine/Render/Objects/CLight.h
  487. src/WallpaperEngine/Render/Objects/CLight.cpp
  488. src/WallpaperEngine/Render/Objects/CCamera.h
  489. src/WallpaperEngine/Render/Objects/CCamera.cpp
  490. src/WallpaperEngine/Render/Volumetrics.h
  491. src/WallpaperEngine/Render/Volumetrics.cpp
  492. src/WallpaperEngine/Render/FrameMaterial.h
  493. src/WallpaperEngine/Render/FrameMaterial.cpp
  494. src/WallpaperEngine/Render/ShadowMapping.h
  495. src/WallpaperEngine/Render/ShadowMapping.cpp
  496. src/WallpaperEngine/Render/ModelData.h
  497. src/WallpaperEngine/Render/ModelData.cpp
  498. src/WallpaperEngine/Render/Objects/CMesh.h
  499. src/WallpaperEngine/Render/Objects/CMesh.cpp
  500. src/WallpaperEngine/Render/CFBO.h
  501. src/WallpaperEngine/Render/CFBO.cpp
  502. src/WallpaperEngine/Render/Objects/Effects/CPass.h
  503. src/WallpaperEngine/Render/Objects/Effects/CPass.cpp
  504. src/WallpaperEngine/WebBrowser/CEF/SharedMemoryRenderHandler.cpp
  505. src/WallpaperEngine/WebBrowser/CEF/SharedMemoryRenderHandler.h
  506. src/WallpaperEngine/WebBrowser/CEF/BrowserClient.cpp
  507. src/WallpaperEngine/WebBrowser/CEF/PageBridge.cpp
  508. src/WallpaperEngine/WebBrowser/CEF/PageBridge.h
  509. src/WallpaperEngine/WebBrowser/CEF/BrowserClient.h
  510. src/WallpaperEngine/WebBrowser/CEF/BrowserApp.cpp
  511. src/WallpaperEngine/WebBrowser/CEF/BrowserApp.h
  512. src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp
  513. src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.h
  514. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.cpp
  515. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.h
  516. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.cpp
  517. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.h
  518. src/WallpaperEngine/WebBrowser/WebBrowserContext.cpp
  519. src/WallpaperEngine/WebBrowser/WebBrowserContext.h
  520. src/WallpaperEngine/WebBrowser/IPC/WebHostSharedMemory.cpp
  521. src/WallpaperEngine/WebBrowser/IPC/WebHostSharedMemory.h
  522. src/WallpaperEngine/Data/Assets/Types.h
  523. src/WallpaperEngine/Data/Assets/Texture.h
  524. src/WallpaperEngine/Data/Assets/Package.h
  525. src/WallpaperEngine/Data/Model/Types.h
  526. src/WallpaperEngine/Data/Model/Project.h
  527. src/WallpaperEngine/Data/Model/ImageAdjustments.h
  528. src/WallpaperEngine/Data/Model/Wallpaper.h
  529. src/WallpaperEngine/Data/Model/Object.h
  530. src/WallpaperEngine/Data/Model/Material.h
  531. src/WallpaperEngine/Data/Model/Effect.h
  532. src/WallpaperEngine/Data/Model/Model.h
  533. src/WallpaperEngine/Data/Model/UserSetting.h
  534. src/WallpaperEngine/Data/Model/DynamicValue.h
  535. src/WallpaperEngine/Data/Model/DynamicValue.cpp
  536. src/WallpaperEngine/Data/Model/Effect.cpp
  537. src/WallpaperEngine/Data/Model/PropertyAnimation.h
  538. src/WallpaperEngine/Data/Model/Property.h
  539. src/WallpaperEngine/Data/Utils/TypeCaster.h
  540. src/WallpaperEngine/Data/Utils/BinaryReader.cpp
  541. src/WallpaperEngine/Data/Utils/BinaryReader.h
  542. src/WallpaperEngine/Data/Utils/MemoryStream.h
  543. src/WallpaperEngine/Data/Utils/SFINAE.h
  544. src/WallpaperEngine/Data/Parsers/DynamicValueParser.h
  545. src/WallpaperEngine/Data/Parsers/DynamicValueParser.cpp
  546. src/WallpaperEngine/Data/Parsers/EffectParser.cpp
  547. src/WallpaperEngine/Data/Parsers/EffectParser.h
  548. src/WallpaperEngine/Data/Parsers/Localization.cpp
  549. src/WallpaperEngine/Data/Parsers/Localization.h
  550. src/WallpaperEngine/Data/Parsers/ProjectParser.cpp
  551. src/WallpaperEngine/Data/Parsers/ProjectParser.h
  552. src/WallpaperEngine/Data/Parsers/WallpaperParser.cpp
  553. src/WallpaperEngine/Data/Parsers/WallpaperParser.h
  554. src/WallpaperEngine/Data/Parsers/UserSettingParser.cpp
  555. src/WallpaperEngine/Data/Parsers/UserSettingParser.h
  556. src/WallpaperEngine/Data/Parsers/ObjectParser.cpp
  557. src/WallpaperEngine/Data/Parsers/ObjectParser.h
  558. src/WallpaperEngine/Data/Parsers/MaterialParser.cpp
  559. src/WallpaperEngine/Data/Parsers/MaterialParser.h
  560. src/WallpaperEngine/Data/Parsers/ModelParser.cpp
  561. src/WallpaperEngine/Data/Parsers/ModelParser.h
  562. src/WallpaperEngine/Data/Parsers/ShaderConstantParser.cpp
  563. src/WallpaperEngine/Data/Parsers/ShaderConstantParser.h
  564. src/WallpaperEngine/Data/Parsers/PackageParser.cpp
  565. src/WallpaperEngine/Data/Parsers/PackageParser.h
  566. src/WallpaperEngine/Data/Parsers/PropertyParser.cpp
  567. src/WallpaperEngine/Data/Parsers/PropertyParser.h
  568. src/WallpaperEngine/Data/Parsers/TextureParser.cpp
  569. src/WallpaperEngine/Data/Parsers/TextureParser.h
  570. src/WallpaperEngine/Data/Builders/ColorBuilder.h
  571. src/WallpaperEngine/Data/Builders/ColorBuilder.cpp
  572. src/WallpaperEngine/Data/Builders/UserSettingBuilder.h
  573. src/WallpaperEngine/Data/Builders/VectorBuilder.cpp
  574. src/WallpaperEngine/Data/Builders/VectorBuilder.h
  575. src/WallpaperEngine/Data/Dumpers/StringPrinter.cpp
  576. src/WallpaperEngine/Data/Dumpers/StringPrinter.h
  577. src/WallpaperEngine/Data/JSON.cpp
  578. src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.cpp
  579. src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.h
  580. src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.cpp
  581. src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.h
  582. src/WallpaperEngine/Scripting/Adapters/VectorAdapter.h
  583. src/WallpaperEngine/Scripting/Adapters/VectorAdapter.cpp
  584. src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.h
  585. src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.cpp
  586. src/WallpaperEngine/Scripting/JS.h
  587. src/WallpaperEngine/Scripting/JS.cpp
  588. src/WallpaperEngine/Scripting/ConsoleObject.h
  589. src/WallpaperEngine/Scripting/ConsoleObject.cpp
  590. src/WallpaperEngine/Scripting/LocalStorage.h
  591. src/WallpaperEngine/Scripting/LocalStorage.cpp
  592. src/WallpaperEngine/Scripting/LocalStorageObject.h
  593. src/WallpaperEngine/Scripting/LocalStorageObject.cpp
  594. src/WallpaperEngine/Scripting/EngineObject.h
  595. src/WallpaperEngine/Scripting/EngineObject.cpp
  596. src/WallpaperEngine/Scripting/InputObject.h
  597. src/WallpaperEngine/Scripting/InputObject.cpp
  598. src/WallpaperEngine/Scripting/SceneObject.h
  599. src/WallpaperEngine/Scripting/SceneObject.cpp
  600. src/WallpaperEngine/Scripting/ScriptEngine.h
  601. src/WallpaperEngine/Scripting/ScriptPropertiesObject.h
  602. src/WallpaperEngine/Scripting/ScriptPropertiesObject.cpp
  603. src/WallpaperEngine/Scripting/ScriptEngine.cpp
  604. src/WallpaperEngine/Scripting/ScriptableObject.h
  605. src/WallpaperEngine/Scripting/ScriptableObject.cpp
  606. src/WallpaperEngine/Scripting/AnimationSystem.h
  607. src/WallpaperEngine/Scripting/AnimationSystem.cpp
  608. src/WallpaperEngine/Maths.h
  609. src/WallpaperEngine/Maths.cpp)
  610. if(BUILD_TESTING)
  611. add_executable(
  612. tests
  613. ${COMMON_SOURCES}
  614. src/WallpaperEngine/Testing/Cases/Example.cpp
  615. src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.cpp
  616. src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.h
  617. src/WallpaperEngine/Testing/Input/TestingMouseInput.cpp
  618. src/WallpaperEngine/Testing/Input/TestingMouseInput.h
  619. src/WallpaperEngine/Testing/Harnesses/RenderHarness.cpp
  620. src/WallpaperEngine/Testing/Harnesses/RenderHarness.h
  621. src/WallpaperEngine/Testing/Cases/MouseCoordinates.cpp
  622. src/WallpaperEngine/Testing/Cases/PropertyParser.cpp
  623. src/WallpaperEngine/Testing/Cases/SpectrumListeners.cpp
  624. src/WallpaperEngine/Testing/Cases/SpectrumPipeline.cpp
  625. src/WallpaperEngine/Testing/Cases/ParticleNoise.cpp
  626. src/WallpaperEngine/Testing/Cases/UserShortcut.cpp
  627. src/WallpaperEngine/Testing/Cases/Localization.cpp
  628. src/WallpaperEngine/Testing/Cases/ScalingModes.cpp
  629. src/WallpaperEngine/Testing/Cases/CornerColor.cpp
  630. src/WallpaperEngine/Testing/Cases/GnomeSession.cpp
  631. src/WallpaperEngine/Testing/Cases/JsonVectorParsing.cpp
  632. src/WallpaperEngine/Testing/Cases/ModuleNamespaceTiming.cpp
  633. src/WallpaperEngine/Testing/Cases/AudioSensitivity.cpp
  634. src/WallpaperEngine/Testing/Cases/ThumbnailPalette.cpp
  635. src/WallpaperEngine/Testing/Cases/TextInputProperty.cpp
  636. src/WallpaperEngine/Testing/Cases/TextLayoutRules.cpp
  637. src/WallpaperEngine/Testing/Cases/MediaCover.cpp
  638. src/WallpaperEngine/Testing/Cases/ForwardedButton.cpp
  639. src/WallpaperEngine/Testing/Cases/LocalStorage.cpp)
  640. endif()
  641. add_library(
  642. linux-wallpaperengine-lib SHARED
  643. ${COMMON_SOURCES}
  644. ${WAYLAND_SOURCES}
  645. ${X11_SOURCES}
  646. ${DEMOMODE_SOURCES})
  647. target_link_libraries (linux-wallpaperengine-lib PUBLIC
  648. ${OPENGL_LIBRARIES}
  649. GLEW::GLEW
  650. ${GLUT_LIBRARIES}
  651. ${ZLIB_LIBRARIES}
  652. ${LZ4_LIBRARY}
  653. ${SDL2_LIBRARIES}
  654. ${FFMPEG_LIBRARIES}
  655. ${MPV_LIBRARY}
  656. ${PULSEAUDIO_LIBRARY}
  657. Freetype::Freetype
  658. PkgConfig::HARFBUZZ
  659. msdfgen-core
  660. ${WAYLAND_LIBRARIES}
  661. ${X11_LIBRARIES}
  662. ${DBUS_LIBRARIES}
  663. kissfft
  664. glslang
  665. spirv-cross-core
  666. spirv-cross-glsl
  667. glfw
  668. libcef_lib
  669. libcef_dll_wrapper
  670. argparse
  671. V8::V8)
  672. if (BUILD_TESTING)
  673. target_link_libraries (tests PRIVATE
  674. Catch2::Catch2WithMain
  675. ${OPENGL_LIBRARIES}
  676. GLEW::GLEW
  677. ${GLUT_LIBRARIES}
  678. ${ZLIB_LIBRARIES}
  679. ${LZ4_LIBRARY}
  680. ${SDL2_LIBRARIES}
  681. ${FFMPEG_LIBRARIES}
  682. ${MPV_LIBRARY}
  683. ${PULSEAUDIO_LIBRARY}
  684. Freetype::Freetype
  685. PkgConfig::HARFBUZZ
  686. msdfgen-core
  687. ${WAYLAND_LIBRARIES}
  688. ${X11_LIBRARIES}
  689. ${DBUS_LIBRARIES}
  690. kissfft
  691. glslang
  692. spirv-cross-core
  693. spirv-cross-glsl
  694. glfw
  695. libcef_lib
  696. libcef_dll_wrapper
  697. argparse
  698. V8::V8)
  699. endif()
  700. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ERRORONLY=${ERRORONLY})
  701. target_compile_definitions(linux-wallpaperengine-lib PUBLIC DEMOMODE=${DEMOMODE})
  702. if (BUILD_TESTING)
  703. # tests should give as much output as possible
  704. target_compile_definitions(tests PRIVATE ERRORONLY=0)
  705. target_compile_definitions(tests PRIVATE DEMOMODE=0)
  706. endif()
  707. if(X11_SUPPORT_FOUND)
  708. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_X11)
  709. # make sure some of the X11 functions we'll use are available
  710. check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
  711. if(HAVE_XSETIOERROREXITHANDLER)
  712. target_compile_definitions(linux-wallpaperengine-lib PUBLIC HAVE_XSETIOERROREXITHANDLER=1)
  713. endif()
  714. endif()
  715. if(WAYLAND_SUPPORT_FOUND)
  716. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_WAYLAND)
  717. endif()
  718. if(KDE_FEATURES_ENABLED)
  719. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_KDE_FEATURES)
  720. endif()
  721. if(WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
  722. target_compile_definitions(linux-wallpaperengine-lib PUBLIC GLEW_EGL)
  723. endif()
  724. target_include_directories(linux-wallpaperengine-lib PUBLIC
  725. src
  726. src/External/glslang-WallpaperEngine
  727. src/External/SPIRV-Cross-WallpaperEngine
  728. src/External/MimeTypes
  729. src/External/nanosvg
  730. src/External/json/include
  731. src/External/stb
  732. src/External/kissfft
  733. ${MPV_INCLUDE_DIR}
  734. ${GLEW_INCLUDE_DIR}
  735. ${LZ4_INCLUDE_DIR}
  736. ${SDL2_INCLUDE_DIRS}
  737. ${FFMPEG_INCLUDE_DIR}
  738. ${PULSEAUDIO_INCLUDE_DIR}
  739. ${CEF_INCLUDE_PATH}
  740. ${CMAKE_SOURCE_DIR}
  741. ${X11_INCLUDES}
  742. ${WAYLAND_OUTPUT_DIR})
  743. COPY_FILES(linux-wallpaperengine-lib "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
  744. COPY_FILES(linux-wallpaperengine-lib "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
  745. # remove the vulkan lib as chromium includes a broken libvulkan.so.1 with it
  746. file(REMOVE "${CEF_BINARY_DIR}/libvulkan.so.1")
  747. set_target_properties(linux-wallpaperengine-lib PROPERTIES
  748. LIBRARY_OUTPUT_DIRECTORY ${TARGET_OUTPUT_DIRECTORY})
  749. add_dependencies(linux-wallpaperengine-lib libcef_dll_wrapper glslang spirv-cross-core spirv-cross-glsl)
  750. # custom version of cef's SET_EXECUTABLE_TARGET_PROPERTIES that fixes C files being compiled with the wrong parameters
  751. REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine-lib)
  752. add_executable(linux-wallpaperengine
  753. src/main.cpp)
  754. target_link_libraries (linux-wallpaperengine PUBLIC linux-wallpaperengine-lib)
  755. # Chromium child processes of the web host, only libcef and the page shim
  756. add_executable(linux-wallpaperengine-web-helper
  757. src/web_helper.cpp
  758. src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp)
  759. target_include_directories(linux-wallpaperengine-web-helper PRIVATE
  760. src
  761. ${CEF_INCLUDE_PATH}
  762. ${CMAKE_SOURCE_DIR})
  763. target_link_libraries(linux-wallpaperengine-web-helper PRIVATE
  764. libcef_lib
  765. libcef_dll_wrapper)
  766. add_dependencies(linux-wallpaperengine-web-helper libcef_dll_wrapper)
  767. REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine-web-helper)
  768. # GNOME 45-48: started by the Shell extension so our windows belong to a Shell-spawned client; static so it also
  769. # runs on the host for Flatpak builds
  770. include(CheckCSourceCompiles)
  771. set(CMAKE_REQUIRED_LINK_OPTIONS -static)
  772. check_c_source_compiles("int main(void) { return 0; }" LWE_CAN_LINK_STATIC)
  773. unset(CMAKE_REQUIRED_LINK_OPTIONS)
  774. add_executable(linux-wallpaperengine-gnome-helper src/gnome_wayland_helper.c)
  775. if(LWE_CAN_LINK_STATIC)
  776. target_link_options(linux-wallpaperengine-gnome-helper PRIVATE -static)
  777. endif()
  778. set_target_properties(linux-wallpaperengine-gnome-helper PROPERTIES RUNTIME_OUTPUT_DIRECTORY
  779. ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension/linux-wallpaperengine@wallpaperenginelover.github.io)
  780. # ships next to the engine for we_manager to install, copied every build so extension.js changes land
  781. add_custom_target(gnome-shell-extension ALL
  782. COMMAND ${CMAKE_COMMAND} -E copy_directory
  783. ${CMAKE_CURRENT_SOURCE_DIR}/gnome-shell-extension ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension)
  784. add_dependencies(gnome-shell-extension linux-wallpaperengine-gnome-helper)
  785. add_dependencies(linux-wallpaperengine gnome-shell-extension)
  786. # Install the main executable and shared library via install(TARGETS)
  787. # so that CMake automatically strips/replaces the build-time RPATH.
  788. install(TARGETS linux-wallpaperengine linux-wallpaperengine-web-helper
  789. RUNTIME DESTINATION .
  790. )
  791. install(TARGETS linux-wallpaperengine-lib
  792. LIBRARY DESTINATION .
  793. )
  794. # Install everything else from the output directory (CEF resources, helper binaries, etc.)
  795. # but exclude the files already handled by install(TARGETS) above.
  796. install(DIRECTORY ${TARGET_OUTPUT_DIRECTORY}/ DESTINATION .
  797. PATTERN "linux-wallpaperengine" EXCLUDE
  798. PATTERN "linux-wallpaperengine-web-helper" EXCLUDE
  799. PATTERN "liblinux-wallpaperengine-lib.so" EXCLUDE
  800. )