FindCheck.cmake 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # - Try to find the CHECK libraries
  2. # Once done this will define
  3. #
  4. # CHECK_FOUND - system has check
  5. # CHECK_INCLUDE_DIR - the check include directory
  6. # CHECK_LIBRARIES - check library
  7. #
  8. # This configuration file for finding libcheck is originally from
  9. # the opensync project. The originally was downloaded from here:
  10. # opensync.org/browser/branches/3rd-party-cmake-modules/modules/FindCheck.cmake
  11. #
  12. # Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
  13. # Copyright (c) 2007 Bjoern Ricks <b.ricks@fh-osnabrueck.de>
  14. #
  15. # Redistribution and use is allowed according to the terms of the New
  16. # BSD license.
  17. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  18. INCLUDE( FindPkgConfig )
  19. # Take care about check.pc settings
  20. PKG_SEARCH_MODULE( CHECK check )
  21. # Look for CHECK include dir and libraries
  22. IF( NOT CHECK_FOUND )
  23. IF ( CHECK_INSTALL_DIR )
  24. MESSAGE ( STATUS "Using override CHECK_INSTALL_DIR to find check" )
  25. SET ( CHECK_INCLUDE_DIR "${CHECK_INSTALL_DIR}/include" )
  26. FIND_LIBRARY( CHECK_LIBRARY NAMES check PATHS "${CHECK_INSTALL_DIR}/lib" )
  27. IF (WIN32)
  28. FIND_LIBRARY( COMPAT_LIBRARY NAMES compat PATHS "${CHECK_INSTALL_DIR}/lib" )
  29. ENDIF (WIN32)
  30. ELSE ( CHECK_INSTALL_DIR )
  31. FIND_PATH( CHECK_INCLUDE_DIR check.h )
  32. FIND_LIBRARY( CHECK_LIBRARY NAMES check )
  33. IF (WIN32)
  34. FIND_LIBRARY( COMPAT_LIBRARY NAMES compat )
  35. ENDIF (WIN32)
  36. ENDIF ( CHECK_INSTALL_DIR )
  37. IF (WIN32)
  38. SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" "${COMPAT_LIBRARY}" )
  39. ELSE ( WIN32)
  40. SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" )
  41. ENDIF (WIN32)
  42. IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
  43. SET( CHECK_FOUND 1 )
  44. IF ( NOT Check_FIND_QUIETLY )
  45. MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" )
  46. ENDIF ( NOT Check_FIND_QUIETLY )
  47. ELSE ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
  48. IF ( Check_FIND_REQUIRED )
  49. MESSAGE( FATAL_ERROR "Could NOT find CHECK" )
  50. ELSE ( Check_FIND_REQUIRED )
  51. IF ( NOT Check_FIND_QUIETLY )
  52. MESSAGE( STATUS "Could NOT find CHECK" )
  53. ENDIF ( NOT Check_FIND_QUIETLY )
  54. ENDIF ( Check_FIND_REQUIRED )
  55. ENDIF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
  56. ENDIF( NOT CHECK_FOUND )
  57. # Hide advanced variables from CMake GUIs
  58. MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY)
  59. IF( WIN32 )
  60. MARK_AS_ADVANCED( COMPAT_LIBRARY)
  61. ENDIF()