I trying to compile my test GLib project using CLion. So I added #include "glib-2.0/glib.h"
in my cpp file and added include_directories(/usr/include/glib-2.0/glib)
in my CMakeLists.txt. But got output in CLion:
fatal error: glib/galloca.h: No such file or directory
So how I can correctly use GLib in my project in CLion?
Here's the skeleton I use for glib on my Mac (glib2 and pkgconfig installed via MacPorts):
cmake_minimum_required(VERSION 3.1)
project(HelloGlib)
include(FindPkgConfig)
pkg_check_modules(GLIB glib-2.0 REQUIRED)
include_directories(${GLIB_INCLUDE_DIRS})
set(SOURCE_FILES main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${GLIB_LIBRARIES})