]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
Win32 compilation.
authorrnv <rnv@opencascade.com>
Thu, 24 Oct 2013 13:46:04 +0000 (13:46 +0000)
committerrnv <rnv@opencascade.com>
Thu, 24 Oct 2013 13:46:04 +0000 (13:46 +0000)
CMakeLists.txt
adm_local/cmake_files/FindNetgen.cmake
doc/salome/gui/NETGENPLUGIN/CMakeLists.txt
src/NETGENPlugin/NETGENPlugin_Mesher.cxx

index 9ae9557f848dc14e6d7aea126c7aaa113ce60e36..de6b16e433c85e0bed45b128808ac3bd7266d5d9 100755 (executable)
@@ -145,6 +145,7 @@ ENDIF(EXISTS ${SMESH_ROOT_DIR})
 ##
 
 FIND_PACKAGE(SalomeNetgen REQUIRED)
+ADD_DEFINITIONS(${NETGEN_DEFINITIONS})
 
 # Detection summary:
 SALOME_PACKAGE_REPORT_AND_CHECK()
index 7fe64e97e775c55c281ad502094b008734129044..f4ea2eca6ad2733d54a4893b32a9332bd415fa96 100644 (file)
@@ -47,7 +47,34 @@ FIND_PATH(_netgen_add_inc_dir occgeom.hpp HINTS ${_netgen_base_inc_dir} PATH_SUF
 LIST(APPEND NETGEN_INCLUDE_DIRS ${_netgen_add_inc_dir})
 LIST(REMOVE_DUPLICATES NETGEN_INCLUDE_DIRS)
 
-FIND_LIBRARY(NETGEN_LIBRARIES NAMES nglib)
+FIND_LIBRARY(NETGEN_nglib NAMES nglib)
+IF(WIN32)
+  FIND_LIBRARY(NETGEN_csg NAMES csg)
+  FIND_LIBRARY(NETGEN_gen NAMES gen)
+  FIND_LIBRARY(NETGEN_geom2d NAMES geom2d)
+  FIND_LIBRARY(NETGEN_gprim NAMES gprim)
+  FIND_LIBRARY(NETGEN_interface NAMES interface)
+  FIND_LIBRARY(NETGEN_la NAMES la)
+  FIND_LIBRARY(NETGEN_mesh NAMES mesh)
+  FIND_LIBRARY(NETGEN_occ NAMES occ)
+  FIND_LIBRARY(NETGEN_stl NAMES stl)
+ENDIF(WIN32)
+
+SET(NETGEN_LIBRARIES ${NETGEN_nglib})
+
+IF(WIN32)
+  SET(NETGEN_LIBRARIES ${NETGEN_LIBRARIES}
+      ${NETGEN_csg}
+      ${NETGEN_gen}
+      ${NETGEN_geom2d}
+      ${NETGEN_gprim}
+      ${NETGEN_interface}
+      ${NETGEN_la}
+      ${NETGEN_mesh}
+      ${NETGEN_occ}
+      ${NETGEN_stl}
+   )
+ENDIF(WIN32)
 
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETGEN REQUIRED_VARS NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES)
@@ -56,4 +83,11 @@ IF(NETGEN_FOUND)
   IF(NOT Netgen_FIND_QUIETLY)
     MESSAGE(STATUS "Netgen library: ${NETGEN_LIBRARIES}")
   ENDIF()
+  SET(NETGEN_DEFINITIONS "-DOCCGEOMETRY")
+
+  #RNV:  currently on windows use netgen without thread support.
+  #TODO: check support of the multithreading on windows
+  IF(WIN32)
+   SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNO_PARALLEL_THREADS")
+  ENDIF(WIN32)
 ENDIF()
index fe0e0e0b28da06f75ff0038dacce304ac7ef6a85..6fa8eabfe7ddcd152428da6bd3aa4ce5a0dfae6a 100755 (executable)
@@ -27,7 +27,7 @@ SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/stati
 SET(DOC_SMESH_MeshersList NETGENPlugin)
 SET(f1 "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
-IF(WINDOWS)
+IF(WIN32)
   STRING(REPLACE "/" "\\" f ${f})
   STRING(REPLACE "/" "\\" f1 ${f1})
   STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH%
@@ -46,7 +46,7 @@ IF(WINDOWS)
   ")
   SET(EXT "bat")
   SET(CALL_STR "call")
-ELSE(WINDOWS)
+ELSE(WIN32)
   SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages)
   SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome")
   SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH}
@@ -55,7 +55,7 @@ ELSE(WINDOWS)
   ")
   SET(EXT "sh")
   SET(CALL_STR ".")
-ENDIF(WINDOWS)
+ENDIF(WIN32)
 
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} "${SCR}")
 
index 8c95376b289254c314bb04f3eb4b78c316a230a2..a0a380e23a5a4c979588b9b6ee7f1618b11f215a 100644 (file)
@@ -88,6 +88,9 @@ namespace netgen {
 #include <vector>
 #include <limits>
 
+#ifdef WIN32
+#include <process.h>
+#endif
 using namespace nglib;
 using namespace std;
 
@@ -3652,7 +3655,11 @@ std::string NETGENPlugin_NetgenLibWrapper::getOutputFileName()
 
   TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str();
   aGenericName += "NETGEN_";
+#ifndef WIN32
   aGenericName += getpid();
+#else
+  aGenericName += _getpid();
+#endif
   aGenericName += "_";
   aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString());
   aGenericName += ".out";