aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/FindCppUnit.cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmake/FindCppUnit.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake
new file mode 100644
index 00000000..71d50356
--- /dev/null
+++ b/cmake/FindCppUnit.cmake
@@ -0,0 +1,18 @@
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(CPPUNIT "cppunit")
+
+IF(CPPUNIT_FOUND)
+
+ SET(CPPUNIT_LIBRARY "${CPPUNIT_LIBRARIES}")
+
+ELSE()
+
+ FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h)
+ FIND_LIBRARY(CPPUNIT_LIBRARY NAMES cppunit libcppunit)
+
+ INCLUDE(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIRS)
+
+ MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARY)
+
+ENDIF()