Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 1 | # - 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 | |
| 24 | find_path(CMOCKA_INCLUDE_DIR |
| 25 | NAMES |
| 26 | cmocka.h |
| 27 | PATHS |
| 28 | ${CMOCKA_ROOT_DIR}/include |
| 29 | ) |
| 30 | |
| 31 | find_library(CMOCKA_LIBRARY |
| 32 | NAMES |
| 33 | cmocka |
| 34 | PATHS |
| 35 | ${CMOCKA_ROOT_DIR}/include |
| 36 | ) |
| 37 | |
Claus Klein | 2209191 | 2020-01-20 13:45:47 +0100 | [diff] [blame] | 38 | if(CMOCKA_LIBRARY) |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 39 | set(CMOCKA_LIBRARIES |
| 40 | ${CMOCKA_LIBRARIES} |
| 41 | ${CMOCKA_LIBRARY} |
| 42 | ) |
Claus Klein | 2209191 | 2020-01-20 13:45:47 +0100 | [diff] [blame] | 43 | endif() |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 44 | |
| 45 | include(FindPackageHandleStandardArgs) |
Michal Vasko | e381280 | 2020-05-19 16:03:11 +0200 | [diff] [blame^] | 46 | find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 47 | |
| 48 | # show the CMOCKA_INCLUDE_DIR and CMOCKA_LIBRARIES variables only in the advanced view |
| 49 | mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARIES) |