summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-02-11 13:28:59 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-02-11 13:28:59 (GMT)
commitff6bc566163ef85f4540240e933b47c47df481e1 (patch)
treeef18e1ae1f3f393d58fe7a56ef7d6bc79a7ba4ae
parenteaf25c6739a3d5c82d4e4e2059ed12a745560ec0 (diff)
downloadCMake-ff6bc566163ef85f4540240e933b47c47df481e1.zip
CMake-ff6bc566163ef85f4540240e933b47c47df481e1.tar.gz
CMake-ff6bc566163ef85f4540240e933b47c47df481e1.tar.bz2
ENH: On Cygwin shared libraries have only .dll file no .lib file, so when finding library on cygwin, search also for .dll. Also fix SimpleInstall test on cygwin
-rw-r--r--Source/kwsys/SystemTools.cxx8
-rw-r--r--Tests/SimpleInstall/CMakeLists.txt16
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt16
3 files changed, 32 insertions, 8 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 825e27e..59b2dff 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1241,6 +1241,14 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
+ tryPath = *p;
+ tryPath += "/lib";
+ tryPath += name;
+ tryPath += ".dll";
+ if(SystemTools::FileExists(tryPath.c_str()))
+ {
+ return SystemTools::CollapseFullPath(tryPath.c_str());
+ }
#endif
}
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index 5582e44..e601af4 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -27,13 +27,21 @@ ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio")
MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
IF(STAGE2)
+ SET(LIBPATHS "${CMAKE_INSTALL_PREFIX}/lib")
+ SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX})
+ SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
+
+ IF(WIN32 AND UNIX)
+ SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/bin")
+ ENDIF(WIN32 AND UNIX)
+ MESSAGE("Search for library in: ${LIBPATHS}")
FIND_LIBRARY(TEST1_LIBRARY
- NAMES test1 test1${CMAKE_DEBUG_POSTFIX}
- PATHS "${CMAKE_INSTALL_PREFIX}/lib"
+ NAMES ${t1NAMES}
+ PATHS ${LIBPATHS}
DOC "First library")
FIND_LIBRARY(TEST2_LIBRARY
- NAMES test2 test2${CMAKE_DEBUG_POSTFIX}
- PATHS "${CMAKE_INSTALL_PREFIX}/lib"
+ NAMES ${t2NAMES}
+ PATHS ${LIBPATHS}
DOC "First library")
ADD_EXECUTABLE (SimpleInstallS2 inst.cxx foo.c foo.h)
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index 5582e44..e601af4 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -27,13 +27,21 @@ ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio")
MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
IF(STAGE2)
+ SET(LIBPATHS "${CMAKE_INSTALL_PREFIX}/lib")
+ SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX})
+ SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
+
+ IF(WIN32 AND UNIX)
+ SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/bin")
+ ENDIF(WIN32 AND UNIX)
+ MESSAGE("Search for library in: ${LIBPATHS}")
FIND_LIBRARY(TEST1_LIBRARY
- NAMES test1 test1${CMAKE_DEBUG_POSTFIX}
- PATHS "${CMAKE_INSTALL_PREFIX}/lib"
+ NAMES ${t1NAMES}
+ PATHS ${LIBPATHS}
DOC "First library")
FIND_LIBRARY(TEST2_LIBRARY
- NAMES test2 test2${CMAKE_DEBUG_POSTFIX}
- PATHS "${CMAKE_INSTALL_PREFIX}/lib"
+ NAMES ${t2NAMES}
+ PATHS ${LIBPATHS}
DOC "First library")
ADD_EXECUTABLE (SimpleInstallS2 inst.cxx foo.c foo.h)