mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-13 21:02:34 +08:00
fix: hopefully fix running from arch's package
This commit is contained in:
parent
6c27d94115
commit
50d3bced8e
@ -1,6 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
project(linux-wallpaperengine)
|
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_property(GLOBAL PROPERTY OS_FOLDERS ON)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
|
||||||
@ -73,17 +78,17 @@ find_package(CEF REQUIRED)
|
|||||||
|
|
||||||
set(
|
set(
|
||||||
CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||||
${CMAKE_HOME_DIRECTORY}/build
|
${CMAKE_CURRENT_BINARY_DIR}/build
|
||||||
)
|
)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||||
${CMAKE_HOME_DIRECTORY}/lib
|
${CMAKE_CURRENT_BINARY_DIR}/lib
|
||||||
)
|
)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
TARGET_OUTPUT_DIRECTORY
|
TARGET_OUTPUT_DIRECTORY
|
||||||
${CMAKE_HOME_DIRECTORY}/build
|
${CMAKE_CURRENT_BINARY_DIR}/build
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
|
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
|
||||||
@ -467,8 +472,12 @@ if(X11_SUPPORT_FOUND)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(CREATE_LINK linux-wallpaperengine wallengine SYMBOLIC)
|
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()
|
||||||
|
|
||||||
# set some install parameters if not in debug mode
|
# set some install parameters if not in debug mode
|
||||||
install(TARGETS linux-wallpaperengine)
|
install(DIRECTORY ${TARGET_OUTPUT_DIRECTORY}/ DESTINATION .)
|
||||||
install(DIRECTORY share/ DESTINATION share/${PROJECT_NAME})
|
install(FILES ${TARGET_OUTPUT_DIRECTORY}/${PROJECT_NAME} PERMISSIONS OWNER_READ OWNER_WRITE WORLD_EXECUTE WORLD_READ GROUP_READ DESTINATION .)
|
||||||
|
install(DIRECTORY share/ DESTINATION ./share)
|
||||||
|
|
||||||
|
1
main.cpp
1
main.cpp
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "WallpaperEngine/Application/CApplicationContext.h"
|
#include "WallpaperEngine/Application/CApplicationContext.h"
|
||||||
#include "WallpaperEngine/Application/CWallpaperApplication.h"
|
#include "WallpaperEngine/Application/CWallpaperApplication.h"
|
||||||
#include "WallpaperEngine/Core/Wallpapers/CWeb.h"
|
|
||||||
#include "WallpaperEngine/WebBrowser/CWebBrowserContext.h"
|
#include "WallpaperEngine/WebBrowser/CWebBrowserContext.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
@ -27,11 +27,13 @@ pkgver() {
|
|||||||
build() {
|
build() {
|
||||||
cmake -B build -S "$pkgname" \
|
cmake -B build -S "$pkgname" \
|
||||||
-DCMAKE_BUILD_TYPE='Release' \
|
-DCMAKE_BUILD_TYPE='Release' \
|
||||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
-DCMAKE_INSTALL_PREFIX='/opt/linux-wallpaperengine' \
|
||||||
-Wno-dev
|
-Wno-dev
|
||||||
cmake --build build
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
DESTDIR="$pkgdir" cmake --install build
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
|
# create forwarding script
|
||||||
|
echo "cd /opt/linux-wallpaperengine; ./linux-wallpaperengine \$*" > /usr/bin/linux-wallpaperengine
|
||||||
}
|
}
|
||||||
|
@ -267,6 +267,16 @@ void CWallpaperApplication::show () {
|
|||||||
"Cannot read environment variable XDG_SESSION_TYPE, window server detection failed. Please ensure proper values are set");
|
"Cannot read environment variable XDG_SESSION_TYPE, window server detection failed. Please ensure proper values are set");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sLog.debug("Checking for window servers: ");
|
||||||
|
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
|
sLog.debug("\twayland");
|
||||||
|
#endif // ENABLE_WAYLAND
|
||||||
|
|
||||||
|
#ifdef ENABLE_X11
|
||||||
|
sLog.debug("\tx11");
|
||||||
|
#endif // ENABLE_X11
|
||||||
|
|
||||||
#ifdef ENABLE_WAYLAND
|
#ifdef ENABLE_WAYLAND
|
||||||
bool isWayland = strncmp ("wayland", XDG_SESSION_TYPE, strlen ("wayland")) == 0;
|
bool isWayland = strncmp ("wayland", XDG_SESSION_TYPE, strlen ("wayland")) == 0;
|
||||||
#endif // ENABLE_WAYLAND
|
#endif // ENABLE_WAYLAND
|
||||||
@ -299,7 +309,10 @@ void CWallpaperApplication::show () {
|
|||||||
this->m_context, *reinterpret_cast<Render::Drivers::CGLFWOpenGLDriver*> (m_videoDriver));
|
this->m_context, *reinterpret_cast<Render::Drivers::CGLFWOpenGLDriver*> (m_videoDriver));
|
||||||
}
|
}
|
||||||
#endif // ENABLE_X11
|
#endif // ENABLE_X11
|
||||||
else {
|
#ifdef ENABLE_X11
|
||||||
|
else
|
||||||
|
#endif // ENABLE_X11
|
||||||
|
{
|
||||||
sLog.exception (
|
sLog.exception (
|
||||||
"Cannot run in background mode, window server could not be detected. XDG_SESSION_TYPE must be wayland or x11");
|
"Cannot run in background mode, window server could not be detected. XDG_SESSION_TYPE must be wayland or x11");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user