From 1d38a3e09e071e16c38d46a7bd67e1730bbee7ab Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 Mar 2006 17:09:08 -0500 Subject: [PATCH] BUG: Removed compiled-in CMAKE_SHARED_MODULE_PREFIX and CMAKE_SHARED_MODULE_SUFFIX for loaded commands in favor of using the settings from the platform files. --- Source/cmConfigure.cmake.h.in | 5 ----- Source/cmDynamicLoader.cxx | 13 ------------- Source/cmDynamicLoader.h | 8 -------- Source/cmLoadCommandCommand.cxx | 17 ++++++++++------- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index d8dab939a..adf87330a 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -11,8 +11,3 @@ #define CMake_VERSION_PATCH @CMake_VERSION_PATCH@ #define CMAKE_DATA_DIR "@CMAKE_DATA_DIR@" - -#define CMAKE_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@" -#define CMAKE_SHARED_MODULE_PREFIX "@CMAKE_SHARED_MODULE_PREFIX@" -#define CMAKE_SHARED_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@" -#define CMAKE_SHARED_MODULE_SUFFIX "@CMAKE_SHARED_MODULE_SUFFIX@" diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index d1b15103d..99174ffb2 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -115,16 +115,3 @@ void cmDynamicLoader::FlushCache() { cmDynamicLoaderCache::GetInstance()->FlushCache(); } - -// Stay consistent with the Modules/Platform directory as -// to what the correct prefix and lib extension -const char* cmDynamicLoader::LibPrefix() -{ - return CMAKE_SHARED_MODULE_PREFIX; -} - -const char* cmDynamicLoader::LibExtension() -{ - return CMAKE_SHARED_MODULE_SUFFIX; -} - diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index 29b6669a0..0b683efb0 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -36,14 +36,6 @@ public: // the symbols in the library. static cmsys::DynamicLoader::LibraryHandle OpenLibrary(const char*); - // Description: - // Return the library prefix for the given architecture - static const char* LibPrefix(); - - // Description: - // Return the library extension for the given architecture - static const char* LibExtension(); - // Description: // Flush the cache of dynamic loader. static void FlushCache(); diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 4ade0530a..e13449ca1 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -230,8 +230,11 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args) this->Makefile->RemoveDefinition(reportVar.c_str()); // the file must exist - std::string fullPath = cmDynamicLoader::LibPrefix(); - fullPath += "cm" + args[0] + cmDynamicLoader::LibExtension(); + std::string moduleName = + this->Makefile->GetRequiredDefinition("CMAKE_SHARED_MODULE_PREFIX"); + moduleName += "cm" + args[0]; + moduleName += + this->Makefile->GetRequiredDefinition("CMAKE_SHARED_MODULE_SUFFIX"); // search for the file std::vector path; @@ -246,13 +249,13 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args) } // Try to find the program. - fullPath = cmSystemTools::FindFile(fullPath.c_str(), path); + std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); if (fullPath == "") { - fullPath = "Attempt to load command failed from file : "; - fullPath += cmDynamicLoader::LibPrefix(); - fullPath += "cm" + args[0] + cmDynamicLoader::LibExtension(); - this->SetError(fullPath.c_str()); + cmOStringStream e; + e << "Attempt to load command failed from file \"" + << moduleName << "\""; + this->SetError(e.str().c_str()); return false; }