From c1f7c766ef498c680ad729794a35db24f7adde0f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 25 May 2008 11:21:40 +0000 Subject: [PATCH] Added check for pkg-config so that build only use related package checks when it's supported --- CMakeLists.txt | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efd053b14..807eb36eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,19 +211,6 @@ FIND_PACKAGE(ZLIB) FIND_PACKAGE(GDAL) FIND_PACKAGE(CURL) -INCLUDE(FindPkgConfig) - -PKG_CHECK_MODULES(GTK gtk+-2.0) - -IF(WIN32) - PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0) -ELSE(WIN32) - PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0) -ENDIF(WIN32) - -PKG_CHECK_MODULES(RSVG librsvg-2.0) -PKG_CHECK_MODULES(CAIRO cairo) - SET(wxWidgets_USE_LIBS base core gl net) FIND_PACKAGE(wxWidgets) @@ -247,6 +234,28 @@ ELSE(DESIRED_QT_VERSION) ENDIF(DESIRED_QT_VERSION) + +#use pkg-config to find various modues +FIND_PACKAGE(PkgConfig) + +IF(PKG_CONFIG_FOUND) + + INCLUDE(FindPkgConfig) + + PKG_CHECK_MODULES(GTK gtk+-2.0) + + IF(WIN32) + PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0) + ELSE(WIN32) + PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0) + ENDIF(WIN32) + + PKG_CHECK_MODULES(RSVG librsvg-2.0) + PKG_CHECK_MODULES(CAIRO cairo) + +ENDIF(PKG_CONFIG_FOUND) + + # # Test to determine if we want the "tripledot" form of the GLU tesselator callback. #