2 # Find the CppUnit includes and library
5 # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
6 # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
7 # CPPUNIT_FOUND, If false, do not try to use CppUnit.
9 # also defined, but not for general use are
10 # CPPUNIT_LIBRARY, where to find the CppUnit library.
11 # CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug
14 SET(CPPUNIT_FOUND "NO")
16 FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h /usr/local/include /usr/include)
18 # With Win32, important to have both
20 FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
21 ${CPPUNIT_INCLUDE_DIR}/../lib
24 FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
25 ${CPPUNIT_INCLUDE_DIR}/../lib
29 # On unix system, debug and release have the same name
30 FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
31 ${CPPUNIT_INCLUDE_DIR}/../lib
34 FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
35 ${CPPUNIT_INCLUDE_DIR}/../lib
40 IF(CPPUNIT_INCLUDE_DIR)
42 SET(CPPUNIT_FOUND "YES")
43 SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
44 SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY} ${CMAKE_DL_LIBS})
45 ELSE (CPPUNIT_LIBRARY)
46 IF (CPPUNIT_FIND_REQUIRED)
47 MESSAGE(SEND_ERROR "Could not find library CppUnit.")
48 ENDIF (CPPUNIT_FIND_REQUIRED)
49 ENDIF(CPPUNIT_LIBRARY)
50 ELSE(CPPUNIT_INCLUDE_DIR)
51 IF (CPPUNIT_FIND_REQUIRED)
52 MESSAGE(SEND_ERROR "Could not find library CppUnit.")
53 ENDIF(CPPUNIT_FIND_REQUIRED)
54 ENDIF(CPPUNIT_INCLUDE_DIR)