vmap/cmake/FindGTK2.cmake
2020-11-17 12:16:16 +01:00

21 lines
691 B
CMake

find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
if (GTK2_FIND_REQUIRED)
set(_pkgconfig_REQUIRED REQUIRED)
endif ()
pkg_check_modules(GTK2 ${_pkgconfig_REQUIRED} gtk+-2.0)
else ()
find_path(GTK2_INCLUDE_DIRS gtk.h)
# find_library(GTK2_LIBRARIES)
if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
set(GTK2_FOUND 1)
if (NOT GTK2_FIND_QUIETLY)
message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
endif ()
elseif (GTK2_FIND_REQUIRED)
message(SEND_ERROR "Could not find GTK2")
elseif (NOT GTK2_FIND_QUIETLY)
message(STATUS "Could not find GTK2")
endif ()
endif ()
mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)