MantisBT - CMake
View Issue Details
0010920CMakeCMakepublic2010-06-30 19:042016-06-10 14:31
David Cole 
Bill Hoffman 
normalminorhave not tried
closedmoved 
CMake-2-8 
 
0010920: CMake allows name collisions between targets
Currently, cmake does not complain when the same target name is declared using both INCLUDE_EXTERNAL_MSPROJECT and ADD_LIBRARY. The behavior (when both are used with the same name) appears to be unreliable between versions, and to depend on the order in which the two commands appear.

CMake should report an error whenever the same target name is used for different targets. Currently, it does this for LIBRARY and EXECUTABLE target types; but for some UTILITY target types (such as the above mentioned INCLUDE_EXTERNAL_MSPROJECT), it does not report any error or warning.

The following CMakeLists.txt reproduces the problem. (To test it, create empty foo.c and bar.c files). It should generate an error message, because the Foo target name is reused.


 ADD_LIBRARY (Foo STATIC foo.c)
 ADD_EXECUTABLE (Bar bar.c)
 TARGET_LINK_LIBRARIES(Bar Foo)
 INCLUDE_EXTERNAL_MSPROJECT(Foo ${CMAKE_BINARY_DIR}/Foo/Foo.vcproj)

======================================================================
Additional information: Tested on cmake 2.6 and 2.8, both on Windows.
======================================================================

As reported by Ed Loper on the CMake mailing list:
http://www.cmake.org/pipermail/cmake/2010-June/037434.html [^]

Appears to be related to issue 0008123
No tags attached.
related to 0008123closed Bill Hoffman Addressing an external MS project as target 
related to 0009743closed Alex Neundorf Incorrect documentation of include_external_msproject() 
Issue History
2010-06-30 19:04David ColeNew Issue
2010-06-30 19:04David ColeRelationship addedrelated to 0008123
2010-12-15 10:14David ColeAssigned To => Bill Hoffman
2010-12-15 10:14David ColeStatusnew => assigned
2010-12-15 10:14David ColeRelationship addedrelated to 0009743
2016-06-10 14:28Kitware RobotNote Added: 0041720
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0041720)
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.