summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-02-16 15:48:54 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-02-16 15:48:54 (GMT)
commitc60f2fabc413ba79271d55301a7633435e21a865 (patch)
tree25629b39d2691d42da3e140993caffb06612f98b /Source
parent07b4d8bbca2ad9d4826d9d37b1ef9b19b6489879 (diff)
downloadCMake-c60f2fabc413ba79271d55301a7633435e21a865.zip
CMake-c60f2fabc413ba79271d55301a7633435e21a865.tar.gz
CMake-c60f2fabc413ba79271d55301a7633435e21a865.tar.bz2
ENH: use cmake variables for cmDynamicLoader to figure out library prefix and extensions
Diffstat (limited to 'Source')
-rw-r--r--Source/cmConfigure.cmake.h.in5
-rw-r--r--Source/cmDynamicLoader.cxx59
2 files changed, 18 insertions, 46 deletions
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index adf8733..d8dab93 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -11,3 +11,8 @@
#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 9f91dd8..14568bf 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -137,15 +137,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
-const char* cmDynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-const char* cmDynamicLoader::LibExtension()
-{
- return ".sl";
-}
const char* cmDynamicLoader::LastError()
{
@@ -204,16 +195,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle /* lib */, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
-const char* cmDynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-const char* cmDynamicLoader::LibExtension()
-{
- return ".so";
-}
-
const char* cmDynamicLoader::LastError()
{
return 0;
@@ -272,19 +253,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
-const char* cmDynamicLoader::LibPrefix()
-{
-#if defined( __MINGW32__ )
- return "lib";
-#else
- return "";
-#endif
-}
-
-const char* cmDynamicLoader::LibExtension()
-{
- return ".dll";
-}
const char* cmDynamicLoader::LastError()
{
@@ -346,20 +314,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
-const char* cmDynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-const char* cmDynamicLoader::LibExtension()
-{
-#ifdef __CYGWIN__
- return ".dll";
-#else
- return ".so";
-#endif
-}
-
const char* cmDynamicLoader::LastError()
{
return dlerror();
@@ -370,3 +324,16 @@ 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_LIBRARY_SUFFIX;
+}
+