CMakeLists.txt 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  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. set(ENABLE_OPT OFF)
  34. set(SPIRV_CROSS_FORCE_PIC ON)
  35. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  36. set(KISSFFT_TEST OFF)
  37. set(KISSFFT_TOOLS OFF)
  38. # Download CEF of specified version for current platform
  39. # Specify the CEF distribution version.
  40. set(CEF_VERSION "135.0.17+gcbc1c5b+chromium-135.0.7049.52")
  41. # CEF_DISTRIBUTION_TYPE default value should be different based on the type of build
  42. # debug builds should use standard versions
  43. # while release version can do with the minimal version
  44. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  45. set(default_cef_dist "standard")
  46. else()
  47. set(default_cef_dist "minimal")
  48. endif()
  49. set(CEF_DISTRIBUTION_TYPE "${default_cef_dist}" CACHE STRING "CEF distribution variant")
  50. set_property(CACHE CEF_DISTRIBUTION_TYPE PROPERTY STRINGS "minimal" "standard")
  51. # Determine the platform.
  52. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
  53. if("${PROJECT_ARCH}" STREQUAL "arm64")
  54. set(CEF_PLATFORM "macosarm64")
  55. set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
  56. elseif("${PROJECT_ARCH}" STREQUAL "x86_64")
  57. set(CEF_PLATFORM "macosx64")
  58. set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
  59. elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
  60. set(PROJECT_ARCH "arm64")
  61. set(CEF_PLATFORM "macosarm64")
  62. set(CEF_ARCH_DETECTION "${CMAKE_HOST_SYSTEM_PROCESSOR}")
  63. else()
  64. set(PROJECT_ARCH "x86_64")
  65. set(CEF_PLATFORM "macosx64")
  66. set(CEF_ARCH_DETECTION "Default for Darwin")
  67. endif()
  68. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  69. if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
  70. set(CEF_PLATFORM "linuxarm")
  71. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  72. elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
  73. set(PROJECT_ARCH "arm64")
  74. set(CEF_PLATFORM "linuxarm64")
  75. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  76. elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
  77. set(PROJECT_ARCH "arm64")
  78. set(CEF_PLATFORM "linuxarm64")
  79. set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
  80. elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
  81. set(CEF_PLATFORM "linux64")
  82. set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P} (${CMAKE_SYSTEM_PROCESSOR})")
  83. else()
  84. message(FATAL_ERROR "Linux x86 32-bit builds are discontinued.")
  85. endif()
  86. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  87. if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64")
  88. set(CEF_PLATFORM "windowsarm64")
  89. set(CEF_ARCH_DETECTION "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
  90. elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
  91. set(CEF_PLATFORM "windows64")
  92. set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P}")
  93. else()
  94. set(CEF_PLATFORM "windows32")
  95. set(CEF_ARCH_DETECTION "Default for Windows")
  96. endif()
  97. endif()
  98. if(CEF_DISTRIBUTION_TYPE AND NOT CEF_DISTRIBUTION_TYPE STREQUAL "standard")
  99. set(CEF_PLATFORM "${CEF_PLATFORM}_${CEF_DISTRIBUTION_TYPE}")
  100. endif()
  101. message(STATUS "Using CEF for ${CMAKE_SYSTEM_NAME} - ${CEF_PLATFORM} (${CEF_ARCH_DETECTION})")
  102. include(DownloadCEF)
  103. DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_CURRENT_BINARY_DIR}/cef")
  104. # add cef's cmake files to the lookup so we can use those directly
  105. list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
  106. find_package(CEF REQUIRED)
  107. # remove some switches that forbid us from using things that are commonplace in our codebase
  108. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-exceptions)
  109. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-rtti)
  110. list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -std=c++17)
  111. list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility=hidden)
  112. list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility-inlines-hidden)
  113. list(APPEND CEF_CXX_COMPILER_FLAGS -std=c++20)
  114. list(APPEND CEF_EXE_LINKER_FLAGS -rdynamic)
  115. # remove the vulkan library from the files to copy so it doesn't fail after removing it
  116. list(REMOVE_ITEM CEF_BINARY_FILES libvulkan.so.1)
  117. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
  118. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
  119. set(TARGET_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
  120. # RPATH configuration: use build directories during development, but $ORIGIN after installation
  121. # NOTE: \$ORIGIN must be escaped because CMake treats $VAR as variable expansion.
  122. # IMPORTANT: This must be set BEFORE any add_executable()/add_library() calls in this directory.
  123. set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  124. set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib;\$ORIGIN/lib64")
  125. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
  126. add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
  127. add_subdirectory(src/External/glslang-WallpaperEngine glslang)
  128. add_subdirectory(src/External/SPIRV-Cross-WallpaperEngine spirv-cross)
  129. add_subdirectory(src/External/kissfft kissfft)
  130. add_subdirectory(src/External/argparse argparse)
  131. set(QJS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
  132. add_subdirectory(src/External/quickjs quickjs)
  133. if(BUILD_TESTING)
  134. add_subdirectory(src/External/Catch2)
  135. endif()
  136. # try to enable wayland builds when possible
  137. pkg_check_modules(WAYLAND_SUPPORT wayland-cursor wayland-protocols egl wayland-egl)
  138. option(ENABLE_KDE_EXPERIMENTAL_FEATURES "Enable KDE-specific Wayland fullscreen detection" OFF)
  139. if(WAYLAND_SUPPORT_FOUND)
  140. find_program(WaylandScanner NAMES wayland-scanner)
  141. message(STATUS "Found WaylandScanner at ${WaylandScanner}")
  142. execute_process(
  143. COMMAND pkg-config --variable=pkgdatadir wayland-protocols
  144. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  145. OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
  146. OUTPUT_STRIP_TRAILING_WHITESPACE)
  147. message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")
  148. set(WAYLAND_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/wayland)
  149. file(MAKE_DIRECTORY ${WAYLAND_OUTPUT_DIR})
  150. message(STATUS "Building protocols...")
  151. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
  152. 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)
  153. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
  154. 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)
  155. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
  156. 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)
  157. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
  158. 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)
  159. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
  160. COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h)
  161. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
  162. COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c)
  163. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h
  164. COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h)
  165. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
  166. COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c)
  167. include_directories(${WAYLAND_SUPPORT_INCLUDE_DIRS})
  168. include_directories(${WAYLAND_OUTPUT_DIR})
  169. set(WAYLAND_LIBRARIES
  170. pthread
  171. wayland-cursor
  172. wayland-client
  173. wayland-egl
  174. ${OPENGL_egl_LIBRARY})
  175. set(WAYLAND_SOURCES
  176. src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.h
  177. src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.cpp
  178. src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.cpp
  179. src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.h
  180. src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.cpp
  181. src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.h
  182. src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.cpp
  183. src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.h
  184. src/WallpaperEngine/Input/Drivers/WaylandMouseInput.cpp
  185. src/WallpaperEngine/Input/Drivers/WaylandMouseInput.h
  186. ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
  187. ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
  188. ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
  189. ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
  190. ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
  191. ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
  192. ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
  193. ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h)
  194. if(ENABLE_KDE_EXPERIMENTAL_FEATURES)
  195. pkg_check_modules(DBUS REQUIRED dbus-1)
  196. include_directories(${DBUS_INCLUDE_DIRS})
  197. list(APPEND WAYLAND_LIBRARIES ${DBUS_LIBRARIES})
  198. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h
  199. COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
  200. add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
  201. COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c)
  202. list(APPEND WAYLAND_SOURCES
  203. src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.cpp
  204. src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.h
  205. src/WallpaperEngine/Input/Drivers/KDECursorInput.cpp
  206. src/WallpaperEngine/Input/Drivers/KDECursorInput.h
  207. ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
  208. ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
  209. endif()
  210. endif()
  211. if(X11_FOUND)
  212. if(NOT X11_Xrandr_FOUND)
  213. message(WARNING "X11 support disabled. Xrandr package is missing")
  214. set(X11_SUPPORT_FOUND FALSE)
  215. elseif(NOT X11_xf86vmode_FOUND)
  216. message(WARNING "X11 support disabled. Xxf86vm package is missing")
  217. set(X11_SUPPORT_FOUND FALSE)
  218. else()
  219. message("X11 support enabled")
  220. set(X11_SUPPORT_FOUND TRUE)
  221. endif()
  222. endif()
  223. if(X11_SUPPORT_FOUND)
  224. include_directories(${X11_INCLUDE_DIR} ${XRANDR_INCLUDE_DIR})
  225. set(X11_LIBRARIES
  226. ${X11_LIBRARIES}
  227. ${X11_Xrandr_LIB})
  228. set(X11_SOURCES
  229. src/WallpaperEngine/Render/Drivers/Output/X11Output.cpp
  230. src/WallpaperEngine/Render/Drivers/Output/X11Output.h
  231. src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.cpp
  232. src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.h)
  233. SET(X11_INCLUDES
  234. ${X11_INCLUDE_DIR}
  235. ${XRANDR_INCLUDE_DIR})
  236. set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
  237. endif()
  238. if(DEMOMODE)
  239. set(DEMOMODE_SOURCES
  240. src/recording.cpp
  241. src/recording.h)
  242. 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")
  243. endif()
  244. if(NOT WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
  245. message(WARNING "No window server detected at build time. You will only be able to preview backgrounds")
  246. endif()
  247. add_library(ceflib SHARED IMPORTED)
  248. set_target_properties(ceflib
  249. PROPERTIES IMPORTED_LOCATION ${TARGET_OUTPUT_DIRECTORY}/libcef.so)
  250. ADD_LOGICAL_TARGET(libcef_lib "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}")
  251. PRINT_CEF_CONFIG()
  252. # Embed scene-script builtins (builtins.js) into a generated header, so the JS can
  253. # live in its own file (lint/syntax-highlight friendly) instead of an inline literal.
  254. # Added to the global include_directories so both the library and the tests target
  255. # (which recompiles the common sources) can find the generated header.
  256. set(WPENGINE_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
  257. set(WPENGINE_BUILTINS_JS "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/builtins.js")
  258. file(READ "${WPENGINE_BUILTINS_JS}" WPENGINE_SCRIPT_BUILTINS)
  259. configure_file(
  260. "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/Builtins.generated.h.in"
  261. "${WPENGINE_GENERATED_DIR}/WallpaperEngine/Scripting/Builtins.generated.h"
  262. @ONLY)
  263. # re-run configuration (regenerating the header) whenever the .js changes
  264. set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${WPENGINE_BUILTINS_JS}")
  265. include_directories(
  266. ${WPENGINE_GENERATED_DIR}
  267. src
  268. src/External/glslang-WallpaperEngine
  269. src/External/SPIRV-Cross-WallpaperEngine
  270. src/External/MimeTypes
  271. src/External/json/include
  272. src/External/stb
  273. src/External/kissfft
  274. ${MPV_INCLUDE_DIR}
  275. ${GLEW_INCLUDE_DIR}
  276. ${LZ4_INCLUDE_DIR}
  277. ${SDL2_INCLUDE_DIRS}
  278. ${FFMPEG_INCLUDE_DIR}
  279. ${PULSEAUDIO_INCLUDE_DIR}
  280. ${CEF_INCLUDE_PATH}
  281. ${CMAKE_SOURCE_DIR}
  282. ${X11_INCLUDES}
  283. ${DBUS_INCLUDE_DIRS})
  284. set(COMMON_SOURCES
  285. src/External/MimeTypes/MimeTypes.cpp
  286. src/External/MimeTypes/MimeTypes.h
  287. src/Steam/FileSystem/FileSystem.cpp
  288. src/Steam/FileSystem/FileSystem.h
  289. src/WallpaperEngine/Logging/Log.cpp
  290. src/WallpaperEngine/Logging/Log.h
  291. src/WallpaperEngine/Debugging/CallStack.cpp
  292. src/WallpaperEngine/Debugging/CallStack.h
  293. src/WallpaperEngine/Application/ApplicationContext.cpp
  294. src/WallpaperEngine/Application/ApplicationContext.h
  295. src/WallpaperEngine/Application/WallpaperApplication.cpp
  296. src/WallpaperEngine/Application/WallpaperApplication.h
  297. src/WallpaperEngine/Assets/AssetLoadException.cpp
  298. src/WallpaperEngine/Assets/AssetLoadException.h
  299. src/WallpaperEngine/Assets/AssetLocator.cpp
  300. src/WallpaperEngine/Assets/AssetLocator.h
  301. src/WallpaperEngine/FileSystem/Container.h
  302. src/WallpaperEngine/FileSystem/Container.cpp
  303. src/WallpaperEngine/FileSystem/Adapters/Types.h
  304. src/WallpaperEngine/FileSystem/Adapters/Directory.cpp
  305. src/WallpaperEngine/FileSystem/Adapters/Directory.h
  306. src/WallpaperEngine/FileSystem/Adapters/Package.cpp
  307. src/WallpaperEngine/FileSystem/Adapters/Package.h
  308. src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp
  309. src/WallpaperEngine/FileSystem/Adapters/Virtual.h
  310. src/WallpaperEngine/FileSystem/Adapters/MediaCover.h
  311. src/WallpaperEngine/FileSystem/Adapters/MediaCover.cpp
  312. src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.cpp
  313. src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.h
  314. src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.cpp
  315. src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.h
  316. src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.cpp
  317. src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.h
  318. src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.cpp
  319. src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.h
  320. src/WallpaperEngine/Audio/Drivers/AudioDriver.cpp
  321. src/WallpaperEngine/Audio/Drivers/AudioDriver.h
  322. src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp
  323. src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h
  324. src/WallpaperEngine/Audio/AudioContext.cpp
  325. src/WallpaperEngine/Audio/AudioContext.h
  326. src/WallpaperEngine/Audio/AudioStream.cpp
  327. src/WallpaperEngine/Audio/AudioStream.h
  328. src/WallpaperEngine/Input/InputContext.cpp
  329. src/WallpaperEngine/Input/InputContext.h
  330. src/WallpaperEngine/Input/MouseInput.h
  331. src/WallpaperEngine/Input/Drivers/GLFWMouseInput.cpp
  332. src/WallpaperEngine/Input/Drivers/GLFWMouseInput.h
  333. src/WallpaperEngine/Media/MediaSource.h
  334. src/WallpaperEngine/Media/MediaSource.cpp
  335. src/WallpaperEngine/Media/DBusMediaSource.h
  336. src/WallpaperEngine/Media/DBusMediaSource.cpp
  337. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.h
  338. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.cpp
  339. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.h
  340. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.cpp
  341. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.h
  342. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.cpp
  343. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.h
  344. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.cpp
  345. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.h
  346. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.cpp
  347. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.h
  348. src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.cpp
  349. src/WallpaperEngine/Render/Shaders/Shader.h
  350. src/WallpaperEngine/Render/Shaders/Shader.cpp
  351. src/WallpaperEngine/Render/Shaders/ShaderUnit.cpp
  352. src/WallpaperEngine/Render/Shaders/ShaderUnit.h
  353. src/WallpaperEngine/Render/Shaders/GLSLContext.cpp
  354. src/WallpaperEngine/Render/Shaders/GLSLContext.h
  355. src/WallpaperEngine/Render/Helpers/ContextAware.cpp
  356. src/WallpaperEngine/Render/Helpers/ContextAware.h
  357. src/WallpaperEngine/Render/Drivers/VideoFactories.cpp
  358. src/WallpaperEngine/Render/Drivers/VideoFactories.h
  359. src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.cpp
  360. src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.h
  361. src/WallpaperEngine/Render/Drivers/Output/Output.cpp
  362. src/WallpaperEngine/Render/Drivers/Output/Output.h
  363. src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.cpp
  364. src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.h
  365. src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.cpp
  366. src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.h
  367. src/WallpaperEngine/Render/Drivers/Output/OutputViewport.cpp
  368. src/WallpaperEngine/Render/Drivers/Output/OutputViewport.h
  369. src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.h
  370. src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.cpp
  371. src/WallpaperEngine/Render/Drivers/VideoDriver.h
  372. src/WallpaperEngine/Render/Drivers/VideoDriver.cpp
  373. src/WallpaperEngine/Render/RenderContext.h
  374. src/WallpaperEngine/Render/RenderContext.cpp
  375. src/WallpaperEngine/Render/TextureCache.h
  376. src/WallpaperEngine/Render/TextureCache.cpp
  377. src/WallpaperEngine/Render/FBOProvider.cpp
  378. src/WallpaperEngine/Render/FBOProvider.h
  379. src/WallpaperEngine/Render/Helpers/ContextAware.cpp
  380. src/WallpaperEngine/Render/Helpers/ContextAware.h
  381. src/WallpaperEngine/Render/CWallpaper.h
  382. src/WallpaperEngine/Render/CWallpaper.cpp
  383. src/WallpaperEngine/Render/WallpaperState.h
  384. src/WallpaperEngine/Render/WallpaperState.cpp
  385. src/WallpaperEngine/Render/Wallpapers/CScene.h
  386. src/WallpaperEngine/Render/Wallpapers/CScene.cpp
  387. src/WallpaperEngine/Render/Wallpapers/CVideo.h
  388. src/WallpaperEngine/Render/Wallpapers/CVideo.cpp
  389. src/WallpaperEngine/Render/Wallpapers/CWeb.h
  390. src/WallpaperEngine/Render/Wallpapers/CWeb.cpp
  391. src/WallpaperEngine/Render/Camera.h
  392. src/WallpaperEngine/Render/Camera.cpp
  393. src/WallpaperEngine/Render/CObject.h
  394. src/WallpaperEngine/Render/CObject.cpp
  395. src/WallpaperEngine/Render/CTexture.cpp
  396. src/WallpaperEngine/Render/CTexture.h
  397. src/WallpaperEngine/Render/AlbumTexture.h
  398. src/WallpaperEngine/Render/AlbumTexture.cpp
  399. src/WallpaperEngine/Render/TextureProvider.h
  400. src/WallpaperEngine/Render/Objects/CRenderable.cpp
  401. src/WallpaperEngine/Render/Objects/CRenderable.h
  402. src/WallpaperEngine/Render/Objects/CImage.h
  403. src/WallpaperEngine/Render/Objects/CImage.cpp
  404. src/WallpaperEngine/Render/Objects/CSound.h
  405. src/WallpaperEngine/Render/Objects/CSound.cpp
  406. src/WallpaperEngine/Render/Objects/CParticle.h
  407. src/WallpaperEngine/Render/Objects/CParticle.cpp
  408. src/WallpaperEngine/Render/Objects/CText.h
  409. src/WallpaperEngine/Render/Objects/CText.cpp
  410. src/WallpaperEngine/Render/CFBO.h
  411. src/WallpaperEngine/Render/CFBO.cpp
  412. src/WallpaperEngine/Render/Objects/Effects/CPass.h
  413. src/WallpaperEngine/Render/Objects/Effects/CPass.cpp
  414. src/WallpaperEngine/WebBrowser/CEF/RenderHandler.cpp
  415. src/WallpaperEngine/WebBrowser/CEF/RenderHandler.h
  416. src/WallpaperEngine/WebBrowser/CEF/BrowserClient.cpp
  417. src/WallpaperEngine/WebBrowser/CEF/BrowserClient.h
  418. src/WallpaperEngine/WebBrowser/CEF/BrowserApp.cpp
  419. src/WallpaperEngine/WebBrowser/CEF/BrowserApp.h
  420. src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp
  421. src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.h
  422. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.cpp
  423. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.h
  424. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.cpp
  425. src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.h
  426. src/WallpaperEngine/WebBrowser/WebBrowserContext.cpp
  427. src/WallpaperEngine/WebBrowser/WebBrowserContext.h
  428. src/WallpaperEngine/Data/Assets/Types.h
  429. src/WallpaperEngine/Data/Assets/Texture.h
  430. src/WallpaperEngine/Data/Assets/Package.h
  431. src/WallpaperEngine/Data/Model/Types.h
  432. src/WallpaperEngine/Data/Model/Project.h
  433. src/WallpaperEngine/Data/Model/Wallpaper.h
  434. src/WallpaperEngine/Data/Model/Object.h
  435. src/WallpaperEngine/Data/Model/Material.h
  436. src/WallpaperEngine/Data/Model/Effect.h
  437. src/WallpaperEngine/Data/Model/Model.h
  438. src/WallpaperEngine/Data/Model/UserSetting.h
  439. src/WallpaperEngine/Data/Model/DynamicValue.h
  440. src/WallpaperEngine/Data/Model/DynamicValue.cpp
  441. src/WallpaperEngine/Data/Model/Property.h
  442. src/WallpaperEngine/Data/Utils/TypeCaster.h
  443. src/WallpaperEngine/Data/Utils/BinaryReader.cpp
  444. src/WallpaperEngine/Data/Utils/BinaryReader.h
  445. src/WallpaperEngine/Data/Utils/MemoryStream.h
  446. src/WallpaperEngine/Data/Utils/SFINAE.h
  447. src/WallpaperEngine/Data/Parsers/DynamicValueParser.h
  448. src/WallpaperEngine/Data/Parsers/DynamicValueParser.cpp
  449. src/WallpaperEngine/Data/Parsers/EffectParser.cpp
  450. src/WallpaperEngine/Data/Parsers/EffectParser.h
  451. src/WallpaperEngine/Data/Parsers/ProjectParser.cpp
  452. src/WallpaperEngine/Data/Parsers/ProjectParser.h
  453. src/WallpaperEngine/Data/Parsers/WallpaperParser.cpp
  454. src/WallpaperEngine/Data/Parsers/WallpaperParser.h
  455. src/WallpaperEngine/Data/Parsers/UserSettingParser.cpp
  456. src/WallpaperEngine/Data/Parsers/UserSettingParser.h
  457. src/WallpaperEngine/Data/Parsers/ObjectParser.cpp
  458. src/WallpaperEngine/Data/Parsers/ObjectParser.h
  459. src/WallpaperEngine/Data/Parsers/MaterialParser.cpp
  460. src/WallpaperEngine/Data/Parsers/MaterialParser.h
  461. src/WallpaperEngine/Data/Parsers/ModelParser.cpp
  462. src/WallpaperEngine/Data/Parsers/ModelParser.h
  463. src/WallpaperEngine/Data/Parsers/ShaderConstantParser.cpp
  464. src/WallpaperEngine/Data/Parsers/ShaderConstantParser.h
  465. src/WallpaperEngine/Data/Parsers/PackageParser.cpp
  466. src/WallpaperEngine/Data/Parsers/PackageParser.h
  467. src/WallpaperEngine/Data/Parsers/PropertyParser.cpp
  468. src/WallpaperEngine/Data/Parsers/PropertyParser.h
  469. src/WallpaperEngine/Data/Parsers/TextureParser.cpp
  470. src/WallpaperEngine/Data/Parsers/TextureParser.h
  471. src/WallpaperEngine/Data/Builders/ColorBuilder.h
  472. src/WallpaperEngine/Data/Builders/ColorBuilder.cpp
  473. src/WallpaperEngine/Data/Builders/UserSettingBuilder.h
  474. src/WallpaperEngine/Data/Builders/VectorBuilder.cpp
  475. src/WallpaperEngine/Data/Builders/VectorBuilder.h
  476. src/WallpaperEngine/Data/Dumpers/StringPrinter.cpp
  477. src/WallpaperEngine/Data/Dumpers/StringPrinter.h
  478. src/WallpaperEngine/Data/JSON.cpp
  479. src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.cpp
  480. src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.h
  481. src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.cpp
  482. src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.h
  483. src/WallpaperEngine/Scripting/Adapters/ObjectAdapter.h
  484. src/WallpaperEngine/Scripting/Adapters/ObjectAdapter.cpp
  485. src/WallpaperEngine/Scripting/Adapters/VectorAdapter.h
  486. src/WallpaperEngine/Scripting/Adapters/VectorAdapter.cpp
  487. src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.h
  488. src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.cpp
  489. src/WallpaperEngine/Scripting/Modules/ColorModule.h
  490. src/WallpaperEngine/Scripting/Modules/ColorModule.cpp
  491. src/WallpaperEngine/Scripting/Modules/MathModule.h
  492. src/WallpaperEngine/Scripting/Modules/MathModule.cpp
  493. src/WallpaperEngine/Scripting/Modules/ScriptModule.h
  494. src/WallpaperEngine/Scripting/Modules/ScriptModule.cpp
  495. src/WallpaperEngine/Scripting/ConsoleObject.h
  496. src/WallpaperEngine/Scripting/ConsoleObject.cpp
  497. src/WallpaperEngine/Scripting/EngineObject.h
  498. src/WallpaperEngine/Scripting/EngineObject.cpp
  499. src/WallpaperEngine/Scripting/InputObject.h
  500. src/WallpaperEngine/Scripting/InputObject.cpp
  501. src/WallpaperEngine/Scripting/SceneObject.h
  502. src/WallpaperEngine/Scripting/SceneObject.cpp
  503. src/WallpaperEngine/Scripting/ScriptEngine.h
  504. src/WallpaperEngine/Scripting/ScriptPropertiesObject.h
  505. src/WallpaperEngine/Scripting/ScriptPropertiesObject.cpp
  506. src/WallpaperEngine/Scripting/ScriptEngine.cpp
  507. src/WallpaperEngine/Scripting/ScriptableObject.h
  508. src/WallpaperEngine/Scripting/ScriptableObject.cpp
  509. src/WallpaperEngine/Maths.h
  510. src/WallpaperEngine/Maths.cpp)
  511. if(BUILD_TESTING)
  512. add_executable(
  513. tests
  514. ${COMMON_SOURCES}
  515. src/WallpaperEngine/Testing/Cases/Example.cpp
  516. src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.cpp
  517. src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.h
  518. src/WallpaperEngine/Testing/Input/TestingMouseInput.cpp
  519. src/WallpaperEngine/Testing/Input/TestingMouseInput.h
  520. src/WallpaperEngine/Testing/Harnesses/RenderHarness.cpp
  521. src/WallpaperEngine/Testing/Harnesses/RenderHarness.h
  522. src/WallpaperEngine/Testing/Cases/MouseCoordinates.cpp
  523. src/WallpaperEngine/Testing/Cases/PropertyParser.cpp
  524. src/WallpaperEngine/Testing/Cases/ScalingModes.cpp
  525. src/WallpaperEngine/Testing/Cases/CornerColor.cpp)
  526. endif()
  527. add_library(
  528. linux-wallpaperengine-lib SHARED
  529. ${COMMON_SOURCES}
  530. ${WAYLAND_SOURCES}
  531. ${X11_SOURCES}
  532. ${DEMOMODE_SOURCES})
  533. target_link_libraries (linux-wallpaperengine-lib PUBLIC
  534. ${OPENGL_LIBRARIES}
  535. GLEW::GLEW
  536. ${GLUT_LIBRARIES}
  537. ${ZLIB_LIBRARIES}
  538. ${LZ4_LIBRARY}
  539. ${SDL2_LIBRARIES}
  540. ${FFMPEG_LIBRARIES}
  541. ${MPV_LIBRARY}
  542. ${PULSEAUDIO_LIBRARY}
  543. Freetype::Freetype
  544. ${WAYLAND_LIBRARIES}
  545. ${X11_LIBRARIES}
  546. ${DBUS_LIBRARIES}
  547. kissfft
  548. glslang
  549. spirv-cross-core
  550. spirv-cross-glsl
  551. glfw
  552. libcef_lib
  553. libcef_dll_wrapper
  554. argparse
  555. qjs)
  556. if (BUILD_TESTING)
  557. target_link_libraries (tests PRIVATE
  558. Catch2::Catch2WithMain
  559. ${OPENGL_LIBRARIES}
  560. GLEW::GLEW
  561. ${GLUT_LIBRARIES}
  562. ${ZLIB_LIBRARIES}
  563. ${LZ4_LIBRARY}
  564. ${SDL2_LIBRARIES}
  565. ${FFMPEG_LIBRARIES}
  566. ${MPV_LIBRARY}
  567. ${PULSEAUDIO_LIBRARY}
  568. Freetype::Freetype
  569. ${WAYLAND_LIBRARIES}
  570. ${X11_LIBRARIES}
  571. ${DBUS_LIBRARIES}
  572. kissfft
  573. glslang
  574. spirv-cross-core
  575. spirv-cross-glsl
  576. glfw
  577. libcef_lib
  578. libcef_dll_wrapper
  579. argparse
  580. qjs)
  581. endif()
  582. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ERRORONLY=${ERRORONLY})
  583. target_compile_definitions(linux-wallpaperengine-lib PUBLIC DEMOMODE=${DEMOMODE})
  584. if (BUILD_TESTING)
  585. # tests should give as much output as possible
  586. target_compile_definitions(tests PRIVATE ERRORONLY=0)
  587. target_compile_definitions(tests PRIVATE DEMOMODE=0)
  588. endif()
  589. if(X11_SUPPORT_FOUND)
  590. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_X11)
  591. # make sure some of the X11 functions we'll use are available
  592. check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
  593. if(HAVE_XSETIOERROREXITHANDLER)
  594. target_compile_definitions(linux-wallpaperengine-lib PUBLIC HAVE_XSETIOERROREXITHANDLER=1)
  595. endif()
  596. endif()
  597. if(WAYLAND_SUPPORT_FOUND)
  598. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_WAYLAND)
  599. endif()
  600. if(WAYLAND_SUPPORT_FOUND AND ENABLE_KDE_EXPERIMENTAL_FEATURES)
  601. target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_KDE_EXPERIMENTAL_FEATURES)
  602. endif()
  603. if(WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
  604. target_compile_definitions(linux-wallpaperengine-lib PUBLIC GLEW_EGL)
  605. endif()
  606. target_include_directories(linux-wallpaperengine-lib PUBLIC
  607. src
  608. src/External/glslang-WallpaperEngine
  609. src/External/SPIRV-Cross-WallpaperEngine
  610. src/External/MimeTypes
  611. src/External/json/include
  612. src/External/stb
  613. src/External/kissfft
  614. ${MPV_INCLUDE_DIR}
  615. ${GLEW_INCLUDE_DIR}
  616. ${LZ4_INCLUDE_DIR}
  617. ${SDL2_INCLUDE_DIRS}
  618. ${FFMPEG_INCLUDE_DIR}
  619. ${PULSEAUDIO_INCLUDE_DIR}
  620. ${CEF_INCLUDE_PATH}
  621. ${CMAKE_SOURCE_DIR}
  622. ${X11_INCLUDES}
  623. ${WAYLAND_OUTPUT_DIR})
  624. COPY_FILES(linux-wallpaperengine-lib "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
  625. COPY_FILES(linux-wallpaperengine-lib "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
  626. # remove the vulkan lib as chromium includes a broken libvulkan.so.1 with it
  627. file(REMOVE "${CEF_BINARY_DIR}/libvulkan.so.1")
  628. set_target_properties(linux-wallpaperengine-lib PROPERTIES
  629. LIBRARY_OUTPUT_DIRECTORY ${TARGET_OUTPUT_DIRECTORY})
  630. add_dependencies(linux-wallpaperengine-lib libcef_dll_wrapper glslang spirv-cross-core spirv-cross-glsl)
  631. # custom version of cef's SET_EXECUTABLE_TARGET_PROPERTIES that fixes C files being compiled with the wrong parameters
  632. REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine-lib)
  633. add_executable(linux-wallpaperengine
  634. src/main.cpp)
  635. target_link_libraries (linux-wallpaperengine PUBLIC linux-wallpaperengine-lib)
  636. # Install the main executable and shared library via install(TARGETS)
  637. # so that CMake automatically strips/replaces the build-time RPATH.
  638. install(TARGETS linux-wallpaperengine
  639. RUNTIME DESTINATION .
  640. )
  641. install(TARGETS linux-wallpaperengine-lib
  642. LIBRARY DESTINATION .
  643. )
  644. # Install everything else from the output directory (CEF resources, helper binaries, etc.)
  645. # but exclude the files already handled by install(TARGETS) above.
  646. install(DIRECTORY ${TARGET_OUTPUT_DIRECTORY}/ DESTINATION .
  647. PATTERN "linux-wallpaperengine" EXCLUDE
  648. PATTERN "liblinux-wallpaperengine-lib.so" EXCLUDE
  649. )