aboutsummaryrefslogtreecommitdiff
path: root/modules/FindPCRE.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2006-04-14 11:49:02 +0000
committerDavid Faure <faure@kde.org>2006-04-14 11:49:02 +0000
commit968fec0a7b604bb1c463aae6ff7bb9726407af72 (patch)
tree49718559bcf80cb38a92710dfda96da18887cb8d /modules/FindPCRE.cmake
parentb00b040aa62ce0331b5cf533efcdfaa89c697d94 (diff)
downloadextra-cmake-modules-968fec0a7b604bb1c463aae6ff7bb9726407af72.tar.gz
extra-cmake-modules-968fec0a7b604bb1c463aae6ff7bb9726407af72.tar.bz2
Actually use the cache whenever possible. Should speed up the re-configuring that happens so often.
svn path=/trunk/KDE/kdelibs/; revision=529759
Diffstat (limited to 'modules/FindPCRE.cmake')
-rw-r--r--modules/FindPCRE.cmake64
1 files changed, 39 insertions, 25 deletions
diff --git a/modules/FindPCRE.cmake b/modules/FindPCRE.cmake
index c5301316..2898a7d9 100644
--- a/modules/FindPCRE.cmake
+++ b/modules/FindPCRE.cmake
@@ -5,38 +5,52 @@
# PCRE_INCLUDE_DIR - the PCRE include directory
# PCRE_LIBRARIES - The libraries needed to use PCRE
-FIND_PATH(PCRE_INCLUDE_DIR pcre.h
+IF (CACHED_PCRE)
+
+ # in cache already
+ IF ("${CACHED_PCRE}" STREQUAL "YES")
+ SET(PCRE_FOUND TRUE)
+ ENDIF ("${CACHED_PCRE}" STREQUAL "YES")
+
+ELSE (CACHED_PCRE)
+
+ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
/usr/include/
/usr/local/include/
-)
+ )
-FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
+ FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
PATHS
/usr/lib
/usr/local/lib
-)
+ )
-FIND_LIBRARY(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix
+ 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)
+ )
+
+ 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 (CACHED_PCRE)