Salome HOME
Merge from V6_main 13/12/2012
[plugins/blsurfplugin.git] / adm_local / cmake_files / FindCADSURF.cmake
diff --git a/adm_local/cmake_files/FindCADSURF.cmake b/adm_local/cmake_files/FindCADSURF.cmake
new file mode 100644 (file)
index 0000000..6822a40
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(MESHGEMSHOME $ENV{MESHGEMSHOME})
+FIND_PATH(CADSURF_INCLUDES_DIR meshgems/cadsurf.h ${MESHGEMSHOME}/include)
+SET(MESHGEMS_CADSURF_INCLUDES)
+SET(MESHGEMS_CADSURF_INCLUDES ${MESHGEMS_CADSURF_INCLUDES} -I${CADSURF_INCLUDES_DIR})
+
+SET(CADSURF_LIBS_PATHS)
+SET(CADSURF_LIBS_PATHS ${CADSURF_LIBS_PATHS} ${MESHGEMSHOME}/lib)
+IF(WINDOWS)
+  SET(CADSURF_LIBS_PATHS ${CADSURF_LIBS_PATHS} ${MESHGEMSHOME}/lib/WinXP_VC9)
+ELSE(WINDOWS)
+  IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+    SET(CADSURF_LIBS_PATHS ${CADSURF_LIBS_PATHS} ${MESHGEMSHOME}/lib/Linux_64)
+  ELSE()
+    SET(CADSURF_LIBS_PATHS ${CADSURF_LIBS_PATHS} ${MESHGEMSHOME}/lib/Linux)
+  ENDIF()
+ENDIF(WINDOWS)
+
+FIND_LIBRARY(mg-cadsurf mg-cadsurf PATHS ${CADSURF_LIBS_PATHS})
+FIND_LIBRARY(mg-precad mg-precad PATHS ${CADSURF_LIBS_PATHS})
+FIND_LIBRARY(meshgems meshgems PATHS ${CADSURF_LIBS_PATHS})
+
+SET(MESHGEMS_CADSURF_LIBS)
+SET(MESHGEMS_CADSURF_LIBS ${MESHGEMS_CADSURF_LIBS} ${mg-cadsurf})
+SET(MESHGEMS_CADSURF_LIBS ${MESHGEMS_CADSURF_LIBS} ${mg-precad})
+IF(meshgems)
+  SET(MESHGEMS_CADSURF_LIBS ${MESHGEMS_CADSURF_LIBS} ${meshgems})
+ENDIF(meshgems)