cmake: check gdk only when building GUI

This commit is contained in:
Monson Shao 2023-05-01 22:37:04 +08:00
parent 43eb36c311
commit b183c39a95
No known key found for this signature in database
GPG Key ID: 163271C707982C65

View File

@ -792,11 +792,13 @@ set_property(TARGET PkgConfig::GLIB2 PROPERTY INTERFACE_COMPILE_DEFINITIONS
GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_${GLIB_API}
GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_${GLIB_API})
if (WITH_GNUCASH)
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GTK_MIN_MATCH ${GTK_MIN_VERSION})
set(GTK_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2})
set_property(TARGET PkgConfig::GTK3 PROPERTY INTERFACE_COMPILE_DEFINITIONS
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_${GTK_API}
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_${GTK_API})
endif()
add_definitions (-DHAVE_CONFIG_H)