Add the pkg-config compile CFLAGS (glib/gio/soup/xml, and per-module deps) to
each module's introspection gir_cflags. Upstream leaves gir_cflags with only the
-D...COMPILATION define and local -I dirs, relying on glib.h being on the default
compiler search path. On MacPorts glib lives under ${prefix}/include/glib-2.0,
which the g-ir-scanner preprocess step never sees (it uses only the CMake
--cflags-begin..--cflags-end block, not CFLAGS/CPPFLAGS env), so the scanner
fails with "fatal error: glib.h: No such file or directory" while generating
Camel-1.2.gir. Adding ${GNOME_PLATFORM_CFLAGS} et al. puts the correct -I dirs
into the scanner's cflags block.

--- src/camel/CMakeLists.txt.orig
+++ src/camel/CMakeLists.txt
@@ -356,7 +356,11 @@
 set(gir_sources ${SOURCES} ${HEADERS})
 set(gir_identifies_prefixes Camel camel)
 set(gir_includes GObject-2.0 Gio-2.0 libxml2-2.0)
-set(gir_cflags -DCAMEL_COMPILATION)
+set(gir_cflags
+	-DCAMEL_COMPILATION
+	${CAMEL_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
+)
 set(gir_libdirs)
 set(gir_libs camel)
 set(gir_deps)
--- src/libedataserver/CMakeLists.txt.orig
+++ src/libedataserver/CMakeLists.txt
@@ -305,6 +305,10 @@
 set(gir_includes GObject-2.0 Gio-2.0 Soup-3.0 libxml2-2.0 Json-1.0)
 set(gir_cflags
 	-DLIBEDATASERVER_COMPILATION
+	${DATA_SERVER_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
+	${GIO_UNIX_CFLAGS}
+	${JSON_GLIB_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/libebackend/CMakeLists.txt.orig
+++ src/libebackend/CMakeLists.txt
@@ -145,6 +145,10 @@
 set(gir_cflags
 	-DLIBEBACKEND_COMPILATION
 	-DEDS_DISABLE_DEPRECATED=1
+	${BACKEND_CFLAGS}
+	${CAMEL_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
+	${GIO_UNIX_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/libedataserverui/CMakeLists.txt.orig
+++ src/libedataserverui/CMakeLists.txt
@@ -123,6 +123,11 @@
 	-DLIBEDATASERVERUI_COMPILATION
 	-I${CMAKE_BINARY_DIR}/src/calendar
 	-I${CMAKE_SOURCE_DIR}/src/calendar
+	${DATA_SERVER_CFLAGS}
+	${CAMEL_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
+	${GTK_CFLAGS}
+	${JSON_GLIB_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
@@ -306,6 +311,11 @@
 	-I${CMAKE_SOURCE_DIR}/src/calendar
 	-I${CMAKE_CURRENT_BINARY_DIR}/libedataserverui${UI_VERSION}
 	-I${CMAKE_CURRENT_BINARY_DIR}
+	${DATA_SERVER_CFLAGS}
+	${CAMEL_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
+	${GTK4_CFLAGS}
+	${JSON_GLIB_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/addressbook/libebook-contacts/CMakeLists.txt.orig
+++ src/addressbook/libebook-contacts/CMakeLists.txt
@@ -167,6 +167,8 @@
 	-I${CMAKE_BINARY_DIR}/src/addressbook/libebook-contacts
 	-I${CMAKE_SOURCE_DIR}/src/addressbook
 	-I${CMAKE_SOURCE_DIR}/src/addressbook/libebook-contacts
+	${ADDRESSBOOK_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/addressbook/libebook/CMakeLists.txt.orig
+++ src/addressbook/libebook/CMakeLists.txt
@@ -101,6 +101,9 @@
 	-I${CMAKE_BINARY_DIR}/src/addressbook/libebook
 	-I${CMAKE_SOURCE_DIR}/src/addressbook
 	-I${CMAKE_SOURCE_DIR}/src/addressbook/libebook
+	${ADDRESSBOOK_CFLAGS}
+	${CAMEL_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/addressbook/libedata-book/CMakeLists.txt.orig
+++ src/addressbook/libedata-book/CMakeLists.txt
@@ -218,6 +218,8 @@
 	-I${CMAKE_BINARY_DIR}/src/addressbook/libedata-book
 	-I${CMAKE_SOURCE_DIR}/src/addressbook
 	-I${CMAKE_SOURCE_DIR}/src/addressbook/libedata-book
+	${ADDRESSBOOK_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/private
--- src/calendar/libecal/CMakeLists.txt.orig
+++ src/calendar/libecal/CMakeLists.txt
@@ -127,6 +127,8 @@
 	-DEDS_DISABLE_DEPRECATED=1
 	-I${CMAKE_BINARY_DIR}/src/calendar
 	-I${CMAKE_SOURCE_DIR}/src/calendar
+	${CALENDAR_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/camel
--- src/calendar/libedata-cal/CMakeLists.txt.orig
+++ src/calendar/libedata-cal/CMakeLists.txt
@@ -99,6 +99,8 @@
 	-DEDS_DISABLE_DEPRECATED=1
 	-I${CMAKE_BINARY_DIR}/src/calendar
 	-I${CMAKE_SOURCE_DIR}/src/calendar
+	${CALENDAR_CFLAGS}
+	${GNOME_PLATFORM_CFLAGS}
 )
 set(gir_libdirs
 	${CMAKE_BINARY_DIR}/src/camel
