Skip to content
Snippets Groups Projects
Commit 4850d577 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge branch 'v2.4' into v2.5

parents 0f088003 b354ef88
No related branches found
No related tags found
No related merge requests found
...@@ -265,6 +265,7 @@ For users: ...@@ -265,6 +265,7 @@ For users:
For developers: For developers:
- Small fix in LDFLAGS when enabling coverage. - Small fix in LDFLAGS when enabling coverage.
- Fixed order of flags in tests for static linking done by configure (see \issue{407}). - Fixed order of flags in tests for static linking done by configure (see \issue{407}).
- Fixed the way paths are hardcoded so as to facilitate conda packaging (see \issue{416}).
*/ */
...@@ -28,8 +28,16 @@ ...@@ -28,8 +28,16 @@
namespace PLMD { namespace PLMD {
namespace config { namespace config {
// This is a fix to allow conda to correctly replace paths in binary files.
// These functions should not be static or they will be optimized away!
const char* plumed_root(){return "@PLUMED_ROOT@";}
const char* plumed_soext(){return "@SOEXT@";}
const char* plumed_htmldir(){return "@htmldir@";}
const char* plumed_includedir(){return "@includedir@";}
const char* plumed_program_name(){return "@program_name@";}
std::string getSoExt() { std::string getSoExt() {
return "@SOEXT@"; return plumed_soext();
} }
bool isInstalled() { bool isInstalled() {
...@@ -40,7 +48,7 @@ std::string getPlumedRoot() { ...@@ -40,7 +48,7 @@ std::string getPlumedRoot() {
char *env = std::getenv("PLUMED_ROOT"); char *env = std::getenv("PLUMED_ROOT");
std::string ss; std::string ss;
if( env == NULL) { if( env == NULL) {
ss="@PLUMED_ROOT@"; ss=plumed_root();
} else { } else {
ss=std::string( env ); ss=std::string( env );
} }
...@@ -52,7 +60,7 @@ std::string getPlumedHtmldir() { ...@@ -52,7 +60,7 @@ std::string getPlumedHtmldir() {
char *env = std::getenv("PLUMED_HTMLDIR"); char *env = std::getenv("PLUMED_HTMLDIR");
std::string ss; std::string ss;
if( env == NULL) { if( env == NULL) {
ss="@htmldir@"; ss=plumed_htmldir();
} else { } else {
ss=std::string( env ); ss=std::string( env );
} }
...@@ -64,7 +72,7 @@ std::string getPlumedIncludedir() { ...@@ -64,7 +72,7 @@ std::string getPlumedIncludedir() {
char *env = std::getenv("PLUMED_INCLUDEDIR"); char *env = std::getenv("PLUMED_INCLUDEDIR");
std::string ss; std::string ss;
if( env == NULL) { if( env == NULL) {
ss="@includedir@"; ss=plumed_includedir();
} else { } else {
ss=std::string( env ); ss=std::string( env );
} }
...@@ -76,7 +84,7 @@ std::string getPlumedProgramName() { ...@@ -76,7 +84,7 @@ std::string getPlumedProgramName() {
char *env = std::getenv("PLUMED_PROGRAM_NAME"); char *env = std::getenv("PLUMED_PROGRAM_NAME");
std::string ss; std::string ss;
if( env == NULL) { if( env == NULL) {
ss="@program_name@"; ss=plumed_program_name();
} else { } else {
ss=std::string( env ); ss=std::string( env );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment