From 487c5c5e6898f421124efddc110a6cf4dd10a4fe Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 15 Dec 2020 13:21:38 +0100 Subject: [PATCH] gtkglext: build builtin GtkGLExt as cmake external project Do: cmake -G "Unix Makefiles" -S. -Bbuild -DBUILTIN_GTKGLEXT=ON cmake --build build --parallel $(nproc) A GtkGLExt tree knonn to build will be downloaded into: build/gtkglext-prefix/src/gtkglext and installed into: build/external NetRadiant does not build against this builtin GtkGLExt yet. --- CMakeLists.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6cc4464..d861842c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") project(NetRadiant C CXX) @@ -161,6 +162,27 @@ if (BUILD_RADIANT) endif () endif () +option(BUILTIN_GTKGLEXT "Builtin GtkGLExt" OFF) +if (BUILTIN_GTKGLEXT) + include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) + + execute_process(COMMAND pkg-config --libs gdk-2.0 gtk+-2.0 glib-2.0 gl + OUTPUT_VARIABLE GTKGLEXT_LDFLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(GTKGLEXT_LDFLAGS "-lm ${GTKGLEXT_LDFLAGS}") + + ExternalProject_Add(gtkglext + GIT_REPOSITORY https://gitlab.gnome.org/illwieckz/gtkglext.git + GIT_TAG fixes + BUILD_IN_SOURCE ON + CONFIGURE_COMMAND NOCONFIGURE=1 ./autogen.sh + CONFIGURE_COMMAND && ./configure --prefix "${CMAKE_BINARY_DIR}/external" + BUILD_COMMAND $(MAKE) LDFLAGS=${GTKGLEXT_LDFLAGS} + INSTALL_COMMAND $(MAKE) install + ) +endif () + #----------------------------------------------------------------------- # Defs #----------------------------------------------------------------------- -- 2.39.2