Added find module for criterion

This commit is contained in:
Snaipe 2015-09-09 17:14:45 +02:00
parent eb80cb914a
commit e5ec792907
2 changed files with 33 additions and 0 deletions

View file

@ -67,6 +67,10 @@ Sample tests can be found in the [sample directory][samples].
Gitter.im chat room: [![Join the chat at https://gitter.im/Snaipe/Criterion](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Snaipe/Criterion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### Misc
* [CMake find module for Criterion][find-module]
## F.A.Q.
**Q. What's wrong with other C test frameworks?**
@ -98,3 +102,5 @@ Logo done by [Greehm](http://www.cargocollective.com/pbouigue)
[sample-fixtures]: ./samples/fixtures.c
[sample-signal]: ./samples/signal.c
[sample-report]: ./samples/report.c
[find-module]: ./dev/FindCriterion.cmake

27
dev/FindCriterion.cmake Normal file
View file

@ -0,0 +1,27 @@
# This file is licensed under the WTFPL version 2 -- you can see the full
# license over at http://www.wtfpl.net/txt/copying/
#
# - Try to find Criterion
#
# Once done this will define
# CRITERION_FOUND - System has LibXml2
# CRITERION_INCLUDE_DIRS - The LibXml2 include directories
# CRITERION_LIBRARIES - The libraries needed to use LibXml2
find_package(PkgConfig)
find_path(CRITERION_INCLUDE_DIR criterion/criterion.h
PATH_SUFFIXES criterion)
find_library(CRITERION_LIBRARY NAMES criterion libcriterion)
set(CRITERION_LIBRARIES ${CRITERION_LIBRARY})
set(CRITERION_INCLUDE_DIRS ${CRITERION_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CRITERION_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
CRITERION_LIBRARY CRITERION_INCLUDE_DIR)
mark_as_advanced(CRITERION_INCLUDE_DIR CRITERION_LIBRARY)