blob: 2dd9fc5f88925befdcbf03ebcbac0e3034ab225c [file] [log] [blame]
Radek Krejcie84f12f2018-09-18 14:11:50 +02001# - Try to find CMocka
2# Once done this will define
3#
4# CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
5#
6# Read-Only variables:
7# CMOCKA_FOUND - system has CMocka
8# CMOCKA_INCLUDE_DIR - the CMocka include directory
9# CMOCKA_LIBRARIES - Link these to use CMocka
10# CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
11#
12#=============================================================================
13# Copyright (c) 2011-2012 Andreas Schneider <asn@cryptomilk.org>
14#
15# Distributed under the OSI-approved BSD License (the "License");
16# see accompanying file Copyright.txt for details.
17#
18# This software is distributed WITHOUT ANY WARRANTY; without even the
19# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20# See the License for more information.
21#=============================================================================
22#
23
24find_path(CMOCKA_INCLUDE_DIR
25 NAMES
26 cmocka.h
27 PATHS
28 ${CMOCKA_ROOT_DIR}/include
29)
30
31find_library(CMOCKA_LIBRARY
32 NAMES
33 cmocka
34 PATHS
35 ${CMOCKA_ROOT_DIR}/include
36)
37
38if (CMOCKA_LIBRARY)
39 set(CMOCKA_LIBRARIES
40 ${CMOCKA_LIBRARIES}
41 ${CMOCKA_LIBRARY}
42 )
43endif (CMOCKA_LIBRARY)
44
45include(FindPackageHandleStandardArgs)
46find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)
47
48# show the CMOCKA_INCLUDE_DIR and CMOCKA_LIBRARIES variables only in the advanced view
49mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARIES)