Created
July 10, 2021 22:15
-
-
Save marcelhas/76ac23423ef950059fa78ff6d1e073fe to your computer and use it in GitHub Desktop.
Basic GTK4 CMake File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.19) | |
project(<project_name> C) | |
set(CMAKE_C_STANDARD 11) | |
# Use the package PkgConfig to detect GTK+ headers/library files | |
FIND_PACKAGE(PkgConfig REQUIRED) | |
pkg_check_modules (GTK4 REQUIRED gtk4) | |
# Setup CMake to use GTK+, tell the compiler where to look for headers | |
# and to the linker where to look for libraries | |
INCLUDE_DIRECTORIES(${GTK4_INCLUDE_DIRS}) | |
LINK_DIRECTORIES(${GTK4_LIBRARY_DIRS}) | |
# Add other flags to the compiler | |
ADD_DEFINITIONS(${GTK4_CFLAGS_OTHER}) | |
add_executable(<project_name> <src.c>) | |
target_link_libraries(<project_name> ${GTK4_LIBRARIES}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are amazing, thank you so much