From 35175120b1773a674f096daee64d97e2efaf3a08 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sat, 16 Aug 2008 07:01:49 -0400 Subject: [PATCH] STYLE: /usr/local/bin is in the path anyway STYLE: this file is mostly uppercase commands, so make all commands uppercase ENH: add a status message in case pkgconfig didn't find the package (sync with the one from KDE) Alex --- Modules/UsePkgConfig.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index 23519e80e..5d7d65c08 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -12,10 +12,10 @@ -FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin ) +FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config ) MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) - message(STATUS + MESSAGE(STATUS "WARNING: you are using the obsolete 'PKGCONFIG' macro use FindPkgConfig") # reset the variables at the beginning SET(${_include_DIR}) @@ -33,20 +33,24 @@ MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir OUTPUT_VARIABLE ${_include_DIR} ) - string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") + STRING(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir OUTPUT_VARIABLE ${_link_DIR} ) - string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") + STRING(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs OUTPUT_VARIABLE ${_link_FLAGS} ) - string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") + STRING(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags OUTPUT_VARIABLE ${_cflags} ) - string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") + STRING(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") + + ELSE( NOT _return_VALUE) + + MESSAGE(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)") ENDIF(NOT _return_VALUE)