SALOME 9.1.0 Windows version

This commit is contained in:
rnv 2018-08-29 14:23:17 +03:00 committed by vsr
parent ddca8a32b0
commit b24ee9fa23
5 changed files with 62 additions and 8 deletions

View File

@ -76,7 +76,12 @@
#include <utility>
// boost includes
#include <boost/version.hpp>
#if BOOST_VERSION < 106700
#include <boost/utility.hpp>
#else
#include <boost/next_prior.hpp>
#endif
// Constructors
enum{

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -112,7 +112,21 @@ namespace
xmlPath += sep;
xmlPath += "share" + sep + "salome" + sep + "resources" + sep + "geom" + sep + plugin + ".xml";
#ifdef WIN32
fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
#ifdef UNICODE
//RNV: this is workaround for providing compilation,
// path should be processed as unicode string.
size_t length = strlen(xmlPath.c_str()) + sizeof(char);
wchar_t* aPath = new wchar_t[length + 1];
memset(aPath, '\0', length);
mbstowcs(aPath, xmlPath.c_str(), length);
#else
const char* aPath = xmlPath.c_str();
#endif
fileOK = (GetFileAttributes(aPath) != INVALID_FILE_ATTRIBUTES);
#if UNICODE
delete aPath;
#endif
#else
fileOK = (access(xmlPath.c_str(), F_OK) == 0);
#endif
@ -124,8 +138,19 @@ namespace
if ( xmlPath[ xmlPath.size()-1 ] != sep[0] )
xmlPath += sep;
xmlPath += "share" + sep + "salome" + sep + "resources" + sep + toLower(plugin) + sep + plugin + ".xml";
#ifdef WIN32
fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
#ifdef WIN32
#ifdef UNICODE
size_t length = strlen(xmlPath.c_str()) + sizeof(char);
wchar_t* aPath = new wchar_t[length+1];
memset(aPath, '\0', length);
mbstowcs(aPath, xmlPath.c_str(), length);
#else
const char* aPath = xmlPath.c_str();
#endif
fileOK = (GetFileAttributes(aPath) != INVALID_FILE_ATTRIBUTES);
#if UNICODE
delete aPath;
#endif
#else
fileOK = (access(xmlPath.c_str(), F_OK) == 0);
#endif

View File

@ -2531,8 +2531,22 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
// check, if corresponding operations are already created
if (myOpCreatorMap.find(theLibName) == myOpCreatorMap.end()) {
#if WIN32
#if UNICODE
//RNV: this is workaround for providing compilation,
// path should be processed as unicode string.
size_t length = strlen(aPlatformLibName.c_str()) + sizeof(char);
wchar_t* aPath = new wchar_t[length + 1];
memset(aPath, '\0', length);
mbstowcs(aPath, aPlatformLibName.c_str(), length);
#else
const char* aPath = aPlatformLibName.c_str();
#endif
// load plugin library
LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
LibHandle libHandle = LoadLib(aPath);
#else
LibHandle libHandle = LoadLib(aPlatformLibName.c_str());
#endif
if (!libHandle) {
// report any error, if occurred
#ifndef WIN32

View File

@ -74,7 +74,12 @@ SET(_swig_SCRIPTS
# --- rules ---
SWIG_ADD_MODULE(libGEOM_Swig python libGEOM_Swig.i libGEOM_Swig.cxx)
IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
SWIG_ADD_MODULE(libGEOM_Swig python libGEOM_Swig.i libGEOM_Swig.cxx)
ELSE()
SWIG_ADD_LIBRARY(libGEOM_Swig LANGUAGE python SOURCES libGEOM_Swig.i libGEOM_Swig.cxx)
ENDIF()
SWIG_LINK_LIBRARIES(libGEOM_Swig "${_link_LIBRARIES}")
SWIG_CHECK_GENERATION(libGEOM_Swig)
IF(WIN32)

View File

@ -53,11 +53,16 @@ SET(_swig_SCRIPTS
# swig flags
SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES SWIG_FLAGS "-py3")
#SET_SOURCE_FILES_PROPERTIES(xao_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
SET_SOURCE_FILES_PROPERTIES(xao_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
# --- rules ---
IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
SWIG_ADD_MODULE(xao python xao.i)
ELSE()
SWIG_ADD_LIBRARY(xao LANGUAGE python SOURCES xao.i)
ENDIF()
SWIG_ADD_MODULE(xao python xao.i)
SWIG_LINK_LIBRARIES(xao "${_link_LIBRARIES}")
SWIG_CHECK_GENERATION(xao)
IF(WIN32)