#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{
-// 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
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
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
// check, if corresponding operations are already created
if (myOpCreatorMap.find(theLibName) == myOpCreatorMap.end()) {
+#ifdef 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 = xmlPath.c_str();
+#endif
// load plugin library
- LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
+#if WIN32
+ LibHandle libHandle = LoadLib(aPath);
+#else
+ LibHandle libHandle = LoadLib(aPlatformLibName.c_str());
+#endif
if (!libHandle) {
// report any error, if occurred
#ifndef WIN32
# --- 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)
# 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)