Skip to content

Commit

Permalink
Improve PkgConfig usage
Browse files Browse the repository at this point in the history
Including FindPkgConfig directly into scripts is not a recommended practice.
Doing so will cause CMake to complain with a warning.
Replaced with find_package(PkgConfig QUIET)
  • Loading branch information
scttgs0 committed Mar 22, 2020
1 parent dcc46fe commit 89450b7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
8 changes: 2 additions & 6 deletions CMakeModules/FindGTA.cmake
Expand Up @@ -8,14 +8,10 @@
# correspond to the ./configure --prefix=$GTA_DIR
# used in building libgta.

INCLUDE(FindPkgConfig OPTIONAL)
find_package(PkgConfig QUIET)

IF(PKG_CONFIG_FOUND)

INCLUDE(FindPkgConfig)

PKG_CHECK_MODULES(GTA gta)

ENDIF(PKG_CONFIG_FOUND)

IF(NOT GTA_FOUND)
Expand Down Expand Up @@ -54,4 +50,4 @@ IF(NOT GTA_FOUND)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)

ENDIF(NOT GTA_FOUND)
ENDIF(NOT GTA_FOUND)
5 changes: 1 addition & 4 deletions CMakeModules/FindGtkGl.cmake
@@ -1,10 +1,7 @@
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
find_package(PkgConfig QUIET)

IF(PKG_CONFIG_FOUND)

INCLUDE(FindPkgConfig)

PKG_CHECK_MODULES(GTK gtk+-2.0)

IF(WIN32)
Expand Down
5 changes: 1 addition & 4 deletions CMakeModules/FindPoppler-glib.cmake
@@ -1,10 +1,7 @@
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
find_package(PkgConfig QUIET)

IF(PKG_CONFIG_FOUND)

INCLUDE(FindPkgConfig)

PKG_CHECK_MODULES(CAIRO cairo)
PKG_CHECK_MODULES(POPPLER poppler-glib)

Expand Down
6 changes: 1 addition & 5 deletions CMakeModules/FindRSVG.cmake
@@ -1,10 +1,7 @@
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
find_package(PkgConfig QUIET)

IF(PKG_CONFIG_FOUND)

INCLUDE(FindPkgConfig)

#Version 2.35 introduces the rsvg_cleanup function which is used
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)

Expand All @@ -14,5 +11,4 @@ IF(PKG_CONFIG_FOUND)
SET(RSVG_FOUND FALSE)
ENDIF()


ENDIF()
2 changes: 1 addition & 1 deletion src/osgViewer/CMakeLists.txt
Expand Up @@ -185,7 +185,7 @@ ELSE()

ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "X11")
# X11 for everybody else
INCLUDE(FindPkgConfig OPTIONAL)
find_package(PkgConfig QUIET)
IF(PKG_CONFIG_FOUND)

PKG_CHECK_MODULES(XRANDR xrandr)
Expand Down

0 comments on commit 89450b7

Please sign in to comment.