source: git/modules/FindCppUnit.cmake @ 08a955

spielwiese
Last change on this file since 08a955 was 8cc501, checked in by Kai Krüger <krueger@…>, 14 years ago
Added files to compile with cmake. Still experimental. Might not work git-svn-id: file:///usr/local/Singular/svn/trunk@13240 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.1 KB
Line 
1# - Find the cppunit library.
2# Find the native cppunit includes and library
3# This module defines
4#  CPPUNIT_INCLUDE_DIR, where to find jpeglib.h, etc.
5#  CPPUNIT_LIBRARIES, the libraries needed to use CPPUNIT.
6#  CPPUNIT_FOUND, If false, do not try to use CPPUNIT.
7# also defined, but not for general use are
8#  CPPUNIT_LIBRARY, where to find the CPPUNIT library.
9
10IF(WIN32 AND MSVC)
11  SET(CPPUNIT_HOME $ENV{CPPUNIT_HOME})
12ELSE(WIN32 AND MSVC)
13  FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/Priority.hh
14    PATHS ${CMAKE_INCLUDE_PATH} /usr/local/include /usr/include
15    PATH_SUFFIXES include
16  )
17ENDIF(WIN32 AND MSVC)
18
19SET(CPPUNIT_NAMES ${CPPUNIT_NAMES} cppunitD cppunit)
20FIND_LIBRARY(CPPUNIT_LIBRARY
21  NAMES ${CPPUNIT_NAMES}
22  PATHS ${CMAKE_INCLUDE_PATH} /usr/local/include /usr/include
23  PATH_SUFFIXES lib
24)
25
26#message(STATUS "LIB: ${CPPUNIT_LIBRARY}, INC: ${CPPUNIT_INCLUDE_DIR}")
27
28SET(CPPUNIT_INCLUDE_DIR "${CPPUNIT_HOME}/include")
29SET(CPPUNIT_STATIC_LIBRARY_DIRS "${CPPUNIT_HOME}/include")
30SET(CPPUNIT_STATIC_LIBRARIES "${CPPUNIT_HOME}/lib/cppunit.lib")
31
32IF (CPPUNIT_LIBRARY AND CPPUNIT_INCLUDE_DIR)
33    SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
34    SET(CPPUNIT_FOUND "YES")
35ELSE (CPPUNIT_LIBRARY AND CPPUNIT_INCLUDE_DIR)
36  SET(CPPUNIT_FOUND "NO")
37ENDIF (CPPUNIT_LIBRARY AND CPPUNIT_INCLUDE_DIR)
38    SET(CPPUNIT_FOUND "YES")
39
40
41IF (CPPUNIT_FOUND)
42   IF (NOT CPPUNIT_FIND_QUIETLY)
43      MESSAGE(STATUS "Found CPPUNIT: ${CPPUNIT_LIBRARIES}")
44   ENDIF (NOT CPPUNIT_FIND_QUIETLY)
45ELSE (CPPUNIT_FOUND)
46   IF (CPPUNIT_FIND_REQUIRED)
47      MESSAGE(FATAL_ERROR "Could not find CPPUNIT library")
48   ENDIF (CPPUNIT_FIND_REQUIRED)
49ENDIF (CPPUNIT_FOUND)
50
51# Deprecated declarations.
52SET (NATIVE_CPPUNIT_INCLUDE_PATH ${CPPUNIT_INCLUDE_DIR} )
53GET_FILENAME_COMPONENT (NATIVE_CPPUNIT_LIB_PATH ${CPPUNIT_LIBRARY} PATH)
54
55
56message(STATUS "CPPUNIT Libpath: ${CPPUNIT_STATIC_LIBRARIES}")
57message(STATUS "CPPUNIT INCpath: ${CPPUNIT_INCLUDE_DIR}")
58message(STATUS "CPPUNIT: -I${CPPUNIT_STATIC_INCLUDE_DIRS} -L${CPPUNIT_STATIC_LIBRARY_DIRS} -l${CPPUNIT_STATIC_LIBRARIES}")
59
60MARK_AS_ADVANCED(
61  CPPUNIT_STATIC_LIBRARIES
62  CPPUNIT_LIBRARY
63  CPPUNIT_INCLUDE_DIR
64)
Note: See TracBrowser for help on using the repository browser.