View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010920CMakeCMakepublic2010-06-30 19:042016-06-10 14:31
ReporterDavid Cole 
Assigned ToBill Hoffman 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0010920: CMake allows name collisions between targets
DescriptionCurrently, 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
TagsNo tags attached.
Attached Files

 Relationships
related to 0008123closedBill Hoffman Addressing an external MS project as target 
related to 0009743closedAlex Neundorf Incorrect documentation of include_external_msproject() 

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

 Issue History
Date Modified Username Field Change
2010-06-30 19:04 David Cole New Issue
2010-06-30 19:04 David Cole Relationship added related to 0008123
2010-12-15 10:14 David Cole Assigned To => Bill Hoffman
2010-12-15 10:14 David Cole Status new => assigned
2010-12-15 10:14 David Cole Relationship added related to 0009743
2016-06-10 14:28 Kitware Robot Note Added: 0041720
2016-06-10 14:28 Kitware Robot Status assigned => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team