View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010538CMakeCMakepublic2010-04-12 13:012013-11-04 09:33
ReporterJonan 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0010538: 'make clean' removes content in symbolic links
DescriptionI have a folder with some files that are needed for my program to run, so I create a symbolic link in the build directory to that folder.

This works fine, but if a run 'make clean' the content inside that folder is erased, that means the original content in the source directory is gone too.
TagsNo tags attached.
Attached Files

 Relationships
has duplicate 0013911closedBrad King cmake uses REMOVE_RECURSE instead of REMOVE for symlinks 

  Notes
(0024806)
David Cole (manager)
2011-01-17 15:47

Cannot reproduce this here. Can you give more details or exact steps to follow to reproduce this problem here?
(0026350)
David Cole (manager)
2011-05-02 14:46

Closing resolved issues that have not been updated in more than 3 months.
(0028004)
Jonan (reporter)
2011-12-18 11:12

This bug is still reproducible in 2.8.5.

In my project I have something like this:

add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/media
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/media ${PROJECT_BINARY_DIR}/media
)

This way I don't have to copy the media files to every build directory.
When I run 'make clean' I expect the symbolic link to be deleted, but instead I find that the link is still there but all the files in the original folder are deleted.
(0029596)
Brad King (manager)
2012-06-01 16:43

Try this patch:

diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d69431e..117c26e 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2405,7 +2405,8 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
       
fileName += "/" + *i;
       }
 
-    if(cmSystemTools::FileIsDirectory(fileName.c_str()) && recurse)
+    if(cmSystemTools::FileIsDirectory(fileName.c_str()) &&
+       !cmSystemTools::FileIsSymlink(fileName.c_str()) && recurse)
       {
       cmSystemTools::RemoveADirectory(fileName.c_str());
       }


It probably should have been done along with this change a long time ago:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eee2d2b0 [^]
(0032254)
Brad King (manager)
2013-02-13 10:04

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1233672 [^]
(0034370)
Robert Maynard (manager)
2013-11-04 09:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2010-04-12 13:01 Jonan New Issue
2011-01-17 15:46 David Cole Assigned To => David Cole
2011-01-17 15:46 David Cole Status new => assigned
2011-01-17 15:47 David Cole Note Added: 0024806
2011-01-17 15:47 David Cole Status assigned => resolved
2011-01-17 15:47 David Cole Fixed in Version => CMake 2.8.4
2011-01-17 15:47 David Cole Resolution open => unable to reproduce
2011-05-02 14:46 David Cole Note Added: 0026350
2011-05-02 14:46 David Cole Status resolved => closed
2011-12-18 11:12 Jonan Note Added: 0028004
2011-12-18 11:12 Jonan Status closed => feedback
2011-12-18 11:12 Jonan Resolution unable to reproduce => reopened
2012-06-01 16:32 David Cole Assigned To David Cole =>
2012-06-01 16:43 Brad King Note Added: 0029596
2013-02-13 10:03 Brad King Relationship added has duplicate 0013911
2013-02-13 10:04 Brad King Note Added: 0032254
2013-02-13 10:04 Brad King Assigned To => Brad King
2013-02-13 10:04 Brad King Status feedback => resolved
2013-02-13 10:04 Brad King Resolution reopened => fixed
2013-02-13 10:04 Brad King Fixed in Version CMake 2.8.4 => CMake 2.8.11
2013-02-13 10:04 Brad King Target Version => CMake 2.8.11
2013-11-04 09:33 Robert Maynard Note Added: 0034370
2013-11-04 09:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team