View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002306CMakeCMakepublic2005-09-28 15:472005-10-10 14:12
ReporterAlex Neundorf 
Assigned ToKen Martin 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002306: new Makefile generator problem with ADD_CUSTOM_TARGET and multiple targets with the same name
DescriptionHi,

I have a macro which creates several custom targets, which depend on each other (e-g- target t1 depends on target t2). I call this macro in several subdirectories, so in each of the subdirs the targets t1 and t2 exist. When I execute "make t1" it executes t2 from probably the first directory it finds, but not the one which belongs to this t1.
This worked with the old makefile generator perfectly.
TagsNo tags attached.
Attached Filesgz file icon act-test.tar.gz [^] (390 bytes) 1969-12-31 19:00
log file icon make.log [^] (397 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0003062)
Alex Neundorf (developer)
2005-09-28 15:54

In the attached testcase the three targets "echodir", "echohello" and "echoworld" are created both in the a/ and in the b/ subdirs. When entering "make echoworld" in b/, it doesn't "build" echohello and echodir in b/, but in a/, which isn't what I expected and how cmake < 2.2 worked.
(0003117)
Ken Martin (developer)
2005-10-10 14:12

I have checked in a fix for this problem into CVS. But.... my fix is mainly there for backwards compatibility. Having multiple targets with the same name will not work (and hasn't worked) under visual studio or XCode. Another solution is to include in the macro something to make the targets unique. Sush as FOO_<DIRNAME> where DIRNAME is the name of the current directory or some other unique identifier. Thanks for the great example, it made tracking this down much easier.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team