diff --git a/.github/workflows/arch.yml b/.github/workflows/arch.yml
index d57ed7e..f9d7ec6 100644
--- a/.github/workflows/arch.yml
+++ b/.github/workflows/arch.yml
@@ -14,8 +14,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
+ with:
+ submodules: true
- - name: Publish parallel-disk-usage to the AUR
+ - name: Publish linux-wallpaperengine-git to the AUR
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
with:
pkgname: linux-wallpaperengine-git
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
index 63dd698..2f6fdb0 100644
--- a/.github/workflows/cmake.yml
+++ b/.github/workflows/cmake.yml
@@ -14,7 +14,7 @@ jobs:
build-x11:
strategy:
matrix:
- os: [ubuntu-22.04, ubuntu-20.04]
+ os: [ubuntu-22.04, ubuntu-24.04]
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
@@ -22,9 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v3
+ with:
+ submodules: true
- name: Install dependencies
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0
+ if: matrix.os == 'ubuntu-22.04'
+ run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev
+ - name: Install dependencies
+ if: matrix.os == 'ubuntu-24.04'
+ run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
@@ -38,7 +44,7 @@ jobs:
build-x11-wayland:
strategy:
matrix:
- os: [ubuntu-22.04]
+ os: [ubuntu-22.04, ubuntu-24.04]
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
@@ -46,9 +52,16 @@ jobs:
steps:
- uses: actions/checkout@v3
+ with:
+ submodules: true
- name: Install dependencies
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 wayland-scanner++ wayland-protocols libwayland-dev
+ if: matrix.os == 'ubuntu-22.04'
+ run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev wayland-scanner++ wayland-protocols libwayland-dev
+
+ - name: Install dependencies
+ if: matrix.os == 'ubuntu-24.04'
+ run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev wayland-scanner++ wayland-protocols libwayland-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
@@ -62,7 +75,7 @@ jobs:
build-wayland:
strategy:
matrix:
- os: [ubuntu-22.04]
+ os: [ubuntu-22.04, ubuntu-24.04]
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
@@ -70,9 +83,16 @@ jobs:
steps:
- uses: actions/checkout@v3
+ with:
+ submodules: true
- name: Install dependencies
- run: sudo apt-get update && sudo apt-get -y install wayland-scanner++ wayland-protocols libwayland-dev libwayland-egl-backend-dev libglfw3-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0
+ if: matrix.os == 'ubuntu-22.04'
+ run: sudo apt-get update && sudo apt-get -y install wayland-scanner++ wayland-protocols libwayland-dev libwayland-egl-backend-dev libglfw3-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev
+
+ - name: Install dependencies
+ if: matrix.os == 'ubuntu-24.04'
+ run: sudo apt-get update && sudo apt-get -y install wayland-scanner++ wayland-protocols libwayland-dev libwayland-egl-backend-dev libglfw3-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
diff --git a/.gitignore b/.gitignore
index 77b25b8..153df4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-cmake-build-debug*
+cmake-build-*
.idea
build/
.vscode/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..54a51c2
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,28 @@
+[submodule "src/External/glslang-WallpaperEngine"]
+ path = src/External/glslang-WallpaperEngine
+ url = https://github.com/Almamu/glslang-WallpaperEngine.git
+ branch = main
+[submodule "src/External/SPIRV-Cross-WallpaperEngine"]
+ path = src/External/SPIRV-Cross-WallpaperEngine
+ url = https://github.com/Almamu/SPIRV-Cross-WallpaperEngine.git
+ branch = main
+[submodule "src/External/stb"]
+ path = src/External/stb
+ url = https://github.com/nothings/stb.git
+ branch = master
+[submodule "src/External/json"]
+ path = src/External/json
+ url = https://github.com/nlohmann/json.git
+ branch = develop
+[submodule "src/External/MimeTypes"]
+ path = src/External/MimeTypes
+ url = https://github.com/lasselukkari/MimeTypes.git
+ branch = master
+[submodule "src/External/kissfft"]
+ path = src/External/kissfft
+ url = https://github.com/mborgerding/kissfft.git
+ branch = master
+[submodule "src/External/argparse"]
+ path = src/External/argparse
+ url = https://github.com/p-ranav/argparse.git
+ branch = master
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79dbaf2..d999b35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,10 +10,12 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
set(OpenGL_GL_PREFERENCE "LEGACY")
-set(DATADIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME})
-set(PATCHESDIR ${DATADIR}/patches/)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+if(NOT DEMOMODE)
+ set(DEMOMODE 0)
+endif()
+
if(NOT ERRORONLY)
set(ERRORONLY 0)
endif()
@@ -22,7 +24,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
# if you're developing you might find this debug option useful for shader output, although RenderDoc is encouraged
add_compile_definitions(ERRORONLY=${ERRORONLY})
-add_compile_definitions(DATADIR="${DATADIR}")
+add_compile_definitions(DEMOMODE=${DEMOMODE})
find_package(X11)
find_package(OpenGL REQUIRED)
@@ -35,9 +37,14 @@ find_package(LZ4 REQUIRED)
find_package(FFMPEG REQUIRED)
find_package(PulseAudio REQUIRED)
+set(ENABLE_OPT OFF)
+set(SPIRV_CROSS_FORCE_PIC ON)
+set(KISSFFT_TEST OFF)
+set(KISSFFT_TOOLS OFF)
+
# Download CEF of specified version for current platform
# Specify the CEF distribution version.
-set(CEF_VERSION "120.1.10+g3ce3184+chromium-120.0.6099.129")
+set(CEF_VERSION "135.0.17+gcbc1c5b+chromium-135.0.7049.52")
# Determine the platform.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
if("${PROJECT_ARCH}" STREQUAL "arm64")
@@ -87,47 +94,28 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
endif()
message(STATUS "Using CEF for ${CMAKE_SYSTEM_NAME} - ${CEF_PLATFORM} (${CEF_ARCH_DETECTION})")
include(DownloadCEF)
-DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef")
+DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_CURRENT_BINARY_DIR}/cef")
+
+# add cef's cmake files to the lookup so we can use those directly
+list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
find_package(CEF REQUIRED)
-set(
- CMAKE_RUNTIME_OUTPUT_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/build
- )
+# remove some switches that forbid us from using things that are commonplace in our codebase
+list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-exceptions)
+list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-rtti)
+# 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_LIBRARY_OUTPUT_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/lib
- )
-
-set(
- TARGET_OUTPUT_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/build
- )
+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)
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
-
-include_directories(
- ${MPV_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
- ${LZ4_INCLUDE_DIR}
- ${SDL2_INCLUDE_DIRS}
- ${FFMPEG_INCLUDE_DIR}
- ${PULSEAUDIO_INCLUDE_DIR}
- src
- ${CEF_INCLUDE_PATH}
- ${CMAKE_SOURCE_DIR}
- include)
-
-
-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}")
-# SET_CEF_TARGET_OUT_DIR()
-include_directories(${_CEF_ROOT})
+add_subdirectory(src/External/glslang-WallpaperEngine glslang)
+add_subdirectory(src/External/SPIRV-Cross-WallpaperEngine spirv-cross)
+add_subdirectory(src/External/kissfft kissfft)
+add_subdirectory(src/External/argparse argparse)
# try to enable wayland builds when possible
pkg_check_modules(WAYLAND_SUPPORT wayland-cursor wayland-protocols egl wayland-egl)
@@ -141,54 +129,61 @@ if(WAYLAND_SUPPORT_FOUND)
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...")
- execute_process(
- COMMAND ${WaylandScanner} client-header ${CMAKE_SOURCE_DIR}/protocols/wlr-foreign-toplevel-management-unstable-v1.xml wlr-foreign-toplevel-management-unstable-v1-protocol.h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- execute_process(
- COMMAND ${WaylandScanner} private-code ${CMAKE_SOURCE_DIR}/protocols/wlr-foreign-toplevel-management-unstable-v1.xml wlr-foreign-toplevel-management-unstable-v1-protocol.c
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- execute_process(
- COMMAND ${WaylandScanner} client-header ${CMAKE_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- execute_process(
- COMMAND ${WaylandScanner} private-code ${CMAKE_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- execute_process(
- COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- execute_process(
- COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ add_custom_command(OUTPUT ${WAYLAND_OUTPUT_DIR}/wlr-foreign-toplevel-management-unstable-v1-protocol.h
+ COMMAND ${WaylandScanner} client-header ${CMAKE_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_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_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_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}/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_compile_definitions(ENABLE_WAYLAND)
+ 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/CWaylandOpenGLDriver.h"
- "src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.cpp"
- "src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.cpp"
- "src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.h"
- "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.cpp"
- "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.h"
- "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutputViewport.cpp"
- "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutputViewport.h"
- "src/WallpaperEngine/Input/Drivers/CWaylandMouseInput.cpp"
- "src/WallpaperEngine/Input/Drivers/CWaylandMouseInput.h"
- "xdg-shell-protocol.c"
- "wlr-foreign-toplevel-management-unstable-v1-protocol.c"
- "wlr-layer-shell-unstable-v1-protocol.c")
+ src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.h
+ src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.cpp
+ src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.cpp
+ src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.h
+ src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.cpp
+ src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.h
+ src/WallpaperEngine/Render/Drivers/Output/CWaylandOutputViewport.cpp
+ src/WallpaperEngine/Render/Drivers/Output/CWaylandOutputViewport.h
+ src/WallpaperEngine/Input/Drivers/CWaylandMouseInput.cpp
+ src/WallpaperEngine/Input/Drivers/CWaylandMouseInput.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)
endif()
if(X11_FOUND)
- set(X11_SUPPORT_FOUND TRUE)
-
if(NOT X11_Xrandr_FOUND)
message(WARNING "X11 support disabled. Xrandr package is missing")
set(X11_SUPPORT_FOUND FALSE)
- endif()
- if(NOT X11_xf86vmode_FOUND)
+ 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()
@@ -196,26 +191,78 @@ if(X11_SUPPORT_FOUND)
include_directories(${X11_INCLUDE_DIR} ${XRANDR_INCLUDE_DIR})
add_compile_definitions(ENABLE_X11)
+ set(X11_LIBRARIES
+ ${X11_LIBRARIES}
+ ${X11_Xrandr_LIB})
set(X11_SOURCES
- "src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp"
- "src/WallpaperEngine/Render/Drivers/Output/CX11Output.h"
- "src/WallpaperEngine/Render/Drivers/Detectors/CX11FullScreenDetector.cpp"
- "src/WallpaperEngine/Render/Drivers/Detectors/CX11FullScreenDetector.h")
+ src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp
+ src/WallpaperEngine/Render/Drivers/Output/CX11Output.h
+ src/WallpaperEngine/Render/Drivers/Detectors/CX11FullScreenDetector.cpp
+ src/WallpaperEngine/Render/Drivers/Detectors/CX11FullScreenDetector.h)
+ SET(X11_INCLUDES
+ ${X11_INCLUDE_DIR}
+ ${XRANDR_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
+
+ # make sure some of the X11 functions we'll use are available
+ check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
+
+ if(HAVE_XSETIOERROREXITHANDLER)
+ add_compile_definitions(HAVE_XSETIOERROREXITHANDLER=1)
+ endif()
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()
+
+include_directories(
+ src
+ src/External/glslang-WallpaperEngine
+ src/External/SPIRV-Cross-WallpaperEngine
+ src/External/MimeTypes
+ 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})
+
add_executable(
linux-wallpaperengine
- main.cpp
+ src/main.cpp
- src/External/Android/fft.cpp
- src/External/Android/fft.h
+ src/External/MimeTypes/MimeTypes.cpp
+ src/External/MimeTypes/MimeTypes.h
- src/Steam/FileSystem/FileSystem.h
src/Steam/FileSystem/FileSystem.cpp
+ src/Steam/FileSystem/FileSystem.h
src/WallpaperEngine/Logging/CLog.cpp
src/WallpaperEngine/Logging/CLog.h
+ src/WallpaperEngine/PrettyPrinter/CPrettyPrinter.cpp
+ src/WallpaperEngine/PrettyPrinter/CPrettyPrinter.h
+
src/WallpaperEngine/Application/CApplicationContext.cpp
src/WallpaperEngine/Application/CApplicationContext.h
src/WallpaperEngine/Application/CWallpaperApplication.cpp
@@ -281,12 +328,19 @@ add_executable(
src/WallpaperEngine/Render/Shaders/Variables/CShaderVariableVector4.h
src/WallpaperEngine/Render/Shaders/Variables/CShaderVariableVector4.cpp
- src/WallpaperEngine/Render/Shaders/Compiler.h
- src/WallpaperEngine/Render/Shaders/Compiler.cpp
+ src/WallpaperEngine/Render/Shaders/CShader.h
+ src/WallpaperEngine/Render/Shaders/CShader.cpp
+ src/WallpaperEngine/Render/Shaders/CShaderUnit.cpp
+ src/WallpaperEngine/Render/Shaders/CShaderUnit.h
+ src/WallpaperEngine/Render/Shaders/CGLSLContext.cpp
+ src/WallpaperEngine/Render/Shaders/CGLSLContext.h
src/WallpaperEngine/Render/Helpers/CContextAware.cpp
src/WallpaperEngine/Render/Helpers/CContextAware.h
+ src/WallpaperEngine/Render/Drivers/CVideoFactories.cpp
+ src/WallpaperEngine/Render/Drivers/CVideoFactories.h
+
src/WallpaperEngine/Render/Drivers/Detectors/CFullScreenDetector.cpp
src/WallpaperEngine/Render/Drivers/Detectors/CFullScreenDetector.h
@@ -339,11 +393,23 @@ add_executable(
src/WallpaperEngine/Render/Objects/Effects/CMaterial.h
src/WallpaperEngine/Render/Objects/Effects/CMaterial.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CRenderHandler.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CRenderHandler.h
+ src/WallpaperEngine/WebBrowser/CEF/CBrowserClient.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CBrowserClient.h
+ src/WallpaperEngine/WebBrowser/CEF/CBrowserApp.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CBrowserApp.h
+ src/WallpaperEngine/WebBrowser/CEF/CSubprocessApp.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CSubprocessApp.h
+ src/WallpaperEngine/WebBrowser/CEF/CWPSchemeHandlerFactory.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CWPSchemeHandlerFactory.h
+ src/WallpaperEngine/WebBrowser/CEF/CWPSchemeHandler.cpp
+ src/WallpaperEngine/WebBrowser/CEF/CWPSchemeHandler.h
src/WallpaperEngine/WebBrowser/CWebBrowserContext.cpp
src/WallpaperEngine/WebBrowser/CWebBrowserContext.h
- src/WallpaperEngine/FileSystem/FileSystem.cpp
- src/WallpaperEngine/FileSystem/FileSystem.h
+ src/WallpaperEngine/Core/DynamicValues/CDynamicValue.cpp
+ src/WallpaperEngine/Core/DynamicValues/CDynamicValue.h
src/WallpaperEngine/Core/UserSettings/CUserSettingValue.cpp
src/WallpaperEngine/Core/UserSettings/CUserSettingValue.h
@@ -403,12 +469,16 @@ add_executable(
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.cpp
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.cpp
+ src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.h
+ src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.cpp
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.h
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.cpp
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.cpp
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.cpp
+ src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.h
+ src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.cpp
src/WallpaperEngine/Core/Objects/Particles/CControlPoint.cpp
src/WallpaperEngine/Core/Objects/Particles/CControlPoint.h
@@ -442,17 +512,8 @@ add_executable(
${WAYLAND_SOURCES}
${X11_SOURCES}
-)
+ ${DEMOMODE_SOURCES})
-COPY_FILES(linux-wallpaperengine "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
-COPY_FILES(linux-wallpaperengine "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
-
-SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine)
-add_dependencies(linux-wallpaperengine libcef_dll_wrapper)
-
-# Need to remove libvulkan, otherwise will get error on linking:
-# /usr/bin/ld: /usr/lib/libmpv.so: undefined reference to `vkCreateXlibSurfaceKHR'
-file(REMOVE "${CEF_BINARY_DIR_DEBUG}/libvulkan.so.1" "${CEF_BINARY_DIR_RELEASE}/libvulkan.so.1")
target_link_libraries (linux-wallpaperengine PUBLIC
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
@@ -463,39 +524,26 @@ target_link_libraries (linux-wallpaperengine PUBLIC
${FFMPEG_LIBRARIES}
${MPV_LIBRARY}
${PULSEAUDIO_LIBRARY}
+ ${WAYLAND_LIBRARIES}
+ ${X11_LIBRARIES}
+ kissfft
+ glslang
+ spirv-cross-core
+ spirv-cross-glsl
glfw
- libcef_lib libcef_dll_wrapper)
+ libcef_lib
+ libcef_dll_wrapper
+ argparse)
+COPY_FILES(linux-wallpaperengine "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
+COPY_FILES(linux-wallpaperengine "${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")
-if (WAYLAND_SUPPORT_FOUND)
- target_link_libraries(linux-wallpaperengine PUBLIC
- pthread
- wayland-cursor
- wayland-client
- wayland-egl
- ${OPENGL_egl_LIBRARY})
-endif()
-
-if(X11_SUPPORT_FOUND)
- target_link_libraries (linux-wallpaperengine PUBLIC
- ${X11_LIBRARIES} ${X11_Xrandr_LIB})
-
-
- set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
-
- # make sure some of the X11 functions we'll use are available
- check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
-
- if(HAVE_XSETIOERROREXITHANDLER)
- add_compile_definitions(HAVE_XSETIOERROREXITHANDLER=1)
- endif()
-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_dependencies(linux-wallpaperengine libcef_dll_wrapper glslang spirv-cross-core spirv-cross-glsl)
+# custom version of cef's SET_EXECUTABLE_TARGET_PROPERTIES that fixes C files being compiled with the wrong parameters
+REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES(linux-wallpaperengine)
# set some install parameters if not in debug mode
install(DIRECTORY ${TARGET_OUTPUT_DIRECTORY}/ DESTINATION .)
install(FILES ${TARGET_OUTPUT_DIRECTORY}/${PROJECT_NAME} PERMISSIONS OWNER_READ OWNER_WRITE WORLD_EXECUTE WORLD_READ GROUP_READ DESTINATION .)
-install(DIRECTORY share/ DESTINATION ./share)
diff --git a/CMakeModules/DownloadCEF.cmake b/CMakeModules/DownloadCEF.cmake
index 2a40437..b780121 100644
--- a/CMakeModules/DownloadCEF.cmake
+++ b/CMakeModules/DownloadCEF.cmake
@@ -46,3 +46,83 @@ function(DownloadCEF platform version download_dir)
)
endif()
endfunction()
+
+
+# Set common target properties. Use SET_LIBRARY_TARGET_PROPERTIES() or
+# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
+macro(REPLACED_SET_COMMON_TARGET_PROPERTIES target)
+ # Compile flags. (MODIFIED FOR C/C++ SEPARATION)
+ target_compile_options(${target} PRIVATE $<$:${CEF_COMPILER_FLAGS}>)
+ target_compile_options(${target} PRIVATE $<$:${CEF_CXX_COMPILER_FLAGS}>)
+ target_compile_options(${target} PRIVATE $<$:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
+ target_compile_options(${target} PRIVATE $<$:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
+
+ # Compile definitions.
+ target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
+ target_compile_definitions(${target} PRIVATE $<$:${CEF_COMPILER_DEFINES_DEBUG}>)
+ target_compile_definitions(${target} PRIVATE $<$:${CEF_COMPILER_DEFINES_RELEASE}>)
+
+ # Include directories.
+ target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
+
+ # Linker flags.
+ if(CEF_LINKER_FLAGS)
+ string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
+ endif()
+ if(CEF_LINKER_FLAGS_DEBUG)
+ string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_DEBUG}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
+ endif()
+ if(CEF_LINKER_FLAGS_RELEASE)
+ string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_RELEASE}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
+ endif()
+
+ if(OS_MAC)
+ # Set Xcode target properties.
+ set_target_properties(${target} PROPERTIES
+ XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
+ XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++11" # -std=gnu++11
+ XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME NO # -fno-objc-link-runtime
+ XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS YES # -Wobjc-missing-property-synthesis
+ XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO
+ XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING[variant=Release] YES # -Wl,-dead_strip
+ XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD "c99" # -std=c99
+ XCODE_ATTRIBUTE_GCC_CW_ASM_SYNTAX NO # No -fasm-blocks
+ XCODE_ATTRIBUTE_GCC_DYNAMIC_NO_PIC NO
+ XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS NO # -fno-exceptions
+ XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI NO # -fno-rtti
+ XCODE_ATTRIBUTE_GCC_ENABLE_PASCAL_STRINGS NO # No -mpascal-strings
+ XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES # -fvisibility-inlines-hidden
+ XCODE_ATTRIBUTE_GCC_OBJC_CALL_CXX_CDTORS YES # -fobjc-call-cxx-cdtors
+ XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES # -fvisibility=hidden
+ XCODE_ATTRIBUTE_GCC_THREADSAFE_STATICS NO # -fno-threadsafe-statics
+ XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES # -Werror
+ XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0"
+ XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES # -Wnewline-eof
+ XCODE_ATTRIBUTE_USE_HEADERMAP NO
+ OSX_ARCHITECTURES_DEBUG "${CMAKE_OSX_ARCHITECTURES}"
+ OSX_ARCHITECTURES_RELEASE "${CMAKE_OSX_ARCHITECTURES}"
+ )
+ endif()
+endmacro()
+
+# Set executable-specific properties.
+macro(REPLACED_SET_EXECUTABLE_TARGET_PROPERTIES target)
+ REPLACED_SET_COMMON_TARGET_PROPERTIES(${target})
+
+ # Executable linker flags.
+ if(CEF_EXE_LINKER_FLAGS)
+ string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
+ endif()
+ if(CEF_EXE_LINKER_FLAGS_DEBUG)
+ string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_DEBUG}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
+ endif()
+ if(CEF_EXE_LINKER_FLAGS_RELEASE)
+ string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_RELEASE}")
+ set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
+ endif()
+endmacro()
diff --git a/CMakeModules/FindCEF.cmake b/CMakeModules/FindCEF.cmake
deleted file mode 100644
index cd33a7d..0000000
--- a/CMakeModules/FindCEF.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
-# reserved. Use of this source code is governed by a BSD-style license that
-# can be found in the LICENSE file.
-
-#
-# This file is the CEF CMake configuration entry point and should be loaded
-# using `find_package(CEF REQUIRED)`. See the top-level CMakeLists.txt file
-# included with the CEF binary distribution for usage information.
-#
-
-# Find the CEF binary distribution root directory.
-set(_CEF_ROOT "")
-if(CEF_ROOT AND IS_DIRECTORY "${CEF_ROOT}")
- set(_CEF_ROOT "${CEF_ROOT}")
- set(_CEF_ROOT_EXPLICIT 1)
-else()
- set(_ENV_CEF_ROOT "")
- if(DEFINED ENV{CEF_ROOT})
- file(TO_CMAKE_PATH "$ENV{CEF_ROOT}" _ENV_CEF_ROOT)
- endif()
- if(_ENV_CEF_ROOT AND IS_DIRECTORY "${_ENV_CEF_ROOT}")
- set(_CEF_ROOT "${_ENV_CEF_ROOT}")
- set(_CEF_ROOT_EXPLICIT 1)
- endif()
- unset(_ENV_CEF_ROOT)
-endif()
-
-if(NOT DEFINED _CEF_ROOT_EXPLICIT)
- message(FATAL_ERROR "Must specify a CEF_ROOT value via CMake or environment variable.")
-endif()
-
-if(NOT IS_DIRECTORY "${_CEF_ROOT}/cmake")
- message(FATAL_ERROR "No CMake bootstrap found for CEF binary distribution at: ${CEF_ROOT}.")
-endif()
-
-# Execute additional cmake files from the CEF binary distribution.
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CEF_ROOT}/cmake")
-include("cef_variables")
-include("cef_macros")
diff --git a/CMakeModules/cef_macros.cmake b/CMakeModules/cef_macros.cmake
deleted file mode 100644
index f357d06..0000000
--- a/CMakeModules/cef_macros.cmake
+++ /dev/null
@@ -1,387 +0,0 @@
-# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
-# reserved. Use of this source code is governed by a BSD-style license that
-# can be found in the LICENSE file.
-
-# Must be loaded via FindCEF.cmake.
-if(NOT DEFINED _CEF_ROOT_EXPLICIT)
- message(FATAL_ERROR "Use find_package(CEF) to load this file.")
-endif()
-
-
-#
-# Shared macros.
-#
-
-# Print the current CEF configuration.
-macro(PRINT_CEF_CONFIG)
- message(STATUS "*** CEF CONFIGURATION SETTINGS ***")
- message(STATUS "Generator: ${CMAKE_GENERATOR}")
- message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
- message(STATUS "Project architecture: ${PROJECT_ARCH}")
-
- if(GEN_NINJA OR GEN_MAKEFILES)
- message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
- endif()
-
- message(STATUS "Binary distribution root: ${_CEF_ROOT}")
-
- if(OS_MAC)
- message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
- message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
- endif()
-
- if(OS_WINDOWS)
- message(STATUS "Visual Studio ATL support: ${USE_ATL}")
- endif()
-
- message(STATUS "CEF sandbox: ${USE_SANDBOX}")
-
- set(_libraries ${CEF_STANDARD_LIBS})
- if(OS_WINDOWS AND USE_SANDBOX)
- list(APPEND _libraries ${CEF_SANDBOX_STANDARD_LIBS})
- endif()
- message(STATUS "Standard libraries: ${_libraries}")
-
- message(STATUS "Compile defines: ${CEF_COMPILER_DEFINES}")
- message(STATUS "Compile defines (Debug): ${CEF_COMPILER_DEFINES_DEBUG}")
- message(STATUS "Compile defines (Release): ${CEF_COMPILER_DEFINES_RELEASE}")
- message(STATUS "C compile flags: ${CEF_COMPILER_FLAGS} ${CEF_C_COMPILER_FLAGS}")
- message(STATUS "C compile flags (Debug): ${CEF_COMPILER_FLAGS_DEBUG} ${CEF_C_COMPILER_FLAGS_DEBUG}")
- message(STATUS "C compile flags (Release): ${CEF_COMPILER_FLAGS_RELEASE} ${CEF_C_COMPILER_FLAGS_RELEASE}")
- message(STATUS "C++ compile flags: ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS}")
- message(STATUS "C++ compile flags (Debug): ${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}")
- message(STATUS "C++ compile flags (Release): ${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}")
- message(STATUS "Exe link flags: ${CEF_LINKER_FLAGS} ${CEF_EXE_LINKER_FLAGS}")
- message(STATUS "Exe link flags (Debug): ${CEF_LINKER_FLAGS_DEBUG} ${CEF_EXE_LINKER_FLAGS_DEBUG}")
- message(STATUS "Exe link flags (Release): ${CEF_LINKER_FLAGS_RELEASE} ${CEF_EXE_LINKER_FLAGS_RELEASE}")
- message(STATUS "Shared link flags: ${CEF_LINKER_FLAGS} ${CEF_SHARED_LINKER_FLAGS}")
- message(STATUS "Shared link flags (Debug): ${CEF_LINKER_FLAGS_DEBUG} ${CEF_SHARED_LINKER_FLAGS_DEBUG}")
- message(STATUS "Shared link flags (Release): ${CEF_LINKER_FLAGS_RELEASE} ${CEF_SHARED_LINKER_FLAGS_RELEASE}")
-
- if(OS_LINUX OR OS_WINDOWS)
- message(STATUS "CEF Binary files: ${CEF_BINARY_FILES}")
- message(STATUS "CEF Resource files: ${CEF_RESOURCE_FILES}")
- endif()
-endmacro()
-
-# Append platform specific sources to a list of sources.
-macro(APPEND_PLATFORM_SOURCES name_of_list)
- if(OS_LINUX AND ${name_of_list}_LINUX)
- list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
- endif()
- if(OS_POSIX AND ${name_of_list}_POSIX)
- list(APPEND ${name_of_list} ${${name_of_list}_POSIX})
- endif()
- if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
- list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
- endif()
- if(OS_MAC AND ${name_of_list}_MAC)
- list(APPEND ${name_of_list} ${${name_of_list}_MAC})
- endif()
-endmacro()
-
-# Determine the target output directory based on platform and generator.
-macro(SET_CEF_TARGET_OUT_DIR)
- if(GEN_NINJA OR GEN_MAKEFILES)
- # By default Ninja and Make builds don't create a subdirectory named after
- # the configuration.
- set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
-
- # Output binaries (executables, libraries) to the correct directory.
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
- else()
- set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$")
- endif()
-endmacro()
-
-# Copy a list of files from one directory to another. Relative file paths are maintained.
-macro(COPY_FILES target file_list source_dir target_dir)
- foreach(FILENAME ${file_list})
- set(source_file ${source_dir}/${FILENAME})
-
- # Remove the target file path component.
- get_filename_component(target_name ${FILENAME} NAME)
- set(target_file ${target_dir}/${target_name})
-
- COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
- endforeach()
-endmacro()
-
-# Copy a list of files from one directory to another. Relative file paths are maintained.
-macro(COPY_RESOURCES target file_list prefix_list source_dir target_dir)
- foreach(FILENAME ${file_list})
- set(source_file ${source_dir}/${FILENAME})
-
- # Remove one or more prefixes from the source paths.
- set(TARGET_FILENAME "${FILENAME}")
- foreach(PREFIX ${prefix_list})
- string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
- endforeach()
- set(target_file ${target_dir}/${TARGET_FILENAME})
-
- COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
- endforeach()
-endmacro()
-
-macro(COPY_SINGLE_FILE target source_file target_file)
- string(FIND ${source_file} "$" _pos)
- if(NOT ${_pos} EQUAL -1)
- # Must test with an actual configuration directory.
- string(REPLACE "$" "Release" existing_source_file ${source_file})
- if(NOT EXISTS ${existing_source_file})
- string(REPLACE "$" "Debug" existing_source_file ${source_file})
- endif()
- else()
- set(existing_source_file ${source_file})
- endif()
-
- if(IS_DIRECTORY ${existing_source_file})
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}"
- VERBATIM
- )
- else()
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}"
- VERBATIM
- )
- endif()
-endmacro()
-
-
-#
-# Linux macros.
-#
-
-if(OS_LINUX)
-
-# Use pkg-config to find Linux libraries and update compiler/linker variables.
-macro(FIND_LINUX_LIBRARIES libraries)
- # Read pkg-config info into variables.
- execute_process(COMMAND pkg-config --cflags ${libraries} OUTPUT_VARIABLE FLL_CFLAGS)
- execute_process(COMMAND pkg-config --libs-only-L --libs-only-other ${libraries} OUTPUT_VARIABLE FLL_LDFLAGS)
- execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS)
-
- # Strip leading and trailing whitepspace.
- STRING(STRIP "${FLL_CFLAGS}" FLL_CFLAGS)
- STRING(STRIP "${FLL_LDFLAGS}" FLL_LDFLAGS)
- STRING(STRIP "${FLL_LIBS}" FLL_LIBS)
-
- # Convert to a list.
- separate_arguments(FLL_CFLAGS)
- separate_arguments(FLL_LDFLAGS)
- separate_arguments(FLL_LIBS)
-
- # Update build variables.
- list(APPEND CEF_C_COMPILER_FLAGS ${FLL_CFLAGS})
- list(APPEND CEF_CXX_COMPILER_FLAGS ${FLL_CFLAGS})
- list(APPEND CEF_EXE_LINKER_FLAGS ${FLL_LDFLAGS})
- list(APPEND CEF_SHARED_LINKER_FLAGS ${FLL_LDFLAGS})
- list(APPEND CEF_STANDARD_LIBS ${FLL_LIBS})
-endmacro()
-
-# Set SUID permissions on the specified executable.
-macro(SET_LINUX_SUID_PERMISSIONS target executable)
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E echo ""
- COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following command manually to set SUID permissions ***"
- COMMAND ${CMAKE_COMMAND} -E echo "EXE=\"${executable}\" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE"
- COMMAND ${CMAKE_COMMAND} -E echo ""
- VERBATIM
- )
-endmacro()
-
-endif(OS_LINUX)
-
-
-#
-# Mac OS X macros.
-#
-
-if(OS_MAC)
-
-# Manually process and copy over resource files.
-macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
- foreach(FILENAME ${resource_list})
- # Remove one or more prefixes from the source paths.
- set(TARGET_FILENAME "${FILENAME}")
- foreach(PREFIX ${prefix_list})
- string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
- endforeach()
-
- # Determine the absolute source and target paths.
- set(TARGET_PATH "${app_path}/Contents/Resources/${TARGET_FILENAME}")
- if(IS_ABSOLUTE ${FILENAME})
- set(SOURCE_PATH ${FILENAME})
- else()
- set(SOURCE_PATH "${source_dir}/${FILENAME}")
- endif()
-
- if(${FILENAME} MATCHES ".xib$")
- # Change the target file extension.
- string(REGEX REPLACE ".xib$" ".nib" TARGET_PATH ${TARGET_PATH})
-
- get_filename_component(TARGET_DIRECTORY ${TARGET_PATH} PATH)
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- # Create the target directory.
- COMMAND ${CMAKE_COMMAND} -E make_directory "${TARGET_DIRECTORY}"
- # Compile the XIB file to a NIB.
- COMMAND /usr/bin/ibtool --output-format binary1 --compile "${TARGET_PATH}" "${SOURCE_PATH}"
- VERBATIM
- )
- elseif(NOT ${TARGET_FILENAME} STREQUAL "Info.plist")
- # Copy the file as-is.
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_PATH}" "${TARGET_PATH}"
- VERBATIM
- )
- endif()
- endforeach()
-endmacro()
-
-endif(OS_MAC)
-
-
-#
-# Windows macros.
-#
-
-if(OS_WINDOWS)
-
-# Add custom manifest files to an executable target.
-macro(ADD_WINDOWS_MANIFEST manifest_path target extension)
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND "mt.exe" -nologo
- -manifest \"${manifest_path}/${target}.${extension}.manifest\" \"${manifest_path}/compatibility.manifest\"
- -outputresource:"${CEF_TARGET_OUT_DIR}/${target}.${extension}"\;\#1
- COMMENT "Adding manifest..."
- )
-endmacro()
-
-endif(OS_WINDOWS)
-
-
-#
-# Target configuration macros.
-#
-
-# Add a logical target that can be used to link the specified libraries into an
-# executable target.
-macro(ADD_LOGICAL_TARGET target debug_lib release_lib)
- add_library(${target} ${CEF_LIBTYPE} IMPORTED)
- set_target_properties(${target} PROPERTIES
- IMPORTED_LOCATION "${release_lib}"
- IMPORTED_LOCATION_DEBUG "${debug_lib}"
- IMPORTED_LOCATION_RELEASE "${release_lib}"
- )
-endmacro()
-
-# Set common target properties. Use SET_LIBRARY_TARGET_PROPERTIES() or
-# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
-macro(SET_COMMON_TARGET_PROPERTIES target)
- # Compile flags.
- target_compile_options(${target} PRIVATE ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
- target_compile_options(${target} PRIVATE $<$:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
- target_compile_options(${target} PRIVATE $<$:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
-
- # Compile definitions.
- target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
- target_compile_definitions(${target} PRIVATE $<$:${CEF_COMPILER_DEFINES_DEBUG}>)
- target_compile_definitions(${target} PRIVATE $<$:${CEF_COMPILER_DEFINES_RELEASE}>)
-
- # Include directories.
- target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
-
- # Linker flags.
- if(CEF_LINKER_FLAGS)
- string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
- endif()
- if(CEF_LINKER_FLAGS_DEBUG)
- string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_DEBUG}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
- endif()
- if(CEF_LINKER_FLAGS_RELEASE)
- string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_RELEASE}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
- endif()
-
- if(OS_MAC)
- # Set Xcode target properties.
- set_target_properties(${target} PROPERTIES
- XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
- XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++11" # -std=gnu++11
- XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME NO # -fno-objc-link-runtime
- XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS YES # -Wobjc-missing-property-synthesis
- XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO
- XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING[variant=Release] YES # -Wl,-dead_strip
- XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD "c99" # -std=c99
- XCODE_ATTRIBUTE_GCC_CW_ASM_SYNTAX NO # No -fasm-blocks
- XCODE_ATTRIBUTE_GCC_DYNAMIC_NO_PIC NO
- XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS NO # -fno-exceptions
- XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI NO # -fno-rtti
- XCODE_ATTRIBUTE_GCC_ENABLE_PASCAL_STRINGS NO # No -mpascal-strings
- XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES # -fvisibility-inlines-hidden
- XCODE_ATTRIBUTE_GCC_OBJC_CALL_CXX_CDTORS YES # -fobjc-call-cxx-cdtors
- XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES # -fvisibility=hidden
- XCODE_ATTRIBUTE_GCC_THREADSAFE_STATICS NO # -fno-threadsafe-statics
- XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES # -Werror
- XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0"
- XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES # -Wnewline-eof
- XCODE_ATTRIBUTE_USE_HEADERMAP NO
- OSX_ARCHITECTURES_DEBUG "${CMAKE_OSX_ARCHITECTURES}"
- OSX_ARCHITECTURES_RELEASE "${CMAKE_OSX_ARCHITECTURES}"
- )
- endif()
-endmacro()
-
-# Set library-specific properties.
-macro(SET_LIBRARY_TARGET_PROPERTIES target)
- SET_COMMON_TARGET_PROPERTIES(${target})
-
- # Shared library linker flags.
- if(CEF_SHARED_LINKER_FLAGS)
- string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
- endif()
- if(CEF_SHARED_LINKER_FLAGS_DEBUG)
- string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS_DEBUG}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
- endif()
- if(CEF_SHARED_LINKER_FLAGS_RELEASE)
- string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS_RELEASE}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
- endif()
-endmacro()
-
-# Set executable-specific properties.
-macro(SET_EXECUTABLE_TARGET_PROPERTIES target)
- SET_COMMON_TARGET_PROPERTIES(${target})
-
- # Executable linker flags.
- if(CEF_EXE_LINKER_FLAGS)
- string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
- endif()
- if(CEF_EXE_LINKER_FLAGS_DEBUG)
- string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_DEBUG}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
- endif()
- if(CEF_EXE_LINKER_FLAGS_RELEASE)
- string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_RELEASE}")
- set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
- endif()
-endmacro()
diff --git a/CMakeModules/cef_variables.cmake b/CMakeModules/cef_variables.cmake
deleted file mode 100644
index a3d78fb..0000000
--- a/CMakeModules/cef_variables.cmake
+++ /dev/null
@@ -1,582 +0,0 @@
-# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
-# reserved. Use of this source code is governed by a BSD-style license that
-# can be found in the LICENSE file.
-
-# Must be loaded via FindCEF.cmake.
-if(NOT DEFINED _CEF_ROOT_EXPLICIT)
- message(FATAL_ERROR "Use find_package(CEF) to load this file.")
-endif()
-
-
-#
-# Shared configuration.
-#
-
-# Determine the platform.
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- set(OS_MAC 1)
- set(OS_MACOSX 1) # For backwards compatibility.
- set(OS_POSIX 1)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- set(OS_LINUX 1)
- set(OS_POSIX 1)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
- set(OS_WINDOWS 1)
-endif()
-
-# Determine the project architecture.
-if(NOT DEFINED PROJECT_ARCH)
- if(("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") OR
- ("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64"))
- set(PROJECT_ARCH "arm64")
- elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
- set(PROJECT_ARCH "x86_64")
- else()
- set(PROJECT_ARCH "x86")
- endif()
-endif()
-
-if(${CMAKE_GENERATOR} STREQUAL "Ninja")
- set(GEN_NINJA 1)
-elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
- set(GEN_MAKEFILES 1)
-endif()
-
-# Determine the build type.
-if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
- # CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
- set(CMAKE_BUILD_TYPE Release)
- message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
-endif()
-
-
-# Path to the include directory.
-set(CEF_INCLUDE_PATH "${_CEF_ROOT}")
-
-# Path to the libcef_dll_wrapper target.
-set(CEF_LIBCEF_DLL_WRAPPER_PATH "${_CEF_ROOT}/libcef_dll")
-
-
-# Shared compiler/linker flags.
-list(APPEND CEF_COMPILER_DEFINES
- # Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't
- # in the C++ standard (e.g. UINT8_MAX, INT64_MIN, etc)
- __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS
- )
-
-
-# Configure use of the sandbox.
-option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
-
-
-#
-# Linux configuration.
-#
-
-if(OS_LINUX)
- # Platform-specific compiler/linker flags.
- set(CEF_LIBTYPE SHARED)
- list(APPEND CEF_COMPILER_FLAGS
- -fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
- -fPIC # Generate position-independent code for shared libraries
- -fstack-protector # Protect some vulnerable functions from stack-smashing (security feature)
- -funwind-tables # Support stack unwinding for backtrace()
- -fvisibility=hidden # Give hidden visibility to declarations that are not explicitly marked as visible
- --param=ssp-buffer-size=4 # Set the minimum buffer size protected by SSP (security feature, related to stack-protector)
- -pipe # Use pipes rather than temporary files for communication between build stages
- -pthread # Use the pthread library
- # -Wall # Enable all warnings
- # -Werror # Treat warnings as errors
- # -Wno-missing-field-initializers # Don't warn about missing field initializers
- # -Wno-unused-parameter # Don't warn about unused parameters
- # -Wno-error=comment # Don't warn about code in comments
- # -Wno-comment # Don't warn about code in comments
- # -Wno-deprecated-declarations # Don't warn about using deprecated methods
- )
- list(APPEND CEF_C_COMPILER_FLAGS
- -std=c99 # Use the C99 language standard
- )
- list(APPEND CEF_CXX_COMPILER_FLAGS
- # -fno-exceptions # Disable exceptions
- # -fno-rtti # Disable real-time type information
- -fno-threadsafe-statics # Don't generate thread-safe statics
- -fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
- -std=c++17 # Use the C++17 language standard
- -Wsign-compare # Warn about mixed signed/unsigned type comparisons
- )
- list(APPEND CEF_COMPILER_FLAGS_DEBUG
- -O0 # Disable optimizations
- -g # Generate debug information
- )
- list(APPEND CEF_COMPILER_FLAGS_RELEASE
- -O2 # Optimize for maximum speed
- -fdata-sections # Enable linker optimizations to improve locality of reference for data sections
- -ffunction-sections # Enable linker optimizations to improve locality of reference for function sections
- -fno-ident # Ignore the #ident directive
- -U_FORTIFY_SOURCE # Undefine _FORTIFY_SOURCE in case it was previously defined
- -D_FORTIFY_SOURCE=2 # Add memory and string function protection (security feature, related to stack-protector)
- )
- list(APPEND CEF_LINKER_FLAGS
- -fPIC # Generate position-independent code for shared libraries
- -pthread # Use the pthread library
- -Wl,--disable-new-dtags # Don't generate new-style dynamic tags in ELF
- -Wl,--fatal-warnings # Treat warnings as errors
- -Wl,-rpath,. # Set rpath so that libraries can be placed next to the executable
- -Wl,-z,noexecstack # Mark the stack as non-executable (security feature)
- -Wl,-z,now # Resolve symbols on program start instead of on first use (security feature)
- -Wl,-z,relro # Mark relocation sections as read-only (security feature)
- )
- list(APPEND CEF_LINKER_FLAGS_RELEASE
- -Wl,-O1 # Enable linker optimizations
- -Wl,--as-needed # Only link libraries that export symbols used by the binary
- -Wl,--gc-sections # Remove unused code resulting from -fdata-sections and -function-sections
- )
- list(APPEND CEF_COMPILER_DEFINES
- _FILE_OFFSET_BITS=64 # Allow the Large File Support (LFS) interface to replace the old interface
- )
- list(APPEND CEF_COMPILER_DEFINES_RELEASE
- NDEBUG # Not a debug build
- )
-
- include(CheckCCompilerFlag)
- include(CheckCXXCompilerFlag)
-
- CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
- if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
- list(APPEND CEF_CXX_COMPILER_FLAGS
- -Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
- )
- endif()
-
- CHECK_C_COMPILER_FLAG(-Wno-unused-local-typedefs COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
- if(COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
- list(APPEND CEF_C_COMPILER_FLAGS
- -Wno-unused-local-typedefs # Don't warn about unused local typedefs
- )
- endif()
-
- CHECK_CXX_COMPILER_FLAG(-Wno-literal-suffix COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
- if(COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
- list(APPEND CEF_CXX_COMPILER_FLAGS
- -Wno-literal-suffix # Don't warn about invalid suffixes on literals
- )
- endif()
-
- CHECK_CXX_COMPILER_FLAG(-Wno-narrowing COMPILER_SUPPORTS_NO_NARROWING)
- if(COMPILER_SUPPORTS_NO_NARROWING)
- list(APPEND CEF_CXX_COMPILER_FLAGS
- -Wno-narrowing # Don't warn about type narrowing
- )
- endif()
-
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- list(APPEND CEF_CXX_COMPILER_FLAGS
- -Wno-attributes # The cfi-icall attribute is not supported by the GNU C++ compiler
- )
- endif()
-
- if(PROJECT_ARCH STREQUAL "x86_64")
- # 64-bit architecture.
- list(APPEND CEF_COMPILER_FLAGS
- -m64
- -march=x86-64
- )
- list(APPEND CEF_LINKER_FLAGS
- -m64
- )
- elseif(PROJECT_ARCH STREQUAL "x86")
- # 32-bit architecture.
- list(APPEND CEF_COMPILER_FLAGS
- -msse2
- -mfpmath=sse
- -mmmx
- -m32
- )
- list(APPEND CEF_LINKER_FLAGS
- -m32
- )
- endif()
-
- # Standard libraries.
- set(CEF_STANDARD_LIBS
- X11
- )
-
- # CEF directory paths.
- set(CEF_RESOURCE_DIR "${_CEF_ROOT}/Resources")
- set(CEF_BINARY_DIR "${_CEF_ROOT}/${CMAKE_BUILD_TYPE}")
- set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
- set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
-
- # CEF library paths.
- set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/libcef.so")
- set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.so")
-
- # List of CEF binary files.
- set(CEF_BINARY_FILES
- chrome-sandbox
- libcef.so
- libEGL.so
- libGLESv2.so
- libvk_swiftshader.so
- # libvulkan.so.1
- snapshot_blob.bin
- v8_context_snapshot.bin
- vk_swiftshader_icd.json
- )
-
- # List of CEF resource files.
- set(CEF_RESOURCE_FILES
- chrome_100_percent.pak
- chrome_200_percent.pak
- resources.pak
- icudtl.dat
- locales
- )
-
- if(USE_SANDBOX)
- list(APPEND CEF_COMPILER_DEFINES
- CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
- )
- endif()
-endif()
-
-
-#
-# Mac OS X configuration.
-#
-
-if(OS_MAC)
- # Platform-specific compiler/linker flags.
- # See also Xcode target properties in cef_macros.cmake.
- set(CEF_LIBTYPE SHARED)
- list(APPEND CEF_COMPILER_FLAGS
- -fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
- -fstack-protector # Protect some vulnerable functions from stack-smashing (security feature)
- -funwind-tables # Support stack unwinding for backtrace()
- -fvisibility=hidden # Give hidden visibility to declarations that are not explicitly marked as visible
- -Wall # Enable all warnings
- -Werror # Treat warnings as errors
- -Wextra # Enable additional warnings
- -Wendif-labels # Warn whenever an #else or an #endif is followed by text
- -Wnewline-eof # Warn about no newline at end of file
- -Wno-missing-field-initializers # Don't warn about missing field initializers
- -Wno-unused-parameter # Don't warn about unused parameters
- )
- list(APPEND CEF_C_COMPILER_FLAGS
- -std=c99 # Use the C99 language standard
- )
- list(APPEND CEF_CXX_COMPILER_FLAGS
- # -fno-exceptions # Disable exceptions
- # -fno-rtti # Disable real-time type information
- -fno-threadsafe-statics # Don't generate thread-safe statics
- -fobjc-call-cxx-cdtors # Call the constructor/destructor of C++ instance variables in ObjC objects
- -fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
- -std=c++17 # Use the C++17 language standard
- -Wno-narrowing # Don't warn about type narrowing
- -Wsign-compare # Warn about mixed signed/unsigned type comparisons
- )
- list(APPEND CEF_COMPILER_FLAGS_DEBUG
- -O0 # Disable optimizations
- -g # Generate debug information
- )
- list(APPEND CEF_COMPILER_FLAGS_RELEASE
- -O3 # Optimize for maximum speed plus a few extras
- )
- list(APPEND CEF_LINKER_FLAGS
- -Wl,-search_paths_first # Search for static or shared library versions in the same pass
- -Wl,-ObjC # Support creation of ObjC static libraries
- -Wl,-pie # Generate position-independent code suitable for executables only
- )
- list(APPEND CEF_LINKER_FLAGS_RELEASE
- -Wl,-dead_strip # Strip dead code
- )
-
- include(CheckCXXCompilerFlag)
-
- CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
- if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
- list(APPEND CEF_CXX_COMPILER_FLAGS
- -Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
- )
- endif()
-
- # Standard libraries.
- set(CEF_STANDARD_LIBS
- -lpthread
- "-framework Cocoa"
- "-framework AppKit"
- )
-
- # Find the newest available base SDK.
- execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
- foreach(OS_VERSION 10.15 10.14 10.13)
- set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
- if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
- set(CMAKE_OSX_SYSROOT ${SDK})
- endif()
- endforeach()
-
- # Target SDK.
- set(CEF_TARGET_SDK "10.13")
- list(APPEND CEF_COMPILER_FLAGS
- -mmacosx-version-min=${CEF_TARGET_SDK}
- )
- set(CMAKE_OSX_DEPLOYMENT_TARGET ${CEF_TARGET_SDK})
-
- # Target architecture.
- if(PROJECT_ARCH STREQUAL "x86_64")
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
- elseif(PROJECT_ARCH STREQUAL "arm64")
- set(CMAKE_OSX_ARCHITECTURES "arm64")
- else()
- set(CMAKE_OSX_ARCHITECTURES "i386")
- endif()
-
- # Prevent Xcode 11 from doing automatic codesigning.
- set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
-
- # CEF directory paths.
- set(CEF_BINARY_DIR "${_CEF_ROOT}/$")
- set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
- set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
-
- if(USE_SANDBOX)
- list(APPEND CEF_COMPILER_DEFINES
- CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
- )
-
- list(APPEND CEF_STANDARD_LIBS
- -lsandbox
- )
-
- # CEF sandbox library paths.
- set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
- set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
- endif()
-
- # CEF Helper app suffixes.
- # Format is "::".
- set(CEF_HELPER_APP_SUFFIXES
- "::"
- " (Alerts):_alerts:.alerts"
- " (GPU):_gpu:.gpu"
- " (Plugin):_plugin:.plugin"
- " (Renderer):_renderer:.renderer"
- )
-endif()
-
-
-#
-# Windows configuration.
-#
-
-if(OS_WINDOWS)
- if (GEN_NINJA)
- # When using the Ninja generator clear the CMake defaults to avoid excessive
- # console warnings (see issue #2120).
- set(CMAKE_CXX_FLAGS "")
- set(CMAKE_CXX_FLAGS_DEBUG "")
- set(CMAKE_CXX_FLAGS_RELEASE "")
- endif()
-
- if(USE_SANDBOX)
- # Check if the current MSVC version is compatible with the cef_sandbox.lib
- # static library. We require VS2015 or newer.
- if(MSVC_VERSION LESS 1900)
- message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
- set(USE_SANDBOX OFF)
- endif()
- endif()
-
- # Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
- set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
-
- # Consumers using different runtime types may want to pass different flags
- set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
- if (CEF_RUNTIME_LIBRARY_FLAG)
- list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
- list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
- endif()
-
- # Platform-specific compiler/linker flags.
- set(CEF_LIBTYPE STATIC)
- list(APPEND CEF_COMPILER_FLAGS
- /MP # Multiprocess compilation
- /Gy # Enable function-level linking
- /GR- # Disable run-time type information
- /W4 # Warning level 4
- /WX # Treat warnings as errors
- /wd4100 # Ignore "unreferenced formal parameter" warning
- /wd4127 # Ignore "conditional expression is constant" warning
- /wd4244 # Ignore "conversion possible loss of data" warning
- /wd4324 # Ignore "structure was padded due to alignment specifier" warning
- /wd4481 # Ignore "nonstandard extension used: override" warning
- /wd4512 # Ignore "assignment operator could not be generated" warning
- /wd4701 # Ignore "potentially uninitialized local variable" warning
- /wd4702 # Ignore "unreachable code" warning
- /wd4996 # Ignore "function or variable may be unsafe" warning
- ${CEF_DEBUG_INFO_FLAG}
- )
- list(APPEND CEF_COMPILER_FLAGS_DEBUG
- /RTC1 # Disable optimizations
- /Od # Enable basic run-time checks
- )
- list(APPEND CEF_COMPILER_FLAGS_RELEASE
- /O2 # Optimize for maximum speed
- /Ob2 # Inline any suitable function
- /GF # Enable string pooling
- )
- list(APPEND CEF_CXX_COMPILER_FLAGS
- /std:c++17 # Use the C++17 language standard
- )
- list(APPEND CEF_LINKER_FLAGS_DEBUG
- /DEBUG # Generate debug information
- )
- list(APPEND CEF_EXE_LINKER_FLAGS
- /MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
- /LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
- )
- list(APPEND CEF_COMPILER_DEFINES
- WIN32 _WIN32 _WINDOWS # Windows platform
- UNICODE _UNICODE # Unicode build
- # Targeting Windows 10. We can't say `=_WIN32_WINNT_WIN10` here because
- # some files do `#if WINVER < 0x0600` without including windows.h before,
- # and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00.
- WINVER=0x0A00
- _WIN32_WINNT=0x0A00
- NTDDI_VERSION=NTDDI_WIN10_FE
- NOMINMAX # Use the standard's templated min/max
- WIN32_LEAN_AND_MEAN # Exclude less common API declarations
- _HAS_EXCEPTIONS=0 # Disable exceptions
- )
- list(APPEND CEF_COMPILER_DEFINES_RELEASE
- NDEBUG _NDEBUG # Not a debug build
- )
-
- if(PROJECT_ARCH STREQUAL "x86")
- # Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
- # needed by CEF's main thread. This saves significant memory on threads
- # (like those in the Windows thread pool, and others) whose stack size we
- # can only control through this setting. The main thread (in 32-bit builds
- # only) uses fibers to switch to a 4MiB stack at runtime via
- # CefRunWinMainWithPreferredStackSize().
- list(APPEND CEF_EXE_LINKER_FLAGS
- /STACK:0x80000
- )
- else()
- # Increase the initial stack size to 8MiB from the default 1MiB.
- list(APPEND CEF_EXE_LINKER_FLAGS
- /STACK:0x800000
- )
- endif()
-
- # Standard libraries.
- set(CEF_STANDARD_LIBS
- comctl32.lib
- gdi32.lib
- rpcrt4.lib
- shlwapi.lib
- ws2_32.lib
- )
-
- # CEF directory paths.
- set(CEF_RESOURCE_DIR "${_CEF_ROOT}/Resources")
- set(CEF_BINARY_DIR "${_CEF_ROOT}/$")
- set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
- set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
-
- # CEF library paths.
- set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/libcef.lib")
- set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.lib")
-
- # List of CEF binary files.
- set(CEF_BINARY_FILES
- chrome_elf.dll
- d3dcompiler_47.dll
- libcef.dll
- libEGL.dll
- libGLESv2.dll
- snapshot_blob.bin
- v8_context_snapshot.bin
- vk_swiftshader.dll
- vk_swiftshader_icd.json
- vulkan-1.dll
- )
-
- # List of CEF resource files.
- set(CEF_RESOURCE_FILES
- chrome_100_percent.pak
- chrome_200_percent.pak
- resources.pak
- icudtl.dat
- locales
- )
-
- if(USE_SANDBOX)
- list(APPEND CEF_COMPILER_DEFINES
- PSAPI_VERSION=1 # Required by cef_sandbox.lib
- CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
- )
- list(APPEND CEF_COMPILER_DEFINES_DEBUG
- _HAS_ITERATOR_DEBUGGING=0 # Disable iterator debugging
- )
-
- # Libraries required by cef_sandbox.lib.
- set(CEF_SANDBOX_STANDARD_LIBS
- Advapi32.lib
- dbghelp.lib
- Delayimp.lib
- ntdll.lib
- OleAut32.lib
- PowrProf.lib
- Propsys.lib
- psapi.lib
- SetupAPI.lib
- Shell32.lib
- Shcore.lib
- Userenv.lib
- version.lib
- wbemuuid.lib
- WindowsApp.lib
- winmm.lib
- )
-
- # CEF sandbox library paths.
- set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.lib")
- set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.lib")
- endif()
-
- # Configure use of ATL.
- option(USE_ATL "Enable or disable use of ATL." ON)
- if(USE_ATL)
- # Locate the atlmfc directory if it exists. It may be at any depth inside
- # the VC directory. The cl.exe path returned by CMAKE_CXX_COMPILER may also
- # be at different depths depending on the toolchain version
- # (e.g. "VC/bin/cl.exe", "VC/bin/amd64_x86/cl.exe",
- # "VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe", etc).
- set(HAS_ATLMFC 0)
- get_filename_component(VC_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
- get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
- while(NOT ${VC_DIR_NAME} STREQUAL "VC")
- get_filename_component(VC_DIR ${VC_DIR} DIRECTORY)
- if(IS_DIRECTORY "${VC_DIR}/atlmfc")
- set(HAS_ATLMFC 1)
- break()
- endif()
- get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
- endwhile()
-
- # Determine if the Visual Studio install supports ATL.
- if(NOT HAS_ATLMFC)
- message(WARNING "ATL is not supported by your VC installation.")
- set(USE_ATL OFF)
- endif()
- endif()
-
- if(USE_ATL)
- list(APPEND CEF_COMPILER_DEFINES
- CEF_USE_ATL # Used by apps to test if ATL support is enabled
- )
- endif()
-endif()
diff --git a/README.md b/README.md
index 3c7bb11..4b4b7cf 100644
--- a/README.md
+++ b/README.md
@@ -7,160 +7,193 @@
+
-# 1. Disclaimer
-**This is an educational project**. Although the project started as a learning exercise on the Irrlicht Engine, it has kind of turned into an OpenGL one instead due to limitations and issues with Irrlicht (most likely caused by my limited experience with graphics programming). As it turns out, working directly with OpenGL is not as hard as I thought. For more information on the project's license, check [LICENSE](LICENSE).
+# 🖼️ Linux Wallpaper Engine
-# 2. What is this project all about?
-This project aims to reproduce the background functionality of Wallpaper Engine on Linux systems. Simple as that.
+Bring **Wallpaper Engine**-style live wallpapers to Linux! This project allows you to run animated wallpapers from Steam’s Wallpaper Engine right on your desktop.
-# 3. What is Wallpaper Engine?
-Wallpaper Engine is a software designed by [Kristjan Skutta](https://store.steampowered.com/search/?developer=Kristjan%20Skutta&snr=1_5_9__400) that provides live wallpaper functionality to Windows Systems, allowing its users to animate their own backgrounds and share their own creations. You can find more about it on their [Steam page](https://store.steampowered.com/app/431960/Wallpaper_Engine/).
+> ⚠️ This is an educational project that evolved into a functional OpenGL-based wallpaper engine for Linux. Expect some limitations and quirks!
+
+---
+
+## 📦 System Requirements
+
+To compile and run this, you'll need:
-# 4. Compilation requirements
-## linux-wallpaperengine
- OpenGL 3.3 support
- CMake
-- LZ4
-- ZLIB
+- LZ4, Zlib
- SDL2
- FFmpeg
-- X11 (with libxxf86vm) or Wayland
-- Xrandr (for X11 support)
-- GLFW3
-- GLM
-- GLEW
-- GLUT
+- X11 or Wayland
+- Xrandr (for X11)
+- GLFW3, GLEW, GLUT, GLM
- MPV
- PulseAudio
+- FFTW3
-## Commands
-```
+Install the required dependencies on Ubuntu/Debian-based systems:
+
+### Ubuntu 22.04
+```bash
sudo apt-get update
-sudo apt-get install build-essential cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0
+sudo apt-get install build-essential cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev
```
-# 5. How to use
-## 5.1. Pre-requirements
-In order to properly use this software you'll need to own an actual copy of the Windows version of Wallpaper Engine (which you can buy on the [Steam Page](https://store.steampowered.com/app/431960/Wallpaper_Engine/)), as it contains some basic assets on which most of the backgrounds are based on.
-
-The only way to get those assets is to install the Windows version through Steam. Luckily you don't really need a Windows installation for that. Using the Linux Steam client is enough to download the files we need. Note you may need to check "Enable Steam Play for all other titles" in the Steam Play section of Steam's settings if you haven't already. Also note that the software cannot actually be launched through Steam Play (Proton), but the setting is required for Steam to download the software.
-
-## 5.2. Extracting the assets
-The automatic way doesn't require anything extra, as long as Wallpaper Engine is installed in Steam the software should automatically detect where the assets are.
-
-### 5.2.1. Extracting the assets manually
-In the off-case where the software doesn't automatically detect the correct path, the assets can be extracted manually. Once Wallpaper Engine is downloaded, open the installation folder (Right-Click the application in Steam -> Manage -> Browse local files). Here you'll see the main folders of Wallpaper Engine. The folder we're interested in is the one named "assets".
-
-
-
-The assets folder itself **must** be copied to the same folder where the binary lives.
-
-## 5.3. Getting the sources
-You can download a zipped version of the repository here: https://github.com/Almamu/linux-wallpaperengine/archive/refs/heads/main.zip
-
-You can also clone the repository using git like this:
-```
-git clone git@github.com:Almamu/linux-wallpaperengine.git
+### Ubuntu 24.04
+```bash
+sudo apt-get update
+sudo apt-get install build-essential cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev
```
-Or using the HTTPS method if you haven't set up SSH:
-```
-https://github.com/Almamu/linux-wallpaperengine.git
+---
+
+## 🐧 Arch Linux Users
+
+You can install this directly from the AUR using your favorite AUR helper:
+
+```bash
+yay -S linux-wallpaperengine-git
```
-## 5.4. Compilation steps
-The project is built on CMake as the build engine. First we need to create the directory where the build will be stored and get into it:
+> This installs the latest development version.
+
+**Note:** You’ll still need assets from the official Wallpaper Engine (via Steam). See below for details.
+
+---
+
+## 🚀 Getting Started
+
+### 1. Get Wallpaper Engine Assets
+
+You **must own and install Wallpaper Engine** via Steam. This provides the required assets used by many backgrounds.
+
+Good news: **you usually don’t need to copy anything manually.** The app will automatically look in these common install paths:
```
-mkdir build
-cd build
+~/.steam/steam/steamapps/common
+~/.local/share/Steam/steamapps/common
+~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common
+~/snap/steam/common/.local/share/Steam/steamapps/common
```
-Once the folder is created and we're in it, CMake has to generate the actual Makefiles. This can be done this way:
+> ✅ If Wallpaper Engine is installed in one of these paths, the assets will be detected automatically!
+
+---
+
+#### ❗ If Assets Aren’t Found Automatically
+
+You can copy the `assets` folder manually:
+
+1. In Steam, right-click **Wallpaper Engine** → **Manage** → **Browse local files**
+2. Copy the `assets` folder
+3. Paste it into the same folder where the `linux-wallpaperengine` binary is located
+
+---
+
+### 2. Build from Source
+
+Clone the repo:
+
+```bash
+git clone --recurse-submodules https://github.com/Almamu/linux-wallpaperengine.git
+cd linux-wallpaperengine
```
+
+Build it:
+
+```bash
+mkdir build && cd build
cmake ..
-```
-Take a closer look at the CMake output, if you miss any library, CMake will report the missing libraries so you can install them either trough your package manager or manually in your system.
-
-Finally we can compile the project to generate the actual executable.
-```
make
```
-**REMEMBER: The assets folder has to be in the same folder as the executable**
+Once the build process is finished, this should create a new `output` folder containing the app and all the required
+support files to run.
-## 5.5. Running a background
-### 5.5.1. Running a background from Steam
-Just like with the assets, the software can automatically detect where the subscribed backgrounds are stored. To get started, search in the workshop for whatever background you want to use and click the "+Subscribe" button. This should download the background in the steam directory.
+> ✅ Remember: Place the `assets` folder next to the built binary if it isn’t detected automatically.
-To actually use the background you'll need to know the workshop's ID. This can be obtained right-clicking anywhere in the background's page -> "Copy Page URL". You can paste this URL anywhere, it will look something like this:
+---
-```
-https://steamcommunity.com/sharedfiles/filedetails/?id=1845706469&searchtext=portal+3
+## 🧪 Usage
+
+Basic syntax:
+
+```bash
+./linux-wallpaperengine [options]
```
-Where 1845706469 is the wallpaper's ID. You can use this ID to run wallpaperengine:
-```
+You can use either:
+- A Steam Workshop ID (e.g. `1845706469`)
+- A path to a background folder
+
+---
+
+### 🔧 Common Options
+
+| Option | Description |
+|--------|-------------|
+| `--silent` | Mute background audio |
+| `--volume ` | Set audio volume |
+| `--noautomute` | Don't mute when other apps play audio |
+| `--no-audio-processing` | Disable audio reactive features |
+| `--fps ` | Limit frame rate |
+| `--window ` | Run in windowed mode with custom size/position |
+| `--screen-root ` | Set as background for specific screen |
+| `--bg ` | Assign a background to a specific screen (use after `--screen-root`) |
+| `--scaling ` | Wallpaper scaling: `stretch`, `fit`, `fill`, or `default` |
+| `--clamping ` | Set texture clamping: `clamp`, `border`, `repeat` |
+| `--assets-dir ` | Set custom path for assets |
+| `--screenshot ` | Save screenshot (PNG, JPEG, BMP) |
+| `--list-properties` | Show customizable properties of a wallpaper |
+| `--set-property name=value` | Override a specific property |
+| `--disable-mouse` | Disable mouse interaction |
+| `--disable-parallax` | Disable parallax effect on backgrounds that support it |
+| `--no-fullscreen-pause` | Prevent pausing while fullscreen apps are running |
+
+---
+
+### 💡 Examples
+
+#### Run a background by ID
+```bash
./linux-wallpaperengine 1845706469
```
-### 5.5.2. Running a background in a different folder
-For the situations where the software cannot detect where the backgrounds are stored, you can specify a full path to it, like so:
-```
-./linux-wallpaperengine /home/almamu/Development/backgrounds/1845706469/
+#### Run a background from a folder
+```bash
+./linux-wallpaperengine ~/backgrounds/1845706469/
```
-### 5.5.2. Running in a window (Default)
-By default the app will load the backgrounds in a window so you can preview them:
-```
-./linux-wallpaperengine /home/almamu/Development/backgrounds/1845706469/
+#### Assign backgrounds to screens with scaling
+```bash
+./linux-wallpaperengine \
+ --scaling stretch --screen-root eDP-1 --bg 2667198601 \
+ --scaling fill --screen-root HDMI-1 --bg 2667198602
```
-Where `/home/almamu/Development/backgrounds/1845706469/` is the background's path.
-
-### 5.5.3. Running as a screen's background
-The app supports running as background in X11 and Wayland. Use the --screen-root switch and the screen name, like so:
-
-```
-./linux-wallpaperengine --screen-root HDMI-1 --screen-root DVI-D-1 1845706469
+#### Run in a window
+```bash
+./linux-wallpaperengine --window 0x0x1280x720 1845706469
```
-#### Wayland
-Has only been tested under wlroots but should work on any flavour as long as wlr-layer-shell-unstable is supported.
-
-#### X11
-Only screens configured with the XRandr extension are supported. To specify the screen names (as reported from xrandr tool) just use the ```--screen-root``` switch. You can specify multiple screens at the same time, for example:
-
-**IMPORTANT: Right now this doesn't work if there is anything drawing to the background (like a compositor, gnome, kde, nautilus, etc)**
-
-
-### 5.5.4. Limiting FPS
-To reduce the performance hit to your system you can reduce (or increase) the FPS limit with the switch ```--fps```, especially useful for laptops:
-```
-./linux-wallpaperengine --fps 30
+#### Limit FPS to save power
+```bash
+./linux-wallpaperengine --fps 30 1845706469
```
-## 5.6. Audio
-### 5.6.1. Disable audio
-It's possible to disable the audio of the background with the silent argument
-```
-./linux-wallpaperengine --silent
+#### Take a screenshot
+```bash
+./linux-wallpaperengine --screenshot ~/wallpaper.png 1845706469
```
-## 5.7. Taking a screenshot
-It is possible to take a screenshot of the screen's content at the moment a background is loaded up and rendered. Useful for tools like pywal to further customize your environment:
-```
-./linux-wallpaperengine --screenshot /path/to/screenshot/name.png
-```
+This can be useful as output for pywal or other color systems that use images as basis to generate a set of colors
+to apply to your system.
-PNG, BMP and JPEG are supported.
-
-## 5.8. Properties
-Some backgrounds have a list of properties that the user can customize. These properties modify how parts of the background behave or look like. Support for these is present.
-First, list all the available properties in a background, you can do that with the --list-properties switch:
-```
+#### View and change properties
+```bash
./linux-wallpaperengine --list-properties 2370927443
```
@@ -219,18 +252,43 @@ Any of these values can be modified with the --set-property switch. Say you want
./linux-wallpaperengine --set-property bloom=1 2370927443
```
-If you keep --list-properties in the commandline you can see how the values change to confirm that it applied properly.
+---
-## 6. Example background
-This was the first background to even be compatible with the software. And it's not 100% compatible yet. Both textures and shaders are properly loaded, but there are still particles missing.
+## 🧪 Wayland & X11 Support
-
+- **Wayland**: Works with compositors that support `wlr-layer-shell-unstable`.
+- **X11**: Requires XRandr. Use `--screen-root ` (as shown in `xrandr`).
-###### 1845706469
-In similar fashion to the example background, this one represents the progress of the program. It leverages FBOs (targets), and multiple-effects over objects.
+> ⚠ For X11 users: Currently doesn't work if a compositor or desktop environment (e.g. GNOME, KDE, Nautilus) is drawing the background.
+---
+
+## 🌈 Example Backgrounds
+
+

-# 7. Special thanks
-- [RePKG](https://github.com/notscuffed/repkg) for the information on texture flags
-- [RenderDoc](https://github.com/baldurk/renderdoc) for the so helpful OpenGL debugging tool that simplified finding issues on the new OpenGL code. Seriously this tool ROCKS
+## 🪲 Common issues
+### Black screen when setting as screen's background
+This can be caused by a few different things depending on your environment and setup.
+
+### X11
+Common symptom of a compositor drawing to the background which prevents Wallpaper Engine from being properly visible.
+The only solution currently is disabling the compositor so Wallpaper Engine can properly draw on the screen
+
+### NVIDIA
+Some users have had issues with GLFW initialization and other OpenGL errors. These are generally something that's
+worth reporting in the issues. Sometimes adding this variable when running Wallpaper Engine helps and/or solves
+the issue:
+```bash
+__GL_THREADED_OPTIMIZATIONS=0 linux-wallpaperengine
+```
+
+We'll be looking at improving this in the future, but for now it can be a useful workaround.
+
+---
+
+## 🙏 Special Thanks
+
+- [RePKG](https://github.com/notscuffed/repkg) – for texture flag insights
+- [RenderDoc](https://github.com/baldurk/renderdoc) – the best OpenGL debugger out there!
diff --git a/docs/images/screenshot_folder.png b/docs/images/screenshot_folder.png
deleted file mode 100644
index 8387e34..0000000
Binary files a/docs/images/screenshot_folder.png and /dev/null differ
diff --git a/docs/images/zip.png b/docs/images/zip.png
deleted file mode 100644
index 51d6db9..0000000
Binary files a/docs/images/zip.png and /dev/null differ
diff --git a/include/nlohmann/adl_serializer.hpp b/include/nlohmann/adl_serializer.hpp
deleted file mode 100644
index 53c9009..0000000
--- a/include/nlohmann/adl_serializer.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#pragma once
-
-#include
-
-#include
-#include
-
-namespace nlohmann
-{
-template
-struct adl_serializer
-{
- /*!
- @brief convert a JSON value to any value type
-
- This function is usually called by the `get()` function of the
- @ref basic_json class (either explicit or via conversion operators).
-
- @param[in] j JSON value to read from
- @param[in,out] val value to write to
- */
- template
- static void from_json(BasicJsonType&& j, ValueType& val) noexcept(
- noexcept(::nlohmann::from_json(std::forward(j), val)))
- {
- ::nlohmann::from_json(std::forward(j), val);
- }
-
- /*!
- @brief convert any value type to a JSON value
-
- This function is usually called by the constructors of the @ref basic_json
- class.
-
- @param[in,out] j JSON value to write to
- @param[in] val value to read from
- */
- template
- static void to_json(BasicJsonType& j, ValueType&& val) noexcept(
- noexcept(::nlohmann::to_json(j, std::forward(val))))
- {
- ::nlohmann::to_json(j, std::forward(val));
- }
-};
-}
diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp
deleted file mode 100644
index cd6bfd1..0000000
--- a/include/nlohmann/detail/conversions/from_json.hpp
+++ /dev/null
@@ -1,378 +0,0 @@
-#pragma once
-
-#include // transform
-#include // array
-#include // and, not
-#include // forward_list
-#include // inserter, front_inserter, end
-#include