FindCppUnit.cmake 1.3 KB
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIR, 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.

# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CppUnit library.
# CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug mode.

FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h HINTS
		/usr/local/include
		/usr/include
		ENV CppUnit_ROOT
	 )

# With Win32, important to have both
IF(WIN32)
	FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
			${CPPUNIT_INCLUDE_DIR}/../lib
			/usr/local/lib
			/usr/lib)
	FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
			${CPPUNIT_INCLUDE_DIR}/../lib
			/usr/local/lib
			/usr/lib)
ELSE(WIN32)
# On unix system, debug and release have the same name
	FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
			${CPPUNIT_INCLUDE_DIR}/../lib
			/usr/local/lib
			/usr/lib)
	FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
			${CPPUNIT_INCLUDE_DIR}/../lib
			/usr/local/lib
			/usr/lib)
ENDIF(WIN32)

	IF(CPPUNIT_INCLUDE_DIR)
IF(CPPUNIT_LIBRARY)
	SET(CPPUNIT_FOUND "YES")
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
	SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
			${CMAKE_DL_LIBS})
	ENDIF(CPPUNIT_LIBRARY)
ENDIF(CPPUNIT_INCLUDE_DIR)