1 ##Copyright (C) arthurtalpaert.
4 ##Redistribution and use in source and binary forms, with or without modification,
5 ##are permitted provided that the following conditions are met:
7 ##* Redistributions of source code must retain the above copyright notice, this
8 ## list of conditions and the following disclaimer.
10 ##* Redistributions in binary form must reproduce the above copyright notice, this
11 ## list of conditions and the following disclaimer in the documentation and/or
12 ## other materials provided with the distribution.
14 ##THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ##ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 ##WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 ##DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18 ##ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 ##(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 ##LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 ##ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 ##(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 ##SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 # - Try to find CDMATH
26 # Once done this will define
28 # CDMATH_FOUND - system has CDMATH
29 # CDMATH_INCLUDES - the CDMATH include directories
30 # CDMATH_LIBRARIES - Link these to use CDMATH
33 # find_package(CDMATH)
35 # Setting these changes the behavior of the search:
36 # CDMATH_DIR - directory in which CDMATH resides
38 # Redistribution and use is allowed according to the terms of the BSD license.
39 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
42 find_path (CDMATH_DIR include/CdmathException.hxx
47 $ENV{HOME}/workspace/cdmath_install
48 DOC "CDMATH Directory")
49 message (STATUS "Found CDMATH: ${CDMATH_DIR}")
52 set(MED_INCLUDES $ENV{MEDFILE_INCLUDE_DIRS})
53 if (NOT (IS_DIRECTORY ${MED_INCLUDES}) )
54 message (SEND_ERROR "MED_INCLUDES can not be used, ${MED_INCLUDES} does not exist.")
56 set(MEDCOUPLING_INCLUDES $ENV{MEDCOUPLING_INCLUDE_DIR})
57 if (NOT (IS_DIRECTORY ${MEDCOUPLING_INCLUDES}) )
58 message (SEND_ERROR "MEDCOUPLING_INCLUDES can not be used, ${MEDCOUPLING_INCLUDES} does not exist.")
60 # This sets the variable ${CDMATH_INCLUDES}.
61 set(CDMATH_INCLUDES ${CDMATH_DIR}/include ${MED_INCLUDES} ${MEDCOUPLING_INCLUDES} )
62 if (NOT (IS_DIRECTORY ${CDMATH_DIR}/include) )
63 message (SEND_ERROR "CDMATH_INCLUDES can not be used, ${CDMATH_DIR}/include does not exist.")
66 # CDMATH libraries against which to link
67 # This sets the variable ${CDMATH_LIBRARIES}.
68 set(CDMATH_LIBDIR ${CDMATH_DIR}/lib)
69 if ( NOT (IS_DIRECTORY ${CDMATH_LIBDIR}) )
70 message (SEND_ERROR "CDMATH_LIBDIR can not be used, ${CDMATH_LIBDIR} does not exist.")
72 find_library (CDMATHBASE_LIB NAMES base PATHS ${CDMATH_LIBDIR})
73 find_library (CDMATHMESH_LIB NAMES mesh PATHS ${CDMATH_LIBDIR})
74 find_library (CDMATHLINEARSOLVER_LIB NAMES linearsolver PATHS ${CDMATH_LIBDIR})
75 find_library (MEDC_LIB NAMES medC PATHS $ENV{MEDFILE_ROOT_DIR}/lib)
76 find_library (MEDLOADER_LIB NAMES medloader PATHS $ENV{MEDCOUPLING_LIBRARIES})
77 find_library (MEDCOUPLING_LIB NAMES medcoupling PATHS $ENV{MEDCOUPLING_LIBRARIES})
84 ${CDMATHLINEARSOLVER_LIB}