diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-30 10:12:56 -0500 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-30 10:12:56 -0500 |
commit | 3dca9a681f247c3b5b51ef43833e3ed9529a3943 (patch) | |
tree | fb5b1544eac9db38eecb9c680aad6e135aa78194 | |
parent | 04280871698816e504320fea3e76a7add612ba31 (diff) | |
download | cmake-3dca9a681f247c3b5b51ef43833e3ed9529a3943.tar.gz |
ENH: put fix for foo.dll.lib problem on branch with test
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ChangeLog.manual | 4 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Source/cmOrderLinkDirectories.cxx | 10 | ||||
-rw-r--r-- | Tests/LibName/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/LibName/bar.c | 7 | ||||
-rw-r--r-- | Tests/LibName/foo.c | 11 | ||||
-rw-r--r-- | Tests/LibName/foobar.c | 10 |
8 files changed, 59 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ca4001c68e..48dbe6a80b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 4) SET(CMake_VERSION_PATCH 5) # for an actual release this should not be defined -SET(CMake_VERSION_RC 1) +SET(CMake_VERSION_RC 2) SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}") diff --git a/ChangeLog.manual b/ChangeLog.manual index be790cddfa..3f14dc589e 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,8 +1,10 @@ Changes in CMake 2.4.5 +* Fix problem with LIBRARY_OUTPUT_PATH and linking to a dll foo.dll.lib + instead of foo.lib * Do not depend on optimized libraries for a debug build and visa versa. -* Fix target name matching custom command output +* Fix target name matching custom command output conflict. * Fix FindQt3 so that it does not find qt4 diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 10c3237c3c..694ba9dd90 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -402,6 +402,17 @@ IF(BUILD_TESTING) --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) + ADD_TEST(LibName ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/LibName" + "${CMake_BINARY_DIR}/Tests/LibName" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project LibName + --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" + --test-command foobar + ) ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND} --build-and-test diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx index bd07f8ac41..2779f428d4 100644 --- a/Source/cmOrderLinkDirectories.cxx +++ b/Source/cmOrderLinkDirectories.cxx @@ -463,7 +463,11 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() #ifdef CM_ORDER_LINK_DIRECTORIES_DEBUG fprintf(stderr, "Raw link item [%s]\n", this->RawLinkItems[i].c_str()); #endif - if(cmSystemTools::FileIsFullPath(this->RawLinkItems[i].c_str())) + // check to see if the file is a full path or just contains + // a / in it and is a path to something + cmStdString& item = this->RawLinkItems[i]; + if(cmSystemTools::FileIsFullPath(item.c_str()) + || item.find("/") != item.npos) { if(cmSystemTools::FileIsDirectory(this->RawLinkItems[i].c_str())) { @@ -486,6 +490,8 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() } else { + // A full path to a directory was found as a link item + // warn user std::string message = "Warning: Ignoring path found in link libraries for target: "; message += this->TargetName; @@ -496,7 +502,7 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() cmSystemTools::Message(message.c_str()); continue; } - } + } // is it a directory if(!framework) { dir = cmSystemTools::GetFilenamePath(this->RawLinkItems[i]); diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt new file mode 100644 index 0000000000..e97b6b13e3 --- /dev/null +++ b/Tests/LibName/CMakeLists.txt @@ -0,0 +1,8 @@ +project(LibName) +set(LIBRARY_OUTPUT_PATH lib) +set(EXECUTABLE_OUTPUT_PATH lib) +add_library(bar SHARED bar.c) +add_library(foo SHARED foo.c) +target_link_libraries(foo bar) +add_executable(foobar foobar.c) +target_link_libraries(foobar foo) diff --git a/Tests/LibName/bar.c b/Tests/LibName/bar.c new file mode 100644 index 0000000000..9607180380 --- /dev/null +++ b/Tests/LibName/bar.c @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + +extern void foo() +{ +} diff --git a/Tests/LibName/foo.c b/Tests/LibName/foo.c new file mode 100644 index 0000000000..a68970405e --- /dev/null +++ b/Tests/LibName/foo.c @@ -0,0 +1,11 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif +extern void foo(); +#ifdef _WIN32 +__declspec(dllexport) +#endif + void bar() +{ + foo(); +} diff --git a/Tests/LibName/foobar.c b/Tests/LibName/foobar.c new file mode 100644 index 0000000000..73b4b41564 --- /dev/null +++ b/Tests/LibName/foobar.c @@ -0,0 +1,10 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif +extern void bar(); + +int main() +{ + bar(); + return 0; +} |