mac osx安装Cairo:
brew install cairo

mac osx安装gtk+3
brew install ctk+3

CMake导入cairo和gtk+3:

# Use the package PkgConfig to detect GTK+ headers/library files
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)

# Setup CMake to use GTK+, tell the compiler where to look for headers
# and to the linker where to look for libraries
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})

# Add other flags to the compiler
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})

# Add an executable compiled from hello.c
ADD_EXECUTABLE(hello main.c)

# Link the target to the GTK+ libraries
TARGET_LINK_LIBRARIES(hello ${GTK3_LIBRARIES})

# Cairo
set(cairo_dir /usr/local/Cellar/cairo/1.14.12)
include_directories(${cairo_dir}/include/cairo)
link_directories(${cairo_dir}/lib)