1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 MESSAGE(STATUS "Check for cppunit ...")
28 IF(CPPUNIT_IS_MANDATORY STREQUAL 0)
29 SET(CPPUNIT_IS_MANDATORY 0)
30 SET(CPPUNIT_IS_OPTIONAL 1)
31 ENDIF(CPPUNIT_IS_MANDATORY STREQUAL 0)
32 IF(CPPUNIT_IS_OPTIONAL STREQUAL 0)
33 SET(CPPUNIT_IS_MANDATORY 1)
34 SET(CPPUNIT_IS_OPTIONAL 0)
35 ENDIF(CPPUNIT_IS_OPTIONAL STREQUAL 0)
36 IF(NOT CPPUNIT_IS_MANDATORY AND NOT CPPUNIT_IS_OPTIONAL)
37 SET(CPPUNIT_IS_MANDATORY 0)
38 SET(CPPUNIT_IS_OPTIONAL 1)
39 ENDIF(NOT CPPUNIT_IS_MANDATORY AND NOT CPPUNIT_IS_OPTIONAL)
44 IF(WITHOUT_CPPUNIT OR WITH_CPPUNIT STREQUAL 0)
46 MESSAGE(STATUS "cppunit disabled from command line.")
47 ENDIF(WITHOUT_CPPUNIT OR WITH_CPPUNIT STREQUAL 0)
53 SET(CPPUNIT_ROOT_USER ${WITH_CPPUNIT})
55 SET(CPPUNIT_ROOT_USER $ENV{CPPUNIT_ROOT})
63 SET(CPPUNIT_FIND_PATHS_OPTION NO_DEFAULT_PATH)
64 ELSE(CPPUNIT_ROOT_USER)
65 SET(CPPUNIT_FIND_PATHS_OPTION)
66 ENDIF(CPPUNIT_ROOT_USER)
73 SET(CPPUNIT_INCLUDE_PATHS ${CPPUNIT_ROOT_USER} ${CPPUNIT_ROOT_USER}/include)
74 ELSE(CPPUNIT_ROOT_USER)
75 SET(CPPUNIT_INCLUDE_PATHS)
76 ENDIF(CPPUNIT_ROOT_USER)
77 SET(CPPUNIT_INCLUDE_TO_FIND cppunit/extensions/HelperMacros.h)
78 FIND_PATH(CPPUNIT_INCLUDE_DIR ${CPPUNIT_INCLUDE_TO_FIND} PATHS ${CPPUNIT_INCLUDE_PATHS} ${CPPUNIT_FIND_PATHS_OPTION})
79 IF(CPPUNIT_INCLUDE_DIR)
81 SET(CPPUNIT_INCLUDES -I${CPPUNIT_INCLUDE_DIR})
82 ENDIF(CPPUNIT_ROOT_USER)
83 MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} found in ${CPPUNIT_INCLUDE_DIR}")
84 ELSE(CPPUNIT_INCLUDE_DIR)
87 MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} not found in ${CPPUNIT_INCLUDE_PATHS}, check your CPPUNIT installation.")
88 ELSE(CPPUNIT_ROOT_USER)
89 MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} not found on system, try to use WITH_CPPUNIT option or CPPUNIT_ROOT environment variable.")
90 ENDIF(CPPUNIT_ROOT_USER)
91 ENDIF(CPPUNIT_INCLUDE_DIR)
98 SET(CPPUNIT_LIB_PATHS ${CPPUNIT_ROOT_USER}/lib)
99 ELSE(CPPUNIT_ROOT_USER)
100 SET(CPPUNIT_LIB_PATHS)
101 ENDIF(CPPUNIT_ROOT_USER)
102 ENDIF(CPPUNIT_STATUS)
106 FIND_LIBRARY(CPPUNIT_LIB cppunitd_dll PATHS ${CPPUNIT_LIB_PATHS} ${CPPUNIT_FIND_PATHS_OPTION})
108 FIND_LIBRARY(CPPUNIT_LIB cppunit PATHS ${CPPUNIT_LIB_PATHS} ${CPPUNIT_FIND_PATHS_OPTION})
112 SET(CPPUNIT_LIBS ${CPPUNIT_LIBS} ${CPPUNIT_LIB})
113 MESSAGE(STATUS "cppunit lib found: ${CPPUNIT_LIB}")
115 SET(CPPUNIT_STATUS 0)
116 IF(CPPUNIT_ROOT_USER)
117 MESSAGE(STATUS "cppunit lib not found in ${CPPUNIT_LIB_PATHS}, check your CPPUNIT installation.")
118 ELSE(CPPUNIT_ROOT_USER)
119 MESSAGE(STATUS "cppunit lib not found on system, try to use WITH_CPPUNIT option or CPPUNIT_ROOT environment variable.")
120 ENDIF(CPPUNIT_ROOT_USER)
122 ENDIF(CPPUNIT_STATUS)
129 SET(CPPUNIT_INCLUDES ${CPPUNIT_INCLUDES} -DCPPUNIT_DLL)
132 IF(CPPUNIT_IS_MANDATORY)
133 MESSAGE(FATAL_ERROR "cppunit not found ... mandatory ... abort")
134 ELSE(CPPUNIT_IS_MANDATORY)
135 MESSAGE(STATUS "cppunit not found ... optional ... disabled")
136 ENDIF(CPPUNIT_IS_MANDATORY)
137 ENDIF(CPPUNIT_STATUS)