mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 05:11:01 +00:00
cmake: add 'libdecoration' as external project
This commit is contained in:
parent
30e00d4fee
commit
f39d7c2e33
@ -36,6 +36,8 @@ cmake_dependent_option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF
|
|||||||
"UNIX;NOT APPLE" OFF)
|
"UNIX;NOT APPLE" OFF)
|
||||||
cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON
|
cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON
|
||||||
"MSVC" OFF)
|
"MSVC" OFF)
|
||||||
|
cmake_dependent_option(GLFW_USE_LIBDECORATION "use libdecoration" ON
|
||||||
|
"GLFW_USE_WAYLAND" OFF)
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS AND UNIX)
|
if (BUILD_SHARED_LIBS AND UNIX)
|
||||||
# On Unix-like systems, shared libraries can use the soname system.
|
# On Unix-like systems, shared libraries can use the soname system.
|
||||||
@ -55,6 +57,8 @@ endif()
|
|||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
|
list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
if (GLFW_BUILD_DOCS)
|
if (GLFW_BUILD_DOCS)
|
||||||
|
13
external/libdecoration.cmake
vendored
Normal file
13
external/libdecoration.cmake
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ExternalProject_Add(libdecoration
|
||||||
|
GIT_REPOSITORY https://gitlab.gnome.org/jadahl/libdecoration.git
|
||||||
|
GIT_TAG master
|
||||||
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/extern/libdecoration"
|
||||||
|
CONFIGURE_COMMAND meson --prefix "${CMAKE_CURRENT_BINARY_DIR}/install" --libdir "lib" ../libdecoration
|
||||||
|
BUILD_COMMAND ninja
|
||||||
|
INSTALL_COMMAND ninja install
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(glfw PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/install/include")
|
||||||
|
target_link_libraries(glfw PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/install/lib/libdecoration${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
|
add_dependencies(glfw libdecoration)
|
@ -70,6 +70,11 @@ if (_GLFW_WAYLAND)
|
|||||||
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
|
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
|
||||||
BASENAME idle-inhibit-unstable-v1)
|
BASENAME idle-inhibit-unstable-v1)
|
||||||
target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES})
|
target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES})
|
||||||
|
|
||||||
|
if (GLFW_USE_LIBDECORATION)
|
||||||
|
include("${CMAKE_SOURCE_DIR}/external/libdecoration.cmake")
|
||||||
|
add_definitions(-DWITH_DECORATION)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32 AND BUILD_SHARED_LIBS)
|
if (WIN32 AND BUILD_SHARED_LIBS)
|
||||||
|
Loading…
Reference in New Issue
Block a user