Win32 compilation.

This commit is contained in:
rnv 2013-10-24 13:46:04 +00:00
parent a312ca18d1
commit 57df145536
4 changed files with 46 additions and 4 deletions

View File

@ -145,6 +145,7 @@ ENDIF(EXISTS ${SMESH_ROOT_DIR})
##
FIND_PACKAGE(SalomeNetgen REQUIRED)
ADD_DEFINITIONS(${NETGEN_DEFINITIONS})
# Detection summary:
SALOME_PACKAGE_REPORT_AND_CHECK()

View 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()

View File

@ -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}")

View 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";