From a05242fe69542b85ec3bc403143da9ab44a74442 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Wed, 19 Apr 2023 14:40:13 +0200 Subject: [PATCH] Improve new MG license mechanism to be binary compatible 2.14/2.15 --- src/GHS3DPRLPlugin/CMakeLists.txt | 2 +- src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/GHS3DPRLPlugin/CMakeLists.txt b/src/GHS3DPRLPlugin/CMakeLists.txt index 31c42ba..b9bf88a 100644 --- a/src/GHS3DPRLPlugin/CMakeLists.txt +++ b/src/GHS3DPRLPlugin/CMakeLists.txt @@ -47,7 +47,7 @@ SET(_link_LIBRARIES TKGeomBase TKGeomAlgo TKCDF - ${MESHGEMS_TETRA_HPC_LIBRARY} + ${MESHGEMS_CVM_LIBRARY} ${SMESH_SMESHimpl} ${SMESH_SMESHEngine} ${SMESH_SMESHDS} diff --git a/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx b/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx index cb348a5..beb5b95 100644 --- a/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx +++ b/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx @@ -589,24 +589,13 @@ bool MG_TetraHPC_API::LibData::Compute( const std::string& outFile ) // MG license std::string errorTxt; status_t ret; -#if MESHGEMS_VERSION_HEX > MESHGEMS_215 - // need to unlock Tetra license only once - std::string SPATIAL_LICENSE = SMESHUtils_MGLicenseKeyGen::GetKey(errorTxt); - ret = meshgems_tetra_hpc_unlock_product(SPATIAL_LICENSE.c_str()); - if STATUS_IS_ERROR( ret ) - { - AddError( SMESH_Comment( "Problem with SPATIAL_LICENSE to unlock Tetra_HPC: ") << errorTxt ); - return false; - } - else - MESSAGE("SPATIAL_LICENSE unlock Tetra_HPC: " << ret); -#else - if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( _tria_mesh, errorTxt )) + + // use cvm for tetra_hpc + if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( _tria_mesh, "cvm", errorTxt )) { AddError( SMESH_Comment( "Problem with library SalomeMeshGemsKeyGenerator: ") << errorTxt ); return false; } -#endif // Set surface mesh ret = tetra_hpc_set_input_mesh( _session, _tria_mesh ); -- 2.39.2