Skip to content

Instantly share code, notes, and snippets.

@growlnx
Last active May 12, 2024 23:37
Show Gist options
  • Save growlnx/ee2e7536472dbe3da4cbe4b49fb3f21d to your computer and use it in GitHub Desktop.
Save growlnx/ee2e7536472dbe3da4cbe4b49fb3f21d to your computer and use it in GitHub Desktop.
GLIB with cmake
PROJECT(project C)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GLIB REQUIRED glib-2.0)
INCLUDE_DIRECTORIES(
src/include/
${GLIB_INCLUDE_DIRS}
)
LINK_DIRECTORIES(${GLIB_LIBRARY_DIRS})
FILE(GLOB SRC src/*.c)
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${SRC})
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${GLIB_LIBRARIES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment