1 # - Try to find the CHECK libraries
2 # Once done this will define
4 # CHECK_FOUND - system has check
5 # CHECK_INCLUDE_DIRS - the check include directory
6 # CHECK_LIBRARIES - check library
8 # Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
9 # Copyright (c) 2007-2009 Bjoern Ricks <bjoern.ricks@gmail.com>
11 # Redistribution and use is allowed according to the terms of the New
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16 INCLUDE( FindPkgConfig )
18 IF ( Check_FIND_REQUIRED )
19 SET( _pkgconfig_REQUIRED "REQUIRED" )
20 ELSE( Check_FIND_REQUIRED )
21 SET( _pkgconfig_REQUIRED "" )
22 ENDIF ( Check_FIND_REQUIRED )
24 IF ( CHECK_MIN_VERSION )
25 PKG_SEARCH_MODULE( CHECK ${_pkgconfig_REQUIRED} check>=${CHECK_MIN_VERSION} )
26 ELSE ( CHECK_MIN_VERSION )
27 PKG_SEARCH_MODULE( CHECK ${_pkgconfig_REQUIRED} check )
28 ENDIF ( CHECK_MIN_VERSION )
30 # Look for CHECK include dir and libraries
31 IF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
33 FIND_PATH( CHECK_INCLUDE_DIRS check.h )
35 FIND_LIBRARY( CHECK_LIBRARIES NAMES check )
37 IF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
39 IF ( NOT Check_FIND_QUIETLY )
40 MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" )
41 ENDIF ( NOT Check_FIND_QUIETLY )
42 ELSE ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
43 IF ( Check_FIND_REQUIRED )
44 MESSAGE( FATAL_ERROR "Could NOT find CHECK" )
45 ELSE ( Check_FIND_REQUIRED )
46 IF ( NOT Check_FIND_QUIETLY )
47 MESSAGE( STATUS "Could NOT find CHECK" )
48 ENDIF ( NOT Check_FIND_QUIETLY )
49 ENDIF ( Check_FIND_REQUIRED )
50 ENDIF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
51 ENDIF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
53 # Hide advanced variables from CMake GUIs
54 MARK_AS_ADVANCED( CHECK_INCLUDE_DIRS CHECK_LIBRARIES )