1 # Copyright (C) 2013-2023 CEA, EDF, OPEN CASCADE
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Netgen NETGEN_INCLUDE_DIRS 1)
21 MARK_AS_ADVANCED(NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES)
23 # process case when netgen is found in config mode
24 IF(NOT NETGEN_DEFINITIONS AND NETGEN_COMPILE_DEFINITIONS)
25 SET(NETGEN_DEFINITIONS)
26 FOREACH(_ng_def ${NETGEN_COMPILE_DEFINITIONS})
27 LIST(APPEND NETGEN_DEFINITIONS "-D${_ng_def}")
30 IF(NOT NETGEN_LIBRARIES)
32 FOREACH(_ng_lib nglib csg gen geom2d gprim interface la mesh occ stl ngcore)
34 LIST(APPEND NETGEN_LIBRARIES "${_ng_lib}")
38 IF(NOT NETGEN_V5 AND NOT NETGEN_V6 AND NETGEN_VERSION_MAJOR)
39 IF(NETGEN_VERSION_MAJOR VERSION_EQUAL 6)
41 ELSEIF(NETGEN_VERSION_MAJOR VERSION_EQUAL 5)
45 IF(NETGEN_INCLUDE_DIR AND NETGEN_INCLUDE_DIRS)
46 LIST(APPEND NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIR}/core)
48 IF(NETGEN_INCLUDE_DIRS)
49 LIST(REMOVE_DUPLICATES NETGEN_INCLUDE_DIRS)
53 MESSAGE(STATUS "NETGEN V6 or newer found")
54 SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNETGEN_V6")
56 MESSAGE(STATUS "NETGEN V5 found")
57 SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNETGEN_V5")
61 SALOME_ACCUMULATE_HEADERS(NETGEN_INCLUDE_DIRS)
62 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${NETGEN_LIBRARIES})