X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=d4d65b56c95b9b4a6cec955dfd5b10c018a6bb7d;hp=845e0d9f081da9ac32d720fdcb1db1a0dd68ec66;hb=21af9b3a2c317f5693f228cd8ed55c2bb44b0a07;hpb=41b3e4433388f439856c3b0bb3725e9c81179c24 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 845e0d9f0..d4d65b56c 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -54,6 +54,7 @@ #include #else #include + #include // for basename function #endif #ifdef WIN32 @@ -382,8 +383,10 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp !strcmp( theLibName+libNameLen-3, ".so" )) { //the old format -#ifdef WIN32 +#if defined(WIN32) aPlatformLibName = std::string( theLibName+3, libNameLen-6 ) + ".dll"; +#elif defined(__APPLE__) + aPlatformLibName = std::string( theLibName, libNameLen-3 ) + ".dylib"; #else aPlatformLibName = theLibName; #endif @@ -391,11 +394,13 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp else { //try to use new format -#ifdef WIN32 +#if defined(WIN32) aPlatformLibName = theLibName; aPlatformLibName += ".dll"; +#elif defined(__APPLE__) + aPlatformLibName = std::string( "lib" ) + std::string( theLibName ) + ".dylib"; #else - aPlatformLibName = "lib" + std::string( theLibName ) + ".so"; + aPlatformLibName = std::string( "lib" ) + std::string( theLibName ) + ".so"; #endif } } @@ -1169,7 +1174,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa _splitpath( theFileNameForPython, NULL, NULL, bname, NULL ); string aFileName = bname; #else - string aFileName = basename( theFileNameForPython ); + string aFileName = basename( const_cast(theFileNameForPython) ); #endif // Retrieve mesh names from the file DriverMED_R_SMESHDS_Mesh myReader; @@ -1318,7 +1323,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromSTL( const char* theFileName _splitpath( theFileName, NULL, NULL, bname, NULL ); string aFileName = bname; #else - string aFileName = basename( theFileName ); + string aFileName = basename( const_cast(theFileName) ); #endif // publish mesh in the study if ( CanPublishInStudy( aMesh ) ) { @@ -1447,7 +1452,7 @@ SMESH_Gen_i::CreateMeshesFromGMF( const char* theFileName, _splitpath( theFileName, NULL, NULL, bname, NULL ); string aFileName = bname; #else - string aFileName = basename( theFileName ); + string aFileName = basename( const_cast(theFileName) ); #endif // publish mesh in the study if ( CanPublishInStudy( aMesh ) ) {