Salome HOME
CMake: tweaks for Win32 platform: configuration is successful
[modules/kernel.git] / salome_adm / cmake_files / FindCppUnit.cmake
1 # - Find CppUnit
2 # Sets the following variables:
3 #   CPPUNIT_INCLUDE_DIR  - path to the CppUnit include directory
4 #   CPPUNIT_LIBRARIES    - path to the CppUnit libraries to be linked against
5 #   CPPUNIT_DEFINITIONS  - specific CppUnit definitions to be added
6 #
7 #  The header cppunit/extensions/HelperMacros.h is looked for.
8 #  The following libraries are searched  
9 #        cppunit_dll, or cppunitd_dll (Windows) 
10 #        cppunit (Linux)
11 #
12
13 #########################################################################
14 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
15 #
16 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
17 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
18 #
19 # This library is free software; you can redistribute it and/or
20 # modify it under the terms of the GNU Lesser General Public
21 # License as published by the Free Software Foundation; either
22 # version 2.1 of the License.
23 #
24 # This library is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 # Lesser General Public License for more details.
28 #
29 # You should have received a copy of the GNU Lesser General Public
30 # License along with this library; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
32 #
33 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
34 #
35
36 IF(NOT CppUnit_FIND_QUIETLY)
37     MESSAGE(STATUS "Looking for CppUnit ...")
38 ENDIF()
39
40 # Headers  
41 SET(CPPUNIT_INCLUDE_TO_FIND cppunit/extensions/HelperMacros.h)
42 FIND_PATH(CPPUNIT_INCLUDE_DIR ${CPPUNIT_INCLUDE_TO_FIND})
43
44 # Libraries
45 IF(WINDOWS)
46   IF(CMAKE_BUILD_TYPE STREQUAL Debug)
47     FIND_LIBRARY(CPPUNIT_LIBRARIES cppunitd_dll)
48   ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
49     FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit_dll)
50   ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
51 ELSE(WINDOWS)
52   FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit)
53 ENDIF(WINDOWS)
54
55 # Global variables
56 SET(CPPUNIT_DEFINITIONS)
57 IF(WINDOWS)
58   SET(CPPUNIT_DEFINITIONS -DCPPUNIT_DLL)
59 ENDIF(WINDOWS)
60
61 INCLUDE(FindPackageHandleStandardArgs)
62 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUnit REQUIRED_VARS CPPUNIT_INCLUDE_DIR CPPUNIT_LIBRARIES)
63
64