aboutsummaryrefslogtreecommitdiff
path: root/modules/FindPCRE.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2006-04-20 12:25:46 +0000
committerDavid Faure <faure@kde.org>2006-04-20 12:25:46 +0000
commit9a75f145de53a04eca02dd5da5c2ab092f67d2f0 (patch)
tree246e6e63b638374354d3496365be8b0064397a11 /modules/FindPCRE.cmake
parent672022196187fa0d0b412c01f70de04b3827bbaf (diff)
downloadextra-cmake-modules-9a75f145de53a04eca02dd5da5c2ab092f67d2f0.tar.gz
extra-cmake-modules-9a75f145de53a04eca02dd5da5c2ab092f67d2f0.tar.bz2
OK so FIND_PATH and FIND_LIBRARIES use the cache already, so no need for the CACHED_FOO fast-path
when the check only uses those. Instead I used this, to avoid "Found libfoo" in the output when in fact we didn't just look for it, we had it in the cache. +if (TIFF_INCLUDE_DIR) + # Already in cache, be silent + set(TIFF_FIND_QUIETLY TRUE) +endif (TIFF_INCLUDE_DIR) CACHED_FOO remains for the cases where there is more logic to the configure check, like PKGCONFIG, foo-config, or CHECK_LIBRARY_EXISTS (e.g. bzip2) CCMAIL: kde-buildsystem@kde.org svn path=/trunk/KDE/kdelibs/; revision=531839
Diffstat (limited to 'modules/FindPCRE.cmake')
-rw-r--r--modules/FindPCRE.cmake88
1 files changed, 39 insertions, 49 deletions
diff --git a/modules/FindPCRE.cmake b/modules/FindPCRE.cmake
index f7a7e9cc..16116867 100644
--- a/modules/FindPCRE.cmake
+++ b/modules/FindPCRE.cmake
@@ -5,52 +5,42 @@
# PCRE_INCLUDE_DIR - the PCRE include directory
# PCRE_LIBRARIES - The libraries needed to use PCRE
-IF (DEFINED CACHED_PCRE)
-
- # in cache already
- IF ("${CACHED_PCRE}" STREQUAL "YES")
- SET(PCRE_FOUND TRUE)
- ENDIF ("${CACHED_PCRE}" STREQUAL "YES")
-
-ELSE (DEFINED CACHED_PCRE)
-
- FIND_PATH(PCRE_INCLUDE_DIR pcre.h
- /usr/include/
- /usr/local/include/
- )
-
- FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
- PATHS
- /usr/lib
- /usr/local/lib
- )
-
- FIND_LIBRARY(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix
- PATHS
- /usr/lib
- /usr/local/lib
- )
-
- set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY} CACHE STRING "The libraries needed to use PCRE")
-
- if (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
- set(PCRE_FOUND TRUE)
- set(CACHED_PCRE "YES")
- else (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
- set(CACHED_PCRE "NO")
- endif (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
-
- if (PCRE_FOUND)
- if (NOT PCRE_FIND_QUIETLY)
- message(STATUS "Found PCRE: ${PCRE_LIBRARIES}")
- endif (NOT PCRE_FIND_QUIETLY)
- else (PCRE_FOUND)
- if (PCRE_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find PCRE")
- endif (PCRE_FIND_REQUIRED)
- endif (PCRE_FOUND)
-
- set(CACHED_PCRE ${CACHED_PCRE} CACHE INTERNAL "If pcre was checked")
- MARK_AS_ADVANCED(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)
-
-ENDIF (DEFINED CACHED_PCRE)
+if (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
+ # Already in cache, be silent
+ set(PCRE_FIND_QUIETLY TRUE)
+endif (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
+
+FIND_PATH(PCRE_INCLUDE_DIR pcre.h
+ /usr/include/
+ /usr/local/include/
+)
+
+FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
+ PATHS
+ /usr/lib
+ /usr/local/lib
+)
+
+FIND_LIBRARY(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix
+ PATHS
+ /usr/lib
+ /usr/local/lib
+)
+
+set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY} CACHE STRING "The libraries needed to use PCRE")
+
+if (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
+ set(PCRE_FOUND TRUE)
+endif (PCRE_INCLUDE_DIR AND PCRE_LIBRARIES)
+
+if (PCRE_FOUND)
+ if (NOT PCRE_FIND_QUIETLY)
+ message(STATUS "Found PCRE: ${PCRE_LIBRARIES}")
+ endif (NOT PCRE_FIND_QUIETLY)
+else (PCRE_FOUND)
+ if (PCRE_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find PCRE")
+ endif (PCRE_FIND_REQUIRED)
+endif (PCRE_FOUND)
+
+MARK_AS_ADVANCED(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)