aboutsummaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2022-08-21 00:57:03 +0200
committerMarvin W <git@larma.de>2022-08-21 00:57:46 +0200
commitd6afa6e8ff4cfb533140d9434b83f18f627f11ca (patch)
tree94f99ac111c84591e1478be23748a28bcc37d727 /main/CMakeLists.txt
parent7b252d040a845b7e9c515f61927fbf5bf7ed4c3a (diff)
downloaddino-d6afa6e8ff4cfb533140d9434b83f18f627f11ca.tar.gz
dino-d6afa6e8ff4cfb533140d9434b83f18f627f11ca.zip
GTK4: Don't require use of MenuButton.set_child introduced with 4.6
Diffstat (limited to 'main/CMakeLists.txt')
-rw-r--r--main/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 5e11bb6d..6b97444d 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -3,6 +3,7 @@ find_package(Gettext)
include(${GETTEXT_USE_FILE})
gettext_compile(${GETTEXT_PACKAGE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/po TARGET_NAME ${GETTEXT_PACKAGE}-translations)
+find_package(GTK4 REQUIRED)
find_packages(MAIN_PACKAGES REQUIRED
Gee
GLib
@@ -104,6 +105,11 @@ unset(MAIN_EXTRA_OPTIONS)
unset(MAIN_EXTRA_PACKAGES)
set(MAIN_EXTRA_OPTIONS ${MAIN_EXTRA_OPTIONS} --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi)
+set(MAIN_DEFINITIONS)
+if(GTK4_VERSION VERSION_GREATER_EQUAL "4.6")
+ set(MAIN_DEFINITIONS ${MAIN_DEFINITIONS} GTK_4_6)
+endif()
+
vala_precompile(MAIN_VALA_C
SOURCES
src/main.vala
@@ -200,6 +206,8 @@ PACKAGES
${MAIN_EXTRA_PACKAGES}
GRESOURCES
${MAIN_GRESOURCES_XML}
+DEFINITIONS
+ ${MAIN_DEFINITIONS}
OPTIONS
${MAIN_EXTRA_OPTIONS}
)