FindCheck.cmake 1.7 KB

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