Skip to content

Instantly share code, notes, and snippets.

@ctnguyenvn
Last active March 1, 2019 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctnguyenvn/92d45b7221c61465f8a8ebeb774d0d1c to your computer and use it in GitHub Desktop.
Save ctnguyenvn/92d45b7221c61465f8a8ebeb774d0d1c to your computer and use it in GitHub Desktop.
template simple gtk cmake C on Clion Linux
cmake_minimum_required(VERSION 3.7)
project(First C) // First -> project name
include(FindPkgConfig)
pkg_check_modules(GTK REQUIRED "gtk+-3.0")
include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER})
set(CMAKE_CXX_STANDARD 99)
set(SOURCE_FILES main.c) // main.c -> main file
add_executable(main.c ${SOURCE_FILES}) // main.c -> main file
target_link_libraries(main.c ${GTK3_LIBRARIES} pthread) // main.c -> main file, pthread -> add thread libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment