<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb" -->

---
title: Build your own application with GTK 4 as a Meson subproject!
description: GTK 4 can now be used as a Meson subproject for your own application, making it easy to bundle GTK 4 and its dependencies when the system version is too old or...
canonical: https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Build your own application with GTK 4 as a Meson subproject! | daily.dev
og:description: GTK 4 can now be used as a Meson subproject for your own application, making it easy to bundle GTK 4 and its dependencies when the system version is too old or...
og:url: https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb
og:image: https://api.daily.dev/og/posts/XPmHBUfEB.png
og:image:alt: Build your own application with GTK 4 as a Meson subproject!
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Build your own application with GTK 4 as a Meson subproject!

**[Collabora Blog](https://daily.dev/sources/collabora)** · 4 min read · 0 upvotes · 0 comments

## Summary

GTK 4 can now be used as a Meson subproject for your own application, making it easy to bundle GTK 4 and its dependencies when the system version is too old or unavailable. A simple `subprojects/gtk.wrap` file is all that's needed to instruct Meson to fetch and build GTK 4 automatically. The post also covers building GtkSourceView 5.0 (the first GTK 4 app) and GTK 4's optional GStreamer media backend — including FFmpeg — all as Meson subprojects on Windows with Visual Studio. Step-by-step commands are provided for cloning, configuring, compiling, and installing GtkSourceView on Windows.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.collabora.com/news-and-blog/blog/2021/04/29/build-your-own-application-with-gtk4-as-a-meson-subproject>

## Questions this post answers

### How do I add GTK 4 as a Meson subproject so it builds automatically when not found on the system?

Create a `subprojects/gtk.wrap` file with a `[wrap-git]` section pointing to the GNOME GTK repository and a `[provide]` section listing `dependency_names=gtk4`. When your `meson.build` calls `dependency('gtk4')`, Meson will automatically fetch and build GTK 4 — along with any missing dependencies like glib — if it is not found on the system.

_Developers shipping cross-platform GTK apps track Meson subproject patterns like this on daily.dev._

### How do I build GtkSourceView 5.0 on Windows with Visual Studio using GTK 4 as a Meson subproject?

Clone the GtkSourceView repository, then run `meson setup build --prefix C:/gnome -Dinstall_tests=true`, followed by `meson compile -C build` and `meson install -C build`. Meson will automatically fetch and build GTK 4 and all its dependencies as subprojects. The `-Dinstall_tests=true` flag is only needed if you want the test application installed.

_Windows GTK developers keeping up with the GNOME toolchain find relevant build guides on daily.dev._

## Similar posts on daily.dev

- [New Maui.Gtk Project Provides A GTK4 Backend For Microsoft's .NET MAUI](https://daily.dev/posts/new-maui-gtk-project-provides-a-gtk4-backend-for-microsoft-s-net-maui-0lmhu1l5k) · Phoronix · 3 upvotes · 0 comments
- [Making a GTK application in Haskell, part 1](https://daily.dev/posts/making-a-gtk-application-in-haskell-part-1-tfvzeuvnr) · Lobsters · 0 upvotes · 0 comments
- [Vim Merges GTK4 Toolkit Support, Co-Authored-By Claude](https://daily.dev/posts/vim-merges-gtk4-toolkit-support-co-authored-by-claude-epszsdgfu) · Phoronix · 1 upvotes · 0 comments
- [gThumb 4.0 has been released, and it looks like a brand new app](https://daily.dev/posts/gthumb-4-0-has-been-released-and-it-looks-like-a-brand-new-app-wk7vocuap) · omg\! ubuntu\! · 0 upvotes · 0 comments

---

Tags: [#windows](https://daily.dev/tags/windows)

[View this post on daily.dev](https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Build your own application with GTK 4 as a Meson subproject!","url":"https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb"},"datePublished":"2026-08-11T08:55:02.615Z","dateModified":"2026-08-11T09:24:51.776Z","description":"GTK 4 can now be used as a Meson subproject for your own application, making it easy to bundle GTK 4 and its dependencies when the system version is too old or...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/16474c1381294c59fd70f694e2a38c02?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/16474c1381294c59fd70f694e2a38c02?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collabora Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collabora Blog","logo":"https://media.daily.dev/image/upload/s--ZGZ0FjqS--/f_auto,q_auto/v1786438306/logos/collabora?_a=BAMAMicg0","url":"https://daily.dev/sources/collabora"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"windows","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collabora Blog","item":"https://daily.dev/sources/collabora"},{"@type":"ListItem","position":3,"name":"Build your own application with GTK 4 as a Meson subproject!"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/build-your-own-application-with-gtk-4-as-a-meson-subproject--xpmhbufeb#faq","mainEntity":[{"@type":"Question","name":"How do I add GTK 4 as a Meson subproject so it builds automatically when not found on the system?","acceptedAnswer":{"@type":"Answer","text":"Create a `subprojects/gtk.wrap` file with a `[wrap-git]` section pointing to the GNOME GTK repository and a `[provide]` section listing `dependency_names=gtk4`. When your `meson.build` calls `dependency('gtk4')`, Meson will automatically fetch and build GTK 4 — along with any missing dependencies like glib — if it is not found on the system. Developers shipping cross-platform GTK apps track Meson subproject patterns like this on daily.dev."}},{"@type":"Question","name":"How do I build GtkSourceView 5.0 on Windows with Visual Studio using GTK 4 as a Meson subproject?","acceptedAnswer":{"@type":"Answer","text":"Clone the GtkSourceView repository, then run `meson setup build --prefix C:/gnome -Dinstall_tests=true`, followed by `meson compile -C build` and `meson install -C build`. Meson will automatically fetch and build GTK 4 and all its dependencies as subprojects. The `-Dinstall_tests=true` flag is only needed if you want the test application installed. Windows GTK developers keeping up with the GNOME toolchain find relevant build guides on daily.dev."}}]}
```

