| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158 |
- cmake_minimum_required(VERSION 3.12)
- project(linux-wallpaperengine)
- # prevent installing to /usr by default so we don't bork anything
- if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}" CACHE PATH "..." FORCE)
- endif()
- set_property(GLOBAL PROPERTY OS_FOLDERS ON)
- set(CMAKE_CXX_STANDARD 20)
- set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
- set(OpenGL_GL_PREFERENCE "LEGACY")
- set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
- if(NOT DEMOMODE)
- set(DEMOMODE 0)
- endif()
- if(NOT ERRORONLY)
- set(ERRORONLY 0)
- endif()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
- option(LWE_LTO "Link time optimization for the engine and its bundled libraries (long link, needs a lot of memory)" OFF)
- option(LWE_LINK_TRIM "Put functions and data in their own sections and let the linker drop what is unused" OFF)
- if(LWE_LTO)
- include(CheckIPOSupported)
- check_ipo_supported(RESULT lwe_ipo_ok OUTPUT lwe_ipo_log LANGUAGES C CXX)
- if(NOT lwe_ipo_ok)
- message(FATAL_ERROR "LWE_LTO is not supported by this toolchain: ${lwe_ipo_log}")
- endif()
- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
- endif()
- if(LWE_LINK_TRIM)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
- endif()
- set(LWE_SANITIZE "" CACHE STRING "Build with sanitizers: address, address;undefined or thread (tools/runtime_analysis.py)")
- if(LWE_SANITIZE)
- string(REPLACE ";" "," lwe_sanitize_list "${LWE_SANITIZE}")
- set(lwe_sanitize_flags "-fsanitize=${lwe_sanitize_list} -fno-omit-frame-pointer -g1")
- if(lwe_sanitize_list MATCHES "undefined|thread")
- set(lwe_sanitize_flags "${lwe_sanitize_flags} -fno-sanitize=vptr")
- endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${lwe_sanitize_flags}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${lwe_sanitize_flags} -Wno-error=maybe-uninitialized -Wno-error=tsan")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${lwe_sanitize_list}")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${lwe_sanitize_list}")
- endif()
- option(LWE_TRACY "Build with Tracy profiler zones on the render loop (off by default, connect tracy-profiler or tracy-capture)" OFF)
- option(LWE_TRACY_ON_DEMAND "Tracy only records once a profiler is connected (off: startup and loading are recorded too, which tools/tracy_profile.sh needs for the loader zones)" ON)
- set(LWE_TRACY_DIR "" CACHE PATH "A Tracy 0.14.1 source tree to use instead of downloading it")
- if(LWE_TRACY)
- if(NOT LWE_TRACY_DIR)
- include(FetchContent)
- FetchContent_Declare(tracy
- URL https://github.com/wolfpld/tracy/archive/refs/tags/v0.14.1.tar.gz
- URL_HASH SHA256=bf4af567e9c7524d07f3caa745fad02fb33bd5694f11910750382d1efbb251c1)
- FetchContent_Populate(tracy)
- set(LWE_TRACY_DIR ${tracy_SOURCE_DIR})
- endif()
- # TracyClient.cpp alone is the whole client, the library it ends up in is a shared one so it needs PIC
- add_library(tracy-client STATIC ${LWE_TRACY_DIR}/public/TracyClient.cpp)
- target_include_directories(tracy-client SYSTEM PUBLIC ${LWE_TRACY_DIR}/public)
- target_compile_definitions(tracy-client PUBLIC LWE_TRACY TRACY_ENABLE)
- if(LWE_TRACY_ON_DEMAND)
- target_compile_definitions(tracy-client PUBLIC TRACY_ON_DEMAND)
- endif()
- set_target_properties(tracy-client PROPERTIES POSITION_INDEPENDENT_CODE ON)
- target_link_libraries(tracy-client PUBLIC ${CMAKE_DL_LIBS} pthread)
- endif()
- find_package(X11)
- find_package(OpenGL REQUIRED)
- find_package(GLEW REQUIRED)
- find_package(DBus REQUIRED)
- find_package(GLUT REQUIRED)
- find_package(ZLIB REQUIRED)
- find_package(SDL2 REQUIRED)
- find_package(MPV REQUIRED)
- find_package(LZ4 REQUIRED)
- find_package(FFMPEG REQUIRED)
- find_package(PulseAudio REQUIRED)
- find_package(Freetype REQUIRED)
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(HARFBUZZ REQUIRED IMPORTED_TARGET harfbuzz)
- # scene scripts run on V8 from the system's Node.js library, like WE's scenescript64.dll
- find_package(V8 10.2 REQUIRED)
- set(ENABLE_OPT OFF)
- set(SPIRV_CROSS_FORCE_PIC ON)
- set(CMAKE_POSITION_INDEPENDENT_CODE ON)
- set(KISSFFT_TEST OFF)
- set(KISSFFT_TOOLS OFF)
- set(CEF_VERSION "156.0.14+g4fa4ab5+chromium-156.0.8078.48")
- # SHA256 of the archives for that version, a CEF_SHA256_<platform> per distribution that is pinned (bump with CEF_VERSION)
- set(CEF_SHA256_linux64_minimal "4191ac920a91a052eba04afb6ed830d47aed46a3e246c434a2f062c23588dc8a")
- if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- set(default_cef_dist "standard")
- else()
- set(default_cef_dist "minimal")
- endif()
- set(CEF_DISTRIBUTION_TYPE "${default_cef_dist}" CACHE STRING "CEF distribution variant")
- set_property(CACHE CEF_DISTRIBUTION_TYPE PROPERTY STRINGS "minimal" "standard")
- if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- if("${PROJECT_ARCH}" STREQUAL "arm64")
- set(CEF_PLATFORM "macosarm64")
- set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
- elseif("${PROJECT_ARCH}" STREQUAL "x86_64")
- set(CEF_PLATFORM "macosx64")
- set(CEF_ARCH_DETECTION "${PROJECT_ARCH}")
- elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
- set(PROJECT_ARCH "arm64")
- set(CEF_PLATFORM "macosarm64")
- set(CEF_ARCH_DETECTION "${CMAKE_HOST_SYSTEM_PROCESSOR}")
- else()
- set(PROJECT_ARCH "x86_64")
- set(CEF_PLATFORM "macosx64")
- set(CEF_ARCH_DETECTION "Default for Darwin")
- endif()
- elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
- set(CEF_PLATFORM "linuxarm")
- set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
- elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
- set(PROJECT_ARCH "arm64")
- set(CEF_PLATFORM "linuxarm64")
- set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
- elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
- set(PROJECT_ARCH "arm64")
- set(CEF_PLATFORM "linuxarm64")
- set(CEF_ARCH_DETECTION "${CMAKE_SYSTEM_PROCESSOR}")
- elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
- set(CEF_PLATFORM "linux64")
- set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P} (${CMAKE_SYSTEM_PROCESSOR})")
- else()
- message(FATAL_ERROR "Linux x86 32-bit builds are discontinued.")
- endif()
- elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
- if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64")
- set(CEF_PLATFORM "windowsarm64")
- set(CEF_ARCH_DETECTION "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
- elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
- set(CEF_PLATFORM "windows64")
- set(CEF_ARCH_DETECTION "Based on void size ${CMAKE_SIZEOF_VOID_P}")
- else()
- set(CEF_PLATFORM "windows32")
- set(CEF_ARCH_DETECTION "Default for Windows")
- endif()
- endif()
- if(CEF_DISTRIBUTION_TYPE AND NOT CEF_DISTRIBUTION_TYPE STREQUAL "standard")
- set(CEF_PLATFORM "${CEF_PLATFORM}_${CEF_DISTRIBUTION_TYPE}")
- endif()
- message(STATUS "Using CEF for ${CMAKE_SYSTEM_NAME} - ${CEF_PLATFORM} (${CEF_ARCH_DETECTION})")
- include(DownloadCEF)
- DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_CURRENT_BINARY_DIR}/cef")
- list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
- find_package(CEF REQUIRED)
- list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-exceptions)
- list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-rtti)
- list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -std=c++17)
- # function-local statics (the shaders' regexes, memos, singletons) are first used from worker threads
- list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-threadsafe-statics)
- list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility=hidden)
- list(REMOVE_ITEM CEF_COMPILER_FLAGS -fvisibility-inlines-hidden)
- # CEF's release flags set _FORTIFY_SOURCE=2 with a -U in front; CMake drops that repeated -U when our own target options
- # carry one, which leaves two -D with different values and -Werror turns the redefinition into an error
- list(REMOVE_ITEM CEF_COMPILER_FLAGS_RELEASE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)
- list(APPEND CEF_CXX_COMPILER_FLAGS -std=c++20)
- list(APPEND CEF_EXE_LINKER_FLAGS -rdynamic)
- # remove the vulkan library from the files to copy so it doesn't fail after removing it
- list(REMOVE_ITEM CEF_BINARY_FILES libvulkan.so.1)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
- set(TARGET_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
- # build dirs as RPATH during development, \$ORIGIN once installed (escaped for CMake); must come before any add_executable()
- set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
- set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib;\$ORIGIN/lib64")
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
- add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
- add_subdirectory(src/External/glslang-WallpaperEngine glslang)
- # SPIRV-Cross and kissfft want CMake < 3.13, the options set above only stick with CMP0077 NEW
- set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
- # EXCLUDE_FROM_ALL keeps their install rules (headers, cmake and pkg-config files, SPIRV-Cross' libraries and CLI) out of
- # the prefix, the targets we link still get built
- add_subdirectory(src/External/SPIRV-Cross-WallpaperEngine spirv-cross EXCLUDE_FROM_ALL)
- add_subdirectory(src/External/kissfft kissfft EXCLUDE_FROM_ALL)
- unset(CMAKE_POLICY_DEFAULT_CMP0077)
- # only msdfgen's core is needed, its own CMake project pulls in vcpkg/skia/tinyxml
- file(GLOB MSDFGEN_CORE_SOURCES src/External/msdfgen/core/*.cpp)
- add_library(msdfgen-core STATIC ${MSDFGEN_CORE_SOURCES})
- target_include_directories(msdfgen-core PUBLIC src/External/msdfgen)
- # an empty export macro makes base.h skip the msdfgen-config.h its CMake project would generate
- target_compile_definitions(msdfgen-core PUBLIC "MSDFGEN_PUBLIC=")
- add_subdirectory(src/External/argparse argparse)
- if(BUILD_TESTING)
- add_subdirectory(src/External/Catch2)
- endif()
- pkg_check_modules(WAYLAND_SUPPORT wayland-cursor wayland-protocols egl wayland-egl)
- option(DISABLE_KDE_FEATURES "Build without the KDE Plasma integration (plasma-shell surfaces, KWin fullscreen detection and cursor tracking)" OFF)
- if(WAYLAND_SUPPORT_FOUND)
- find_program(WaylandScanner NAMES wayland-scanner)
- message(STATUS "Found WaylandScanner at ${WaylandScanner}")
- execute_process(
- COMMAND pkg-config --variable=pkgdatadir wayland-protocols
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")
- set(WAYLAND_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/wayland)
- file(MAKE_DIRECTORY ${WAYLAND_OUTPUT_DIR})
- message(STATUS "Building protocols...")
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
- 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)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
- 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)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
- 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)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
- 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)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/color-management-v1.xml ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/color-management-v1.xml ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/fractional-scale-v1.xml ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/fractional-scale-v1.xml ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/ext-idle-notify-v1.xml ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/ext-idle-notify-v1.xml ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.h
- COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/viewporter/viewporter.xml ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.c
- COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/viewporter/viewporter.xml ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
- COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
- COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h
- COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
- COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c)
- # COSMIC's window state: cosmic-comp has no wlr foreign toplevel, it speaks ext-foreign-toplevel-list plus its own
- # toplevel info extension (which refers to the workspace interfaces)
- set(COSMIC_PROTOCOL_SOURCES)
- foreach(proto cosmic-toplevel-info-unstable-v1 cosmic-workspace-unstable-v1 ext-foreign-toplevel-list-v1 ext-workspace-v1
- ext-image-capture-source-v1 ext-image-copy-capture-v1)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/${proto}.xml ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/${proto}.xml ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.c)
- list(APPEND COSMIC_PROTOCOL_SOURCES ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.c ${WAYLAND_OUTPUT_DIR}/${proto}-protocol.h)
- endforeach()
- include_directories(${WAYLAND_SUPPORT_INCLUDE_DIRS})
- include_directories(${WAYLAND_OUTPUT_DIR})
- set(WAYLAND_LIBRARIES
- pthread
- wayland-cursor
- wayland-client
- wayland-egl
- ${OPENGL_egl_LIBRARY})
- set(WAYLAND_SOURCES
- src/WallpaperEngine/Render/Drivers/HeadlessOpenGLDriver.h
- src/WallpaperEngine/Render/Drivers/HeadlessOpenGLDriver.cpp
- src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.h
- src/WallpaperEngine/Render/Drivers/WaylandOpenGLDriver.cpp
- src/WallpaperEngine/Desktop/HostWayland.h
- src/WallpaperEngine/Desktop/HostWayland.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/WaylandFullScreenDetector.h
- src/WallpaperEngine/Render/Drivers/Detectors/GnomeFullScreenDetector.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/GnomeFullScreenDetector.h
- src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.cpp
- src/WallpaperEngine/Render/Drivers/Output/WaylandOutput.h
- src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.cpp
- src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.h
- src/WallpaperEngine/Input/Drivers/WaylandMouseInput.cpp
- src/WallpaperEngine/Input/Drivers/WaylandMouseInput.h
- ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.c
- ${WAYLAND_OUTPUT_DIR}/xdg-shell-protocol.h
- ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
- ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/wlr-layer-shell-unstable-v1-protocol.h
- ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/xdg-output-unstable-v1-protocol.h
- ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/color-management-v1-protocol.h
- ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/fractional-scale-v1-protocol.h
- ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.c
- ${WAYLAND_OUTPUT_DIR}/viewporter-protocol.h
- ${COSMIC_PROTOCOL_SOURCES}
- ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.c
- ${WAYLAND_OUTPUT_DIR}/ext-idle-notify-v1-protocol.h)
- if(NOT DISABLE_KDE_FEATURES)
- pkg_check_modules(DBUS dbus-1)
- if(NOT DBUS_FOUND)
- 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")
- endif()
- set(KDE_FEATURES_ENABLED TRUE)
- message(STATUS "KDE integration enabled")
- include_directories(${DBUS_INCLUDE_DIRS})
- list(APPEND WAYLAND_LIBRARIES ${DBUS_LIBRARIES})
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-shell.xml ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.h
- COMMAND ${WaylandScanner} client-header ${CMAKE_CURRENT_SOURCE_DIR}/protocols/kwin-dpms.xml ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.h)
- add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.c
- COMMAND ${WaylandScanner} private-code ${CMAKE_CURRENT_SOURCE_DIR}/protocols/kwin-dpms.xml ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.c)
- list(APPEND WAYLAND_SOURCES
- ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.c
- ${WAYLAND_OUTPUT_DIR}/kwin-dpms-protocol.h
- src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/KDEWaylandFullScreenDetector.h
- src/WallpaperEngine/Input/Drivers/KDECursorInput.cpp
- src/WallpaperEngine/Input/Drivers/KDECursorInput.h
- src/WallpaperEngine/Desktop/KDESession.cpp
- src/WallpaperEngine/Desktop/KDESession.h
- ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.c
- ${WAYLAND_OUTPUT_DIR}/plasma-shell-protocol.h)
- endif()
- endif()
- if(X11_FOUND)
- if(NOT X11_Xrandr_FOUND)
- message(WARNING "X11 support disabled. Xrandr package is missing")
- set(X11_SUPPORT_FOUND FALSE)
- elseif(NOT X11_xf86vmode_FOUND)
- message(WARNING "X11 support disabled. Xxf86vm package is missing")
- set(X11_SUPPORT_FOUND FALSE)
- else()
- message("X11 support enabled")
- set(X11_SUPPORT_FOUND TRUE)
- endif()
- endif()
- if(X11_SUPPORT_FOUND)
- include_directories(${X11_INCLUDE_DIR} ${XRANDR_INCLUDE_DIR})
- set(X11_LIBRARIES
- ${X11_LIBRARIES}
- ${X11_Xrandr_LIB}
- ${X11_Xext_LIB})
- if(X11_Xcomposite_FOUND AND X11_Xdamage_FOUND)
- set(X11_ICONS_SOURCES
- src/WallpaperEngine/Render/Drivers/Output/X11DesktopIcons.cpp
- src/WallpaperEngine/Render/Drivers/Output/X11DesktopIcons.h)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB})
- add_compile_definitions(HAVE_X11_DESKTOP_ICONS)
- else()
- message(WARNING "Xcomposite or Xdamage is missing, desktop icons stay under the wallpaper on XFCE")
- endif()
- set(X11_SOURCES
- ${X11_ICONS_SOURCES}
- src/WallpaperEngine/Render/Drivers/Output/X11Output.cpp
- src/WallpaperEngine/Render/Drivers/Output/X11Output.h
- src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/X11FullScreenDetector.h)
- SET(X11_INCLUDES
- ${X11_INCLUDE_DIR}
- ${XRANDR_INCLUDE_DIR})
- set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
- endif()
- if(DEMOMODE)
- set(DEMOMODE_SOURCES
- src/recording.cpp
- src/recording.h)
- 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")
- endif()
- if(NOT WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
- message(WARNING "No window server detected at build time. You will only be able to preview backgrounds")
- endif()
- add_library(ceflib SHARED IMPORTED)
- set_target_properties(ceflib
- PROPERTIES IMPORTED_LOCATION ${TARGET_OUTPUT_DIRECTORY}/libcef.so)
- ADD_LOGICAL_TARGET(libcef_lib "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}")
- PRINT_CEF_CONFIG()
- set(WPENGINE_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
- set(WPENGINE_BUILTINS_JS "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/builtins.js")
- file(READ "${WPENGINE_BUILTINS_JS}" WPENGINE_SCRIPT_BUILTINS)
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/Builtins.generated.h.in"
- "${WPENGINE_GENERATED_DIR}/WallpaperEngine/Scripting/Builtins.generated.h"
- @ONLY)
- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${WPENGINE_BUILTINS_JS}")
- set(WPENGINE_DEFAULT_HRTF "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Audio/resources/default_hrtf.mhr")
- file(READ "${WPENGINE_DEFAULT_HRTF}" WPENGINE_DEFAULT_HRTF_HEX HEX)
- string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," WPENGINE_DEFAULT_HRTF_BYTES "${WPENGINE_DEFAULT_HRTF_HEX}")
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Audio/resources/DefaultHrtf.generated.h.in"
- "${WPENGINE_GENERATED_DIR}/WallpaperEngine/Audio/DefaultHrtf.generated.h"
- @ONLY)
- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${WPENGINE_DEFAULT_HRTF}")
- include_directories(
- ${WPENGINE_GENERATED_DIR}
- src
- src/External/glslang-WallpaperEngine
- src/External/SPIRV-Cross-WallpaperEngine
- src/External/MimeTypes
- src/External/nanosvg
- src/External/json/include
- src/External/stb
- src/External/kissfft
- ${MPV_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
- ${LZ4_INCLUDE_DIR}
- ${SDL2_INCLUDE_DIRS}
- ${FFMPEG_INCLUDE_DIR}
- ${PULSEAUDIO_INCLUDE_DIR}
- ${CEF_INCLUDE_PATH}
- ${CMAKE_SOURCE_DIR}
- ${X11_INCLUDES}
- ${DBUS_INCLUDE_DIRS})
- set(COMMON_SOURCES
- src/External/MimeTypes/MimeTypes.cpp
- src/External/MimeTypes/MimeTypes.h
- src/Steam/FileSystem/FileSystem.cpp
- src/Steam/FileSystem/FileSystem.h
- src/WallpaperEngine/Logging/Log.cpp
- src/WallpaperEngine/Logging/Log.h
- src/WallpaperEngine/Debugging/CallStack.cpp
- src/WallpaperEngine/Debugging/CallStack.h
- src/WallpaperEngine/Application/ApplicationContext.cpp
- src/WallpaperEngine/Application/ApplicationContext.h
- src/WallpaperEngine/Application/WallpaperApplication.cpp
- src/WallpaperEngine/Application/WallpaperApplication.h
- src/WallpaperEngine/Application/PlaylistSchedule.cpp
- src/WallpaperEngine/Application/PlaylistSchedule.h
- src/WallpaperEngine/Assets/AssetLoadException.cpp
- src/WallpaperEngine/Assets/AssetLoadException.h
- src/WallpaperEngine/Assets/AssetLocator.cpp
- src/WallpaperEngine/Assets/AssetLocator.h
- src/WallpaperEngine/FileSystem/Container.h
- src/WallpaperEngine/FileSystem/StateDirectory.h
- src/WallpaperEngine/FileSystem/Container.cpp
- src/WallpaperEngine/FileSystem/Adapters/Types.h
- src/WallpaperEngine/FileSystem/Adapters/Directory.cpp
- src/WallpaperEngine/FileSystem/Adapters/Directory.h
- src/WallpaperEngine/FileSystem/Adapters/Package.cpp
- src/WallpaperEngine/FileSystem/Adapters/Package.h
- src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp
- src/WallpaperEngine/FileSystem/Adapters/Virtual.h
- src/WallpaperEngine/FileSystem/Adapters/MediaCover.h
- src/WallpaperEngine/FileSystem/Adapters/MediaCover.cpp
- src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.cpp
- src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.h
- src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.cpp
- src/WallpaperEngine/Desktop/IconTheme.cpp
- src/WallpaperEngine/Desktop/IconTheme.h
- src/WallpaperEngine/Desktop/UserShortcut.cpp
- src/WallpaperEngine/Desktop/UserShortcut.h
- src/WallpaperEngine/Audio/SpectrumAnalyzer.cpp
- src/WallpaperEngine/Audio/SpectrumAnalyzer.h
- src/WallpaperEngine/Audio/SpectrumProcessor.cpp
- src/WallpaperEngine/Audio/SpectrumProcessor.h
- src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.h
- src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.cpp
- src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.h
- src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.cpp
- src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.h
- src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.cpp
- src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.h
- src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.cpp
- src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.h
- src/WallpaperEngine/Audio/Drivers/AudioDriver.cpp
- src/WallpaperEngine/Audio/Drivers/AudioDriver.h
- src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp
- src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h
- src/WallpaperEngine/Audio/AudioContext.cpp
- src/WallpaperEngine/Audio/AudioInput.h
- src/WallpaperEngine/Audio/AudioContext.h
- src/WallpaperEngine/Audio/AudioStream.cpp
- src/WallpaperEngine/Audio/AudioStream.h
- src/WallpaperEngine/Audio/Hrtf.cpp
- src/WallpaperEngine/Audio/Hrtf.h
- src/WallpaperEngine/Input/InputContext.cpp
- src/WallpaperEngine/Input/InputContext.h
- src/WallpaperEngine/Input/MouseInput.h
- src/WallpaperEngine/Input/ForwardedButton.h
- src/WallpaperEngine/Input/ForwardedButton.cpp
- src/WallpaperEngine/Input/Drivers/GLFWMouseInput.cpp
- src/WallpaperEngine/Input/Drivers/GLFWMouseInput.h
- src/WallpaperEngine/Media/CoverDownloader.h
- src/WallpaperEngine/Media/CoverDownloader.cpp
- src/WallpaperEngine/Media/CoverImage.h
- src/WallpaperEngine/Media/CoverImage.cpp
- src/WallpaperEngine/Media/MediaSource.h
- src/WallpaperEngine/Media/MediaSource.cpp
- src/WallpaperEngine/Media/DBusMediaSource.h
- src/WallpaperEngine/Media/DBusMediaSource.cpp
- src/WallpaperEngine/Desktop/GnomeShell.h
- src/WallpaperEngine/Desktop/GnomeShell.cpp
- src/WallpaperEngine/Desktop/PantheonShell.h
- src/WallpaperEngine/Desktop/PantheonShell.cpp
- src/WallpaperEngine/Desktop/WindowState.h
- src/WallpaperEngine/Desktop/WindowState.cpp
- src/WallpaperEngine/Desktop/KWinScript.h
- src/WallpaperEngine/Desktop/KWinScript.cpp
- src/WallpaperEngine/Desktop/SessionBus.h
- src/WallpaperEngine/Desktop/SessionBus.cpp
- src/WallpaperEngine/Desktop/SessionMonitor.h
- src/WallpaperEngine/Desktop/SessionMonitor.cpp
- src/WallpaperEngine/Desktop/PowerMonitor.h
- src/WallpaperEngine/Desktop/PowerMonitor.cpp
- src/WallpaperEngine/Desktop/HyprlandIPC.h
- src/WallpaperEngine/Desktop/HyprlandIPC.cpp
- src/WallpaperEngine/Media/ThumbnailPalette.h
- src/WallpaperEngine/Media/ThumbnailPalette.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariable.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableFloat.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableInteger.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector2.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector3.cpp
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.h
- src/WallpaperEngine/Render/Shaders/Variables/ShaderVariableVector4.cpp
- src/WallpaperEngine/Render/Shaders/Shader.h
- src/WallpaperEngine/Render/Shaders/Shader.cpp
- src/WallpaperEngine/Render/Shaders/ShaderUnit.cpp
- src/WallpaperEngine/Render/Shaders/ShaderUnit.h
- src/WallpaperEngine/Render/Shaders/GLSLContext.cpp
- src/WallpaperEngine/Render/Shaders/GLSLContext.h
- src/WallpaperEngine/Render/Shaders/ShaderCache.cpp
- src/WallpaperEngine/Render/Shaders/ShaderCache.h
- src/WallpaperEngine/Render/Helpers/ContextAware.cpp
- src/WallpaperEngine/Render/Helpers/ContextAware.h
- src/WallpaperEngine/Render/Drivers/VideoFactories.cpp
- src/WallpaperEngine/Render/Drivers/VideoFactories.h
- src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.cpp
- src/WallpaperEngine/Render/Drivers/Detectors/FullScreenDetector.h
- src/WallpaperEngine/Render/Drivers/Output/Output.cpp
- src/WallpaperEngine/Render/Drivers/Output/Output.h
- src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.cpp
- src/WallpaperEngine/Render/Drivers/Output/GLFWWindowOutput.h
- src/WallpaperEngine/Render/Drivers/Output/X11BackgroundWindow.cpp
- src/WallpaperEngine/Render/Drivers/Output/X11BackgroundWindow.h
- src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.cpp
- src/WallpaperEngine/Render/Drivers/Output/GLFWOutputViewport.h
- src/WallpaperEngine/Render/Drivers/Output/OutputViewport.cpp
- src/WallpaperEngine/Render/Drivers/Output/OutputViewport.h
- src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.h
- src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.cpp
- src/WallpaperEngine/Render/Drivers/VideoDriver.h
- src/WallpaperEngine/Render/Drivers/VideoDriver.cpp
- src/WallpaperEngine/Render/RenderContext.h
- src/WallpaperEngine/Render/RenderContext.cpp
- src/WallpaperEngine/Render/SplitLayout.h
- src/WallpaperEngine/Render/SplitLayout.cpp
- src/WallpaperEngine/Render/TextureCache.h
- src/WallpaperEngine/Render/TextureCache.cpp
- src/WallpaperEngine/Render/ImageDecoder.h
- src/WallpaperEngine/Render/ImageDecoder.cpp
- src/WallpaperEngine/Render/GifAnimation.h
- src/WallpaperEngine/Render/GifAnimation.cpp
- src/WallpaperEngine/Render/FBOProvider.cpp
- src/WallpaperEngine/Render/FBOProvider.h
- src/WallpaperEngine/Render/Helpers/ContextAware.cpp
- src/WallpaperEngine/Render/Helpers/ContextAware.h
- src/WallpaperEngine/Render/CWallpaper.h
- src/WallpaperEngine/Render/CWallpaper.cpp
- src/WallpaperEngine/Render/WallpaperState.h
- src/WallpaperEngine/Render/WallpaperState.cpp
- src/WallpaperEngine/Render/Wallpapers/CScene.h
- src/WallpaperEngine/Render/Wallpapers/CScene.cpp
- src/WallpaperEngine/Render/Wallpapers/CVideo.h
- src/WallpaperEngine/Render/Wallpapers/CVideo.cpp
- src/WallpaperEngine/Render/Wallpapers/CWeb.h
- src/WallpaperEngine/Render/Wallpapers/CWeb.cpp
- src/WallpaperEngine/Render/Wallpapers/CSplat.h
- src/WallpaperEngine/Render/Wallpapers/CSplat.cpp
- src/WallpaperEngine/Splat/SogLoader.h
- src/WallpaperEngine/Splat/SogLoader.cpp
- src/WallpaperEngine/Led/LedHub.h
- src/WallpaperEngine/Led/LedHub.cpp
- src/WallpaperEngine/Led/LedLayout.h
- src/WallpaperEngine/Led/LedLayout.cpp
- src/WallpaperEngine/Led/LedOutput.h
- src/WallpaperEngine/Led/LedOutput.cpp
- src/WallpaperEngine/Led/OpenRgbProtocol.h
- src/WallpaperEngine/Led/OpenRgbProtocol.cpp
- src/WallpaperEngine/Render/LedFrameGrabber.h
- src/WallpaperEngine/Render/LedFrameGrabber.cpp
- src/WallpaperEngine/Render/DepthRange.h
- src/WallpaperEngine/Render/DepthRange.cpp
- src/WallpaperEngine/Render/Camera.h
- src/WallpaperEngine/Render/Camera.cpp
- src/WallpaperEngine/Render/CObject.h
- src/WallpaperEngine/Render/CObject.cpp
- src/WallpaperEngine/Render/CTexture.cpp
- src/WallpaperEngine/Render/CTexture.h
- src/WallpaperEngine/Render/AlbumTexture.h
- src/WallpaperEngine/Render/AlbumTexture.cpp
- src/WallpaperEngine/Render/MissingTexture.h
- src/WallpaperEngine/Render/MissingTexture.cpp
- src/WallpaperEngine/Render/TextureProvider.h
- src/WallpaperEngine/Render/Objects/CRenderable.cpp
- src/WallpaperEngine/Render/Objects/CRenderable.h
- src/WallpaperEngine/Render/Objects/CImage.h
- src/WallpaperEngine/Render/Objects/CImage.cpp
- src/WallpaperEngine/Render/Objects/PuppetClipping.h
- src/WallpaperEngine/Render/Objects/PuppetClipping.cpp
- src/WallpaperEngine/Render/Objects/PuppetMeshFile.h
- src/WallpaperEngine/Render/Objects/PuppetMeshFile.cpp
- src/WallpaperEngine/Render/Objects/PuppetIK.h
- src/WallpaperEngine/Render/Objects/PuppetIK.cpp
- src/WallpaperEngine/Render/Objects/PuppetPhysics.h
- src/WallpaperEngine/Render/Objects/PuppetPhysics.cpp
- src/WallpaperEngine/Render/Objects/PuppetRootMotion.h
- src/WallpaperEngine/Render/Objects/PuppetRootMotion.cpp
- src/WallpaperEngine/Render/Objects/PuppetRig.h
- src/WallpaperEngine/Render/Objects/PuppetRig.cpp
- src/WallpaperEngine/Render/Objects/CSound.h
- src/WallpaperEngine/Render/Objects/CSound.cpp
- src/WallpaperEngine/Render/Objects/CParticle.h
- src/WallpaperEngine/Render/Objects/CParticle.cpp
- src/WallpaperEngine/Render/Objects/CText.h
- src/WallpaperEngine/Render/Objects/CText.cpp
- src/WallpaperEngine/Render/Objects/TextLayout.h
- src/WallpaperEngine/Render/Objects/TextLayout.cpp
- src/WallpaperEngine/Render/Fonts/SystemFonts.h
- src/WallpaperEngine/Render/Fonts/SystemFonts.cpp
- src/WallpaperEngine/Render/Objects/CLight.h
- src/WallpaperEngine/Render/Objects/CLight.cpp
- src/WallpaperEngine/Render/Objects/CCamera.h
- src/WallpaperEngine/Render/Objects/CCamera.cpp
- src/WallpaperEngine/Render/Volumetrics.h
- src/WallpaperEngine/Render/Volumetrics.cpp
- src/WallpaperEngine/Render/FrameMaterial.h
- src/WallpaperEngine/Render/FrameMaterial.cpp
- src/WallpaperEngine/Render/ShadowMapping.h
- src/WallpaperEngine/Render/ShadowMapping.cpp
- src/WallpaperEngine/Render/ModelData.h
- src/WallpaperEngine/Render/ModelData.cpp
- src/WallpaperEngine/Render/Objects/CMesh.h
- src/WallpaperEngine/Render/Objects/CMesh.cpp
- src/WallpaperEngine/Render/CFBO.h
- src/WallpaperEngine/Render/CFBO.cpp
- src/WallpaperEngine/Render/Objects/Effects/CPass.h
- src/WallpaperEngine/Render/Objects/Effects/CPass.cpp
- src/WallpaperEngine/WebBrowser/CEF/SharedMemoryRenderHandler.cpp
- src/WallpaperEngine/WebBrowser/CEF/SharedMemoryRenderHandler.h
- src/WallpaperEngine/WebBrowser/CEF/BrowserClient.cpp
- src/WallpaperEngine/WebBrowser/CEF/PageBridge.cpp
- src/WallpaperEngine/WebBrowser/CEF/PageBridge.h
- src/WallpaperEngine/WebBrowser/CEF/BrowserClient.h
- src/WallpaperEngine/WebBrowser/CEF/BrowserApp.cpp
- src/WallpaperEngine/WebBrowser/CEF/BrowserApp.h
- src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp
- src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.h
- src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.cpp
- src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandlerFactory.h
- src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.cpp
- src/WallpaperEngine/WebBrowser/CEF/WPSchemeHandler.h
- src/WallpaperEngine/WebBrowser/WebBrowserContext.cpp
- src/WallpaperEngine/WebBrowser/WebBrowserContext.h
- src/WallpaperEngine/WebBrowser/IPC/WebHostSharedMemory.cpp
- src/WallpaperEngine/WebBrowser/IPC/WebHostSharedMemory.h
- src/WallpaperEngine/WebBrowser/IPC/DmabufChannel.cpp
- src/WallpaperEngine/WebBrowser/IPC/DmabufChannel.h
- src/WallpaperEngine/Render/Wallpapers/WebDmabufImport.cpp
- src/WallpaperEngine/Render/Wallpapers/WebDmabufImport.h
- src/WallpaperEngine/Data/Assets/Types.h
- src/WallpaperEngine/Data/Assets/Texture.h
- src/WallpaperEngine/Data/Assets/Package.h
- src/WallpaperEngine/Data/Model/Types.h
- src/WallpaperEngine/Data/Model/Project.h
- src/WallpaperEngine/Data/Model/ImageAdjustments.h
- src/WallpaperEngine/Data/Model/Wallpaper.h
- src/WallpaperEngine/Data/Model/Object.h
- src/WallpaperEngine/Data/Model/Material.h
- src/WallpaperEngine/Data/Model/Effect.h
- src/WallpaperEngine/Data/Model/Model.h
- src/WallpaperEngine/Data/Model/UserSetting.h
- src/WallpaperEngine/Data/Model/DynamicValue.h
- src/WallpaperEngine/Data/Model/DynamicValue.cpp
- src/WallpaperEngine/Data/Model/Effect.cpp
- src/WallpaperEngine/Data/Model/PropertyAnimation.h
- src/WallpaperEngine/Data/Model/Property.h
- src/WallpaperEngine/Data/Utils/TypeCaster.h
- src/WallpaperEngine/Data/Utils/BinaryReader.cpp
- src/WallpaperEngine/Data/Utils/BinaryReader.h
- src/WallpaperEngine/Data/Utils/MemoryStream.h
- src/WallpaperEngine/Data/Utils/SFINAE.h
- src/WallpaperEngine/Data/Parsers/DynamicValueParser.h
- src/WallpaperEngine/Data/Parsers/DynamicValueParser.cpp
- src/WallpaperEngine/Data/Parsers/EffectParser.cpp
- src/WallpaperEngine/Data/Parsers/EffectParser.h
- src/WallpaperEngine/Data/Parsers/Localization.cpp
- src/WallpaperEngine/Data/Parsers/Localization.h
- src/WallpaperEngine/Data/Parsers/ProjectParser.cpp
- src/WallpaperEngine/Data/Parsers/ProjectParser.h
- src/WallpaperEngine/Data/Parsers/WallpaperParser.cpp
- src/WallpaperEngine/Data/Parsers/WallpaperParser.h
- src/WallpaperEngine/Data/Parsers/UserSettingParser.cpp
- src/WallpaperEngine/Data/Parsers/UserSettingParser.h
- src/WallpaperEngine/Data/Parsers/ObjectParser.cpp
- src/WallpaperEngine/Data/Parsers/ObjectParser.h
- src/WallpaperEngine/Data/Parsers/MaterialParser.cpp
- src/WallpaperEngine/Data/Parsers/MaterialParser.h
- src/WallpaperEngine/Data/Parsers/ModelParser.cpp
- src/WallpaperEngine/Data/Parsers/ModelParser.h
- src/WallpaperEngine/Data/Parsers/ShaderConstantParser.cpp
- src/WallpaperEngine/Data/Parsers/ShaderConstantParser.h
- src/WallpaperEngine/Data/Parsers/PackageParser.cpp
- src/WallpaperEngine/Data/Parsers/PackageParser.h
- src/WallpaperEngine/Data/Parsers/PropertyParser.cpp
- src/WallpaperEngine/Data/Parsers/PropertyParser.h
- src/WallpaperEngine/Data/Parsers/TextureParser.cpp
- src/WallpaperEngine/Data/Parsers/TextureParser.h
- src/WallpaperEngine/Data/Builders/ColorBuilder.h
- src/WallpaperEngine/Data/Builders/ColorBuilder.cpp
- src/WallpaperEngine/Data/Builders/UserSettingBuilder.h
- src/WallpaperEngine/Data/Builders/VectorBuilder.cpp
- src/WallpaperEngine/Data/Builders/VectorBuilder.h
- src/WallpaperEngine/Data/Dumpers/StringPrinter.cpp
- src/WallpaperEngine/Data/Dumpers/StringPrinter.h
- src/WallpaperEngine/Data/JSON.cpp
- src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.cpp
- src/WallpaperEngine/VideoPlayback/MPV/GLPlayer.h
- src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.cpp
- src/WallpaperEngine/VideoPlayback/MPV/MemoryStreamProtocol.h
- src/WallpaperEngine/Scripting/Adapters/VectorAdapter.h
- src/WallpaperEngine/Scripting/Adapters/VectorAdapter.cpp
- src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.h
- src/WallpaperEngine/Scripting/Adapters/ScriptableObjectAdapter.cpp
- src/WallpaperEngine/Scripting/JS.h
- src/WallpaperEngine/Scripting/JS.cpp
- src/WallpaperEngine/Scripting/ConsoleObject.h
- src/WallpaperEngine/Scripting/ConsoleObject.cpp
- src/WallpaperEngine/Scripting/LocalStorage.h
- src/WallpaperEngine/Scripting/LocalStorage.cpp
- src/WallpaperEngine/Scripting/LocalStorageObject.h
- src/WallpaperEngine/Scripting/LocalStorageObject.cpp
- src/WallpaperEngine/Scripting/EngineObject.h
- src/WallpaperEngine/Scripting/EngineObject.cpp
- src/WallpaperEngine/Scripting/InputObject.h
- src/WallpaperEngine/Scripting/InputObject.cpp
- src/WallpaperEngine/Scripting/SceneObject.h
- src/WallpaperEngine/Scripting/SceneObject.cpp
- src/WallpaperEngine/Scripting/ScriptEngine.h
- src/WallpaperEngine/Scripting/ScriptPropertiesObject.h
- src/WallpaperEngine/Scripting/ScriptPropertiesObject.cpp
- src/WallpaperEngine/Scripting/ScriptEngine.cpp
- src/WallpaperEngine/Scripting/LimitedAllocator.h
- src/WallpaperEngine/Scripting/LimitedAllocator.cpp
- src/WallpaperEngine/Scripting/ScriptWatchdog.cpp
- src/WallpaperEngine/Scripting/ScriptableObject.h
- src/WallpaperEngine/Scripting/ScriptableObject.cpp
- src/WallpaperEngine/Scripting/AnimationSystem.h
- src/WallpaperEngine/Scripting/AnimationSystem.cpp
- src/WallpaperEngine/Maths.h
- src/WallpaperEngine/Maths.cpp)
- if(BUILD_TESTING)
- add_executable(
- tests
- ${COMMON_SOURCES}
- src/WallpaperEngine/Testing/Cases/DmabufChannel.cpp
- src/WallpaperEngine/Testing/Cases/DynamicValueListeners.cpp
- src/WallpaperEngine/Testing/Cases/Example.cpp
- src/WallpaperEngine/Testing/Cases/Leds.cpp
- src/WallpaperEngine/Testing/Cases/FramePacer.cpp
- src/WallpaperEngine/Testing/Cases/AudioStream.cpp
- src/WallpaperEngine/Testing/Cases/Hrtf.cpp
- src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.cpp
- src/WallpaperEngine/Testing/Render/TestingOpenGLDriver.h
- src/WallpaperEngine/Testing/Input/TestingMouseInput.cpp
- src/WallpaperEngine/Testing/Input/TestingMouseInput.h
- src/WallpaperEngine/Testing/Harnesses/RenderHarness.cpp
- src/WallpaperEngine/Testing/Harnesses/RenderHarness.h
- src/WallpaperEngine/Testing/Cases/MouseCoordinates.cpp
- src/WallpaperEngine/Testing/Cases/SystemFonts.cpp
- src/WallpaperEngine/Testing/Cases/PropertyParser.cpp
- src/WallpaperEngine/Testing/Cases/SpectrumListeners.cpp
- src/WallpaperEngine/Testing/Cases/SpectrumPipeline.cpp
- src/WallpaperEngine/Testing/Cases/ParticleNoise.cpp
- src/WallpaperEngine/Testing/Cases/UserShortcut.cpp
- src/WallpaperEngine/Testing/Cases/Localization.cpp
- src/WallpaperEngine/Testing/Cases/ScalingModes.cpp
- src/WallpaperEngine/Testing/Cases/CornerColor.cpp
- src/WallpaperEngine/Testing/Cases/GnomeSession.cpp
- src/WallpaperEngine/Testing/Cases/JsonVectorParsing.cpp
- src/WallpaperEngine/Testing/Cases/ModuleNamespaceTiming.cpp
- src/WallpaperEngine/Testing/Cases/AudioSensitivity.cpp
- src/WallpaperEngine/Testing/Cases/ThumbnailPalette.cpp
- src/WallpaperEngine/Testing/Cases/Transition.cpp
- src/WallpaperEngine/Testing/Cases/TextInputProperty.cpp
- src/WallpaperEngine/Testing/Cases/TextLayoutRules.cpp
- src/WallpaperEngine/Testing/Cases/MediaCover.cpp
- src/WallpaperEngine/Testing/Cases/ForwardedButton.cpp
- src/WallpaperEngine/Testing/Cases/LocalStorage.cpp
- src/WallpaperEngine/Testing/Cases/HyprlandIPC.cpp
- src/WallpaperEngine/Testing/Cases/WebHostFiles.cpp
- src/WallpaperEngine/Testing/Cases/PowerSupply.cpp
- src/WallpaperEngine/Testing/Cases/EncodedImages.cpp
- src/WallpaperEngine/Testing/Cases/AuthoringJson.cpp
- src/WallpaperEngine/Testing/Cases/ReaderLimits.cpp
- src/WallpaperEngine/Testing/Cases/SteamLibraries.cpp
- src/WallpaperEngine/Testing/Cases/ErrorRepeatFilter.cpp
- src/WallpaperEngine/Testing/Cases/WebTestHooks.cpp
- src/WallpaperEngine/Testing/Cases/DirectoryAdapter.cpp
- src/WallpaperEngine/Testing/Cases/ControlFileOwner.cpp
- src/WallpaperEngine/Testing/Cases/HandleTable.cpp
- src/WallpaperEngine/Testing/Cases/PuppetMeshFile.cpp
- src/WallpaperEngine/Testing/Cases/ScriptLocalStorage.cpp
- src/WallpaperEngine/Testing/Cases/KWinScriptFiles.cpp
- src/WallpaperEngine/Testing/Cases/NumericGuards.cpp
- src/WallpaperEngine/Testing/Cases/ThreadGuard.cpp
- src/WallpaperEngine/Testing/Cases/ScriptCallbackGuard.cpp
- src/WallpaperEngine/Testing/Cases/WeJsonTypes.cpp
- src/WallpaperEngine/Testing/Cases/ScriptLimits.cpp
- src/WallpaperEngine/Testing/Cases/ShaderCompat.cpp
- src/WallpaperEngine/Testing/Cases/ShaderCache.cpp
- src/WallpaperEngine/Testing/Cases/ShaderUniforms.cpp
- src/WallpaperEngine/Testing/Cases/ScriptWatchdog.cpp
- src/WallpaperEngine/Testing/Cases/WebFrameSlots.cpp
- src/WallpaperEngine/Testing/Cases/AlbumArtworkUpload.cpp
- src/WallpaperEngine/Testing/Cases/SplitLayout.cpp
- src/WallpaperEngine/Testing/Cases/PlaylistSchedule.cpp
- src/WallpaperEngine/Testing/Cases/AutomuteDetector.cpp
- src/WallpaperEngine/Testing/Cases/IconTheme.cpp
- src/WallpaperEngine/Testing/Cases/ApplicationArguments.cpp
- src/WallpaperEngine/Testing/Cases/PuppetIK.cpp
- src/WallpaperEngine/Testing/Cases/ProjectScenes.cpp)
- endif()
- # the one file that derives from a V8 class: libnode is built without RTTI and exports no typeinfo of V8's classes
- set_source_files_properties(src/WallpaperEngine/Scripting/LimitedAllocator.cpp PROPERTIES COMPILE_OPTIONS -fno-rtti)
- add_library(
- linux-wallpaperengine-lib SHARED
- ${COMMON_SOURCES}
- ${WAYLAND_SOURCES}
- ${X11_SOURCES}
- ${DEMOMODE_SOURCES})
- target_link_libraries (linux-wallpaperengine-lib PUBLIC
- $<$<BOOL:${LWE_TRACY}>:tracy-client>
- ${OPENGL_LIBRARIES}
- GLEW::GLEW
- ${GLUT_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${LZ4_LIBRARY}
- ${SDL2_LIBRARIES}
- ${FFMPEG_LIBRARIES}
- ${MPV_LIBRARY}
- ${PULSEAUDIO_LIBRARY}
- Freetype::Freetype
- PkgConfig::HARFBUZZ
- msdfgen-core
- ${WAYLAND_LIBRARIES}
- ${X11_LIBRARIES}
- ${DBUS_LIBRARIES}
- kissfft
- glslang
- spirv-cross-core
- spirv-cross-glsl
- glfw
- libcef_lib
- libcef_dll_wrapper
- argparse
- V8::V8)
- if (BUILD_TESTING)
- target_link_libraries (tests PRIVATE
- Catch2::Catch2WithMain
- ${OPENGL_LIBRARIES}
- GLEW::GLEW
- ${GLUT_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${LZ4_LIBRARY}
- ${SDL2_LIBRARIES}
- ${FFMPEG_LIBRARIES}
- ${MPV_LIBRARY}
- ${PULSEAUDIO_LIBRARY}
- Freetype::Freetype
- PkgConfig::HARFBUZZ
- msdfgen-core
- ${WAYLAND_LIBRARIES}
- ${X11_LIBRARIES}
- ${DBUS_LIBRARIES}
- kissfft
- glslang
- spirv-cross-core
- spirv-cross-glsl
- glfw
- libcef_lib
- libcef_dll_wrapper
- argparse
- V8::V8)
- endif()
- # the shader caches under ~/.cache hold what these sources and compilers made, so their content is the key (a build date
- # stays the same in reproducible builds)
- set(SHADER_CACHE_SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Render/Shaders/ShaderUnit.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Render/Shaders/GLSLContext.cpp)
- set(SHADER_CACHE_ID "")
- foreach(SHADER_CACHE_SOURCE ${SHADER_CACHE_SOURCES})
- file(SHA256 ${SHADER_CACHE_SOURCE} SHADER_CACHE_HASH)
- string(APPEND SHADER_CACHE_ID ${SHADER_CACHE_HASH})
- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SHADER_CACHE_SOURCE})
- endforeach()
- foreach(SHADER_CACHE_DEP glslang-WallpaperEngine SPIRV-Cross-WallpaperEngine)
- execute_process(
- COMMAND git -C ${CMAKE_CURRENT_SOURCE_DIR}/src/External/${SHADER_CACHE_DEP} rev-parse HEAD
- OUTPUT_VARIABLE SHADER_CACHE_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
- string(APPEND SHADER_CACHE_ID ${SHADER_CACHE_REVISION})
- endforeach()
- string(SHA256 SHADER_CACHE_ID "${SHADER_CACHE_ID}")
- target_compile_definitions(linux-wallpaperengine-lib PRIVATE "LWE_SHADER_CACHE_ID=\"${SHADER_CACHE_ID}\"")
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC ERRORONLY=${ERRORONLY})
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC DEMOMODE=${DEMOMODE})
- if (BUILD_TESTING)
- target_compile_definitions(tests PRIVATE ERRORONLY=0)
- target_compile_definitions(tests PRIVATE "LWE_SHADER_CACHE_ID=\"${SHADER_CACHE_ID}\"")
- target_compile_definitions(tests PRIVATE DEMOMODE=0)
- endif()
- if(X11_SUPPORT_FOUND)
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_X11)
- check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
- if(HAVE_XSETIOERROREXITHANDLER)
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC HAVE_XSETIOERROREXITHANDLER=1)
- endif()
- endif()
- if(WAYLAND_SUPPORT_FOUND)
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_WAYLAND)
- endif()
- if(KDE_FEATURES_ENABLED)
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC ENABLE_KDE_FEATURES)
- endif()
- if(WAYLAND_SUPPORT_FOUND AND NOT X11_SUPPORT_FOUND)
- target_compile_definitions(linux-wallpaperengine-lib PUBLIC GLEW_EGL)
- endif()
- target_include_directories(linux-wallpaperengine-lib PUBLIC
- src
- src/External/glslang-WallpaperEngine
- src/External/SPIRV-Cross-WallpaperEngine
- src/External/MimeTypes
- src/External/nanosvg
- src/External/json/include
- src/External/stb
- src/External/kissfft
- ${MPV_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
- ${LZ4_INCLUDE_DIR}
- ${SDL2_INCLUDE_DIRS}
- ${FFMPEG_INCLUDE_DIR}
- ${PULSEAUDIO_INCLUDE_DIR}
- ${CEF_INCLUDE_PATH}
- ${CMAKE_SOURCE_DIR}
- ${X11_INCLUDES}
- ${WAYLAND_OUTPUT_DIR})
- COPY_FILES(linux-wallpaperengine-lib "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
- COPY_FILES(linux-wallpaperengine-lib "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
- # remove the vulkan lib as chromium includes a broken libvulkan.so.1 with it
- file(REMOVE "${CEF_BINARY_DIR}/libvulkan.so.1")
- set_target_properties(linux-wallpaperengine-lib PROPERTIES
- LIBRARY_OUTPUT_DIRECTORY ${TARGET_OUTPUT_DIRECTORY})
- # hardening for our own code only (the CEF wrapper builds with -Werror and its own flags)
- # packagers set their own level (Fedora, Arch: 3) through CXXFLAGS, glibc before 2.33 treats 3 as 2
- if(NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
- target_compile_options(linux-wallpaperengine-lib PRIVATE
- $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Release,RelWithDebInfo>>:-U_FORTIFY_SOURCE>
- $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Release,RelWithDebInfo>>:-D_FORTIFY_SOURCE=3>)
- endif()
- target_link_options(linux-wallpaperengine-lib PRIVATE -Wl,-z,relro,-z,now)
- # Debugging/ThreadSafety.h carries the lock annotations, only clang checks them
- target_compile_options(linux-wallpaperengine-lib PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wthread-safety>)
- add_dependencies(linux-wallpaperengine-lib libcef_dll_wrapper glslang spirv-cross-core spirv-cross-glsl)
- # CEF's SET_EXECUTABLE_TARGET_PROPERTIES without C++ flags on C files
- REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine-lib)
- # after CEF's options, the compilers keep the last of -fstack-protector and -fstack-protector-strong
- target_compile_options(linux-wallpaperengine-lib PRIVATE
- $<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-strong>)
- add_executable(linux-wallpaperengine
- src/main.cpp)
- target_link_libraries (linux-wallpaperengine PUBLIC linux-wallpaperengine-lib)
- # libcef has to load before libc (Chromium finds close() via RTLD_NEXT), --as-needed distros dropped the dependency
- target_link_options (linux-wallpaperengine PRIVATE -Wl,--no-as-needed -pie -Wl,-z,relro,-z,now)
- add_executable(linux-wallpaperengine-web-helper
- src/web_helper.cpp
- src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp)
- target_include_directories(linux-wallpaperengine-web-helper PRIVATE
- src
- ${CEF_INCLUDE_PATH}
- ${CMAKE_SOURCE_DIR})
- target_link_libraries(linux-wallpaperengine-web-helper PRIVATE
- libcef_lib
- libcef_dll_wrapper)
- add_dependencies(linux-wallpaperengine-web-helper libcef_dll_wrapper)
- REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine-web-helper)
- # unloads the engine's KWin scripts once the engine is gone, however it went; libdbus only (the engine is over 100 MB
- # resident), next to the engine like the web helper
- if(KDE_FEATURES_ENABLED)
- add_executable(linux-wallpaperengine-kwin-janitor src/kwin_janitor.cpp)
- target_include_directories(linux-wallpaperengine-kwin-janitor PRIVATE ${DBUS_INCLUDE_DIRS})
- target_link_libraries(linux-wallpaperengine-kwin-janitor PRIVATE ${DBUS_LIBRARIES})
- set_target_properties(linux-wallpaperengine-kwin-janitor PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TARGET_OUTPUT_DIRECTORY})
- add_dependencies(linux-wallpaperengine linux-wallpaperengine-kwin-janitor)
- endif()
- # GNOME 45-48 helper spawned by the Shell extension, static so it also runs on the host for Flatpak
- include(CheckCSourceCompiles)
- set(CMAKE_REQUIRED_LINK_OPTIONS -static)
- check_c_source_compiles("int main(void) { return 0; }" LWE_CAN_LINK_STATIC)
- unset(CMAKE_REQUIRED_LINK_OPTIONS)
- add_executable(linux-wallpaperengine-gnome-helper src/gnome_wayland_helper.c)
- if(LWE_CAN_LINK_STATIC)
- target_link_options(linux-wallpaperengine-gnome-helper PRIVATE -static)
- endif()
- set_target_properties(linux-wallpaperengine-gnome-helper PROPERTIES RUNTIME_OUTPUT_DIRECTORY
- ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension/linux-wallpaperengine@wallpaperenginelover.github.io)
- add_custom_target(gnome-shell-extension ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${CMAKE_CURRENT_SOURCE_DIR}/gnome-shell-extension ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension)
- add_dependencies(gnome-shell-extension linux-wallpaperengine-gnome-helper)
- add_dependencies(linux-wallpaperengine gnome-shell-extension)
- # install(TARGETS) so CMake replaces the build-time RPATH
- install(TARGETS linux-wallpaperengine linux-wallpaperengine-web-helper
- RUNTIME DESTINATION .
- )
- if(KDE_FEATURES_ENABLED)
- install(TARGETS linux-wallpaperengine-kwin-janitor RUNTIME DESTINATION .)
- endif()
- install(TARGETS linux-wallpaperengine-lib
- LIBRARY DESTINATION .
- )
- include(GNUInstallDirs)
- install(TARGETS kissfft LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(DIRECTORY resources/icons/hicolor DESTINATION share/icons)
- install(FILES resources/linux-wallpaperengine.desktop DESTINATION share/applications)
- install(DIRECTORY ${TARGET_OUTPUT_DIRECTORY}/ DESTINATION . USE_SOURCE_PERMISSIONS
- PATTERN "linux-wallpaperengine" EXCLUDE
- PATTERN "linux-wallpaperengine-web-helper" EXCLUDE
- PATTERN "linux-wallpaperengine-kwin-janitor" EXCLUDE
- PATTERN "liblinux-wallpaperengine-lib.so" EXCLUDE
- PATTERN "glslang" EXCLUDE
- PATTERN "glslangValidator" EXCLUDE
- PATTERN "spirv-cross" EXCLUDE
- PATTERN "spirv-remap" EXCLUDE
- PATTERN "tests" EXCLUDE
- PATTERN "lwe-resample-bin" EXCLUDE
- PATTERN "lwe-sound-bin" EXCLUDE
- )
- # Chromium's sandbox helper only works setuid root. Only root can set that up (as another user the bit would run it as
- # that user, and the engine ignores a chrome-sandbox that root doesn't own). Under fakeroot (packages) id -u says 0 too
- install(CODE [[
- execute_process(COMMAND id -u OUTPUT_VARIABLE lwe_uid OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(lwe_sandbox "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/chrome-sandbox")
- if(EXISTS "${lwe_sandbox}")
- if(lwe_uid STREQUAL "0")
- execute_process(COMMAND chown 0:0 "${lwe_sandbox}" RESULT_VARIABLE lwe_chown)
- execute_process(COMMAND chmod 4755 "${lwe_sandbox}" RESULT_VARIABLE lwe_chmod)
- if(lwe_chown OR lwe_chmod)
- message(WARNING "Could not make ${lwe_sandbox} setuid root, web wallpapers need user namespaces")
- else()
- message(STATUS "Set chrome-sandbox setuid root: ${lwe_sandbox}")
- endif()
- else()
- message(STATUS "chrome-sandbox is not setuid (not installing as root), web wallpapers need user namespaces: "
- "chown root:root chrome-sandbox; chmod 4755 chrome-sandbox")
- endif()
- endif()
- ]])
|