The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=14713 ====================================================================== Reported By: Alex Assigned To: ====================================================================== Project: CMake Issue ID: 14713 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2014-01-20 17:06 CET Last Modified: 2014-01-20 17:06 CET ====================================================================== Summary: cmake -create-symlink doesn't overwrite existing dangling(!) symlinks Description: Calling create_symlink for an existing target file doesn't replace the link.
Assuming there are no files "Target1" nor "Target2" in the current directory cmake -E create_symlink Target1 Link cmake -E create_symlink Target2 Link should leave a link Link -> Target2 but the result is Link -> Target1 If 'Target1' exists, before calling the second "create_symlink", the behaviour is correct and results in 'Link -> Target2' And yes, I have a use case, where I want to have a dangling symlink ;-) Steps to Reproduce: See description. Additional Information: See in cmake.cxx, where the case 'args[1] == "create_symlink"' is handled. Looks correct on the first sight, but: most likely 'cmSystemTools::FileExists(destinationFileName)' doesn't return true for a dangling symlink 'destinationFileName', and therefore after the first 'if' statement the following code leading to '!cmSystemTools::RemoveFile(destinationFileName)' isn't executed. Solution: distinguish correctly for symlinks, whether link or targed doesn't exist. Or: remove the file 'destinationFileName' unconditionally. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-01-20 17:06 Alex New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
