aboutsummaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
diff options
context:
space:
mode:
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}
)