From 6f699e5b1477ee3d9f2eca957d0e824f8fce13e9 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Tue, 4 Jun 2024 16:42:57 +0200 Subject: [PATCH] Use CMake variables to define module name and version --- src/SofaViscoElastic/config.h.in | 5 +++-- src/SofaViscoElastic/init.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/SofaViscoElastic/config.h.in b/src/SofaViscoElastic/config.h.in index 72eda98..5d08245 100644 --- a/src/SofaViscoElastic/config.h.in +++ b/src/SofaViscoElastic/config.h.in @@ -45,5 +45,6 @@ namespace sofa::SofaViscoElastic { - -} // namespace sofa::component::solidmechanics::fem::viscoelastic + constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; + constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; +} // namespace sofa::SofaViscoElastic diff --git a/src/SofaViscoElastic/init.cpp b/src/SofaViscoElastic/init.cpp index 398199b..0f95d04 100644 --- a/src/SofaViscoElastic/init.cpp +++ b/src/SofaViscoElastic/init.cpp @@ -55,12 +55,12 @@ void initExternalModule() const char* getModuleName() { - return "SofaViscoElastic"; + return MODULE_NAME; } const char* getModuleVersion() { - return "1.0"; + return MODULE_VERSION; } void init() @@ -78,4 +78,4 @@ const char* getModuleComponentList() static std::string classes = core::ObjectFactory::getInstance()->listClassesFromTarget(sofa_tostring(SOFA_TARGET)); return classes.c_str(); } -} // namespace sofa::component::solidmechanics::fem::viscoelastic +} // namespace sofa::SofaViscoElastic