summaryrefslogtreecommitdiff
path: root/cmake/Modules/FindCppUnit.cmake
diff options
context:
space:
mode:
authorJosh Blum2011-07-20 19:04:32 -0700
committerJosh Blum2011-07-20 19:04:32 -0700
commitaccb9f2fe8fd8f6a1e114adac5b15304b0e0012d (patch)
tree09ca98093b2555464265d64fd495fed6102159b4 /cmake/Modules/FindCppUnit.cmake
parentf914499f4a96fe69ab9cd8dba48f8e3bfc7a54e5 (diff)
downloadgnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.tar.gz
gnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.tar.bz2
gnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.zip
gr: squashed cmakelists.txt into one commit
Diffstat (limited to 'cmake/Modules/FindCppUnit.cmake')
-rw-r--r--cmake/Modules/FindCppUnit.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake
new file mode 100644
index 000000000..bb06c3c11
--- /dev/null
+++ b/cmake/Modules/FindCppUnit.cmake
@@ -0,0 +1,33 @@
+# http://www.cmake.org/pipermail/cmake/2006-October/011446.html
+#
+# Find the CppUnit includes and library
+#
+# This module defines
+# CPPUNIT_INCLUDE_DIRS, where to find tiff.h, etc.
+# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
+# CPPUNIT_FOUND, If false, do not try to use CppUnit.
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(CPPUNIT "cppunit")
+IF(NOT CPPUNIT_FOUND)
+
+FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h
+ /usr/local/include
+ /usr/include
+)
+
+FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit
+ ${CPPUNIT_INCLUDE_DIRS}/../lib
+ /usr/local/lib
+ /usr/lib)
+
+IF(CPPUNIT_INCLUDE_DIRS)
+ IF(CPPUNIT_LIBRARIES)
+ SET(CPPUNIT_FOUND "YES")
+ SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES} ${CMAKE_DL_LIBS})
+ ENDIF(CPPUNIT_LIBRARIES)
+ENDIF(CPPUNIT_INCLUDE_DIRS)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
+ENDIF(NOT CPPUNIT_FOUND)