require pkg-config in cmake for gtk checks #227

cmake reconfigure was failing for the gtk2 case because the pkg-config
cmake code was not being loaded.

Load pkg-config cmake code before any gtk checks.
This commit is contained in:
Rafael Kitover 2018-04-26 17:09:21 -04:00
parent 60f2bd3fd9
commit 8638c76923
1 changed files with 2 additions and 2 deletions

View File

@ -290,6 +290,8 @@ ENDIF(WIN32 AND ENABLE_DIRECTX)
# we make some direct gtk/gdk calls on linux and such
# so need to link the gtk that wx was built with
IF(NOT WIN32 AND NOT APPLE)
FIND_PACKAGE(PkgConfig REQUIRED)
FIND_PATH(WX_CONFIG_H NAMES wx/config.h PATHS ${wxWidgets_INCLUDE_DIRS})
IF(NOT WX_CONFIG_H)
MESSAGE(FATAL_ERROR "Could not find wx/config.h in ${wxWidgets_INCLUDE_DIRS}")
@ -300,7 +302,6 @@ IF(NOT WIN32 AND NOT APPLE)
CHECK_CXX_SYMBOL_EXISTS(__WXGTK4__ ${WX_CONFIG_H} WX_USING_GTK4)
CHECK_CXX_SYMBOL_EXISTS(__WXGTK3__ ${WX_CONFIG_H} WX_USING_GTK3)
IF(WX_USING_GTK4)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK4 REQUIRED gtk+-4.0)
IF(NOT GTK4_INCLUDE_DIRS)
MESSAGE(FATAL_ERROR "Could not find gtk4")
@ -310,7 +311,6 @@ IF(NOT WIN32 AND NOT APPLE)
ADD_COMPILE_OPTIONS(${GTK4_CFLAGS_OTHER})
SET(GTK_LIBRARIES ${GTK4_LIBRARIES})
ELSEIF(WX_USING_GTK3)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)
IF(NOT GTK3_INCLUDE_DIRS)
MESSAGE(FATAL_ERROR "Could not find gtk3")