MantisBT - CMake
View Issue Details
0010752CMakeCMakepublic2010-05-24 16:482016-06-10 14:31
Daniel Levin 
Brad King 
normalminoralways
closedmoved 
CMake-2-8 
 
0010752: Detect and warn about conflicting output paths
Passing CMAKE_BINARY_DIR as RUNTIME_OUTPUT_DIRECTORY for the subtarget results in invalid link.txt file for this subtarget with output path as "." (dot):

...
# in root directory:
add_subdirectory( "b" )

...
# in subdirectory:
add_executable( b main.cpp )
set_target_properties( b PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )

...
$ cat b/CMakeFiles/b.dir/link.txt
/usr/bin/c++ CMakeFiles/b.dir/main.o -o . -rdynamic
No tags attached.
zip a.zip (838) 2010-05-24 16:48
https://public.kitware.com/Bug/file/3134/a.zip
Issue History
2010-05-24 16:48Daniel LevinNew Issue
2010-05-24 16:48Daniel LevinFile Added: a.zip
2010-05-24 17:40Bill HoffmanStatusnew => assigned
2010-05-24 17:40Bill HoffmanAssigned To => Brad King
2010-05-27 09:58Brad KingNote Added: 0020839
2010-05-27 17:20Daniel LevinNote Added: 0020847
2010-05-28 08:33Brad KingNote Added: 0020854
2010-05-28 08:33Brad KingSummaryInvalid output path to binary in link.txt => Detect and warn about conflicting output paths
2010-08-31 15:31David ColeNote Added: 0022029
2012-08-13 10:37Brad KingStatusassigned => backlog
2012-08-13 10:37Brad KingNote Added: 0030527
2016-06-10 14:28Kitware RobotNote Added: 0041704
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0020839)
Brad King   
2010-05-27 09:58   
You're asking CMake to create an executable file in ${CMAKE_BINARY_DIR} with the same name ("b") as a directory (also "b"). This cannot possibly be represented on disk with traditional filesystems. If I change the name of the executable to "b2" then it works.
(0020847)
Daniel Levin   
2010-05-27 17:20   
That is true. Maybe CMake should handle such kind of mistakes and inform user with readable message? The error at build time is far from obvious.
(0020854)
Brad King   
2010-05-28 08:33   
I'm updating the summary of this bug to reflect the real change needed.

We need to record the set of output paths known to be generated in the build tree along with the context that causes each to be added. When more than one context adds the same output path then we can warn (or error?).
(0022029)
David Cole   
2010-08-31 15:31   
We will not be addressing this for the upcoming CMake 2.8.3 release.
(0030527)
Brad King   
2012-08-13 10:37   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041704)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.