summaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2008-10-20 13:49:27 +0000
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2008-10-20 13:49:27 +0000
commita341a44fe22ea8aa602b925d5fbcc70874e8f986 (patch)
tree2b5eba18bbb14b41436a3b84933ee863f1a5aa15 /cmake/modules
parent1496de928f61f3209da2c85b771270f8b7ac0848 (diff)
downloadlibsolv-a341a44fe22ea8aa602b925d5fbcc70874e8f986.tar.gz
libsolv-a341a44fe22ea8aa602b925d5fbcc70874e8f986.tar.bz2
libsolv-a341a44fe22ea8aa602b925d5fbcc70874e8f986.zip
- refactor FindCheck
- Use FindZLib - Still can't figure out why required does not work
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindCheck.cmake43
1 files changed, 17 insertions, 26 deletions
diff --git a/cmake/modules/FindCheck.cmake b/cmake/modules/FindCheck.cmake
index bcc0e5b..c40bfbf 100644
--- a/cmake/modules/FindCheck.cmake
+++ b/cmake/modules/FindCheck.cmake
@@ -1,33 +1,24 @@
+IF (CHECK_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(CHECK_FIND_QUIETLY TRUE)
+ENDIF (CHECK_INCLUDE_DIR)
+
FIND_PATH(CHECK_INCLUDE_DIR NAMES check.h)
-MARK_AS_ADVANCED(CHECK_INCLUDE_DIR)
# Look for the library.
FIND_LIBRARY(CHECK_LIBRARY NAMES check)
-MARK_AS_ADVANCED(CHECK_LIBRARY)
-# Copy the results to the output variables.
-IF(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
- SET(CHECK_FOUND 1)
- SET(CHECK_LIBRARIES ${CHECK_LIBRARY})
- SET(CHECK_INCLUDE_DIRS ${CHECK_INCLUDE_DIR})
-ELSE(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
- SET(CHECK_FOUND 0)
- SET(CHECK_LIBRARIES)
- SET(CHECK_INCLUDE_DIRS)
-ENDIF(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
+# handle the QUIETLY and REQUIRED arguments and set CHECK_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHECK "Please install 'check' and 'check-devel' packages" CHECK_LIBRARY CHECK_INCLUDE_DIR)
-# Report the results.
-IF(NOT CHECK_FOUND)
- SET(CHECK_DIR_MESSAGE
- "check C unit testing library was not found. Install check and check-devel.")
- IF(NOT Check_FIND_QUIETLY)
- MESSAGE(STATUS "${CHECK_DIR_MESSAGE}")
- ELSE(NOT Check_FIND_QUIETLY)
- IF(Check_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${CHECK_DIR_MESSAGE}")
- ENDIF(Check_FIND_REQUIRED)
- ENDIF(NOT Check_FIND_QUIETLY)
-ELSE(NOT CHECK_FOUND)
- MESSAGE(STATUS "check C unit testing library: ${CHECK_LIBRARIES}")
-ENDIF(NOT CHECK_FOUND)
+IF(CHECK_FOUND)
+ SET( CHECK_LIBRARIES ${CHECK_LIBRARY} )
+ELSE(CHECK_FOUND)
+ SET( CHECK_LIBRARIES )
+ENDIF(CHECK_FOUND)
+
+MARK_AS_ADVANCED(CHECK_INCLUDE_DIR)
+MARK_AS_ADVANCED(CHECK_LIBRARY)