nextcloud-desktop/cmake/Modules/FindCheck.cmake

64 lines
1.5 KiB
CMake
Raw Normal View History

# - Try to find Check
# Once done this will define
2008-02-27 20:56:47 +03:00
#
# CHECK_FOUND - system has Check
# CHECK_INCLUDE_DIRS - the Check include directory
# CHECK_LIBRARIES - Link these to use Check
# CHECK_DEFINITIONS - Compiler switches required for using Check
#
2009-09-01 14:16:51 +04:00
# Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
2008-02-27 20:56:47 +03:00
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
# in cache already
2009-09-01 14:16:51 +04:00
set(CHECK_FOUND TRUE PARENT_SCOPE)
else (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
2009-09-01 14:16:51 +04:00
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_CHECK check)
endif (PKG_CONFIG_FOUND)
find_path(CHECK_INCLUDE_DIR
NAMES
check.h
PATHS
${_CHECK_INCLUDEDIR}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
2008-02-27 20:56:47 +03:00
find_library(CHECK_LIBRARY
NAMES
check
PATHS
2009-09-01 14:16:51 +04:00
${_CHECK_LIBDIR}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
2008-02-27 20:56:47 +03:00
set(CHECK_INCLUDE_DIRS
${CHECK_INCLUDE_DIR}
)
2008-02-27 20:56:47 +03:00
2009-09-01 14:16:51 +04:00
set(CHECK_LIBRARIES
${CHECK_LIBRARY}
)
2008-02-27 20:56:47 +03:00
2009-09-01 14:16:51 +04:00
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Check DEFAULT_MSG CHECK_LIBRARIES CHECK_INCLUDE_DIRS)
2008-02-27 20:56:47 +03:00
# show the CHECK_INCLUDE_DIRS and CHECK_LIBRARIES variables only in the advanced view
mark_as_advanced(CHECK_INCLUDE_DIRS CHECK_LIBRARIES)
2008-02-27 20:56:47 +03:00
endif (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
2008-02-27 20:56:47 +03:00