From c0161e9e57321f283fc88812779d627fb722a40a Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Fri, 10 Mar 2006 14:53:42 -0500 Subject: BUG: Trying to get testDynamicLoader to work on Solaris and SunOS, where current directory is not lookup when doing dlopen --- Source/kwsys/CMakeLists.txt | 1 + Source/kwsys/testDynamicLoader.cxx | 2 +- Source/kwsys/testSystemTools.h.in | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 6771d26..faae76f 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -516,6 +516,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) # If kwsys contains the DynamicLoader, need extra library IF(KWSYS_USE_DynamicLoader) ADD_LIBRARY(testDynload MODULE testDynload.c) + GET_TARGET_PROPERTY(TEST_DYNLOAD_LOCATION testDynload LOCATION) IF(UNIX) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS}) ENDIF(UNIX) diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx index 9a2e307..1d2841a 100644 --- a/Source/kwsys/testDynamicLoader.cxx +++ b/Source/kwsys/testDynamicLoader.cxx @@ -86,7 +86,7 @@ int main(int , char *[]) res += TestDynamicLoader("libdl.so", "TestDynamicLoader",1,0,1); #endif // Now try on the generated library - kwsys_stl::string libname = GetLibName("testDynload"); + kwsys_stl::string libname = TEST_DYNLOAD_LOCATION; //GetLibName("testDynload"); res += TestDynamicLoader(libname.c_str(), "dummy",1,0,1); res += TestDynamicLoader(libname.c_str(), "TestDynamicLoaderFunction",1,1,1); res += TestDynamicLoader(libname.c_str(), "_TestDynamicLoaderFunction",1,0,1); diff --git a/Source/kwsys/testSystemTools.h.in b/Source/kwsys/testSystemTools.h.in index 5fefd10..cdccfbb 100644 --- a/Source/kwsys/testSystemTools.h.in +++ b/Source/kwsys/testSystemTools.h.in @@ -14,6 +14,8 @@ #ifndef @KWSYS_NAMESPACE@_testSystemtools_h #define @KWSYS_NAMESPACE@_testSystemtools_h +#define TEST_DYNLOAD_LOCATION "@TEST_DYNLOAD_LOCATION@" + #define TEST_SYSTEMTOOLS_BIN_FILE "@TEST_SYSTEMTOOLS_BIN_FILE@" #define TEST_SYSTEMTOOLS_SRC_FILE "@TEST_SYSTEMTOOLS_SRC_FILE@" -- cgit v0.12