[CMake] Target names now pollute namespace of filenames (was
CMake 2.4.4 available for download)
Bill Hoffman
bill.hoffman at kitware.com
Sat Nov 25 11:02:41 EST 2006
Alan W. Irwin wrote:
> On 2006-11-23 07:13-0800 Alan W. Irwin wrote:
>
>> Upon further reflection, I think this is a newly introduced bug in
>> CMake-2.4.4 that urgently needs to be fixed. Essentially what is
>> going on
>> is that the namespace of filenames which are mentioned in DEPENDS
>> subcommands has been contaminated by the target namespace in 2.4.4.
>> This is
>> especially bad since targets affect the whole build tree. Thus, all
>> build
>> systems (KDE?) with coincidences between any target name and any
>> filename
>> DEPENDS will be adversely affected by this bug.
>>
>> I hope to create a simple example and bug report soon.
>
> Done, see bug 4072 including the promised simple example of this bug.
>
> For all those trying cmake-2.4.4, if custom commands that executed
> fine for
> 2.4.3 fail to execute for 2.4.4 it may well be this bug. The only
> workaround for 2.4.4 that I have found is to check for any coincidences
> between DEPENDS filenames and target names (library, executable or
> custom)
> and change the target name or file name to break the coincidence.
> Note, if
> you want to keep the names of the generated executables, libraries, and
> files identical in all respects, you can change a target name for say an
> executable or library and change the associated name of the executable or
> library back to the old name using the OUTPUT_NAME subcommand of the
> SET_TARGET_PROPERTIES command. However, for big projects that workaround
> could be a lot of trouble, and in general it is not good to have such
> namespace pollution from targets to filenames so I hope this bug gets
> fixed
> in a quick bugfix release instead.
>
I have checked in a fix to cvs:
$ cvs commit -m "BUG: fix problem when a target name is the same as the
output
of a custom command" cmLocalGenerator.cxx cmTarget.cxx
Checking for path: /cvsroot/CMake/CMake/Source
Unrestricted user: hoffman
/cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v <--
cmLocalGenerator.cxx
new revision: 1.164; previous revision: 1.163
/cvsroot/CMake/CMake/Source/cmTarget.cxx,v <-- cmTarget.cxx
new revision: 1.108; previous revision: 1.107
Basically, support was added so that you could use a target name as a
DEPEND, but it was a bit
loose on finding the targets.
-Bill
More information about the CMake
mailing list