View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014662CMakeCMakepublic2013-12-20 11:202016-06-10 14:31
Reportertisi 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.12 
Target VersionFixed in Version 
Summary0014662: Problems with TARGET_BASE
DescriptionIf I use the Ninja Generator and the <TARGET_BASE> specifier within the CMAKE_C_LINK_EXECUTABLE in the Platform file for a compiler, then it does not drop the extension (e.g. it expands to "target.elf" instead of "target").

However, if i use the Makefile generator, then it works (the extension is dropped).
Tagsninja
Attached Files

 Relationships

  Notes
(0034841)
Brad King (manager)
2013-12-20 11:54

The TARGET_BASE evaluation is here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalGenerator.cxx;hb=v2.8.12.1#l949 [^]

and expects replaceValues.Target to contain the actual file path. However, the Ninja generator uses a placeholder that ninja later evaluates:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmNinjaNormalTargetGenerator.cxx;hb=v2.8.12.1#l198 [^]

The implementation of TARGET_BASE will have to be refactored to use a separate replaceValues member (or something like that).
(0034842)
Brad King (manager)
2013-12-20 11:55

It looks like TARGET_BASE is no longer used by any CMake-provided platform modules. Its implementation could be dropped if it were not for compatibility with third-party code that assumes it exists.

@tisi: What is the need for <TARGET_BASE> in your case?
(0034855)
tisi (reporter)
2013-12-23 02:13

I use the TARGET_BASE within the CMAKE_C_LINK_EXECUTABLE (for an embedded system project):

SET(CMAKE_C_LINK_EXECUTABLE
       "dld <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -@O=<TARGET_BASE>.map <OBJECTS> <LINK_LIBRARIES> -o <TARGET>"
       "ddump -Rv -o <TARGET_BASE>.s19 <TARGET>" )

I added the support for the windriver compiler to CMake (locally, it's not in your repository) and i use two commands for linking. There are two uses for the TARGET_BASE. The first line is the linker command and outputs additionally to the binary a map file. It would be nice to name it "target.map" instead of "target.elf.map". In the second line it is used again to generate an s19 hex-file, which is used to programm an embedded microcontroller. The s19 file is always needed for each executable, and so i decided to add the command here (instead of add_custom_command for each target). Again, it would be nicer if the name could be "target.s19" instead of "target.elf.s19".

This was working fine for a few years now with the "make" generator (we didn't use any other generator yet). Right now we plan to switch to ninja and found that it is not working in the expected way.
(0042452)
Kitware Robot (administrator)
2016-06-10 14:29

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
2013-12-20 11:20 tisi New Issue
2013-12-20 11:22 tisi Tag Attached: ninja
2013-12-20 11:50 Brad King Assigned To => Peter Kuemmel
2013-12-20 11:50 Brad King Status new => assigned
2013-12-20 11:54 Brad King Note Added: 0034841
2013-12-20 11:55 Brad King Note Added: 0034842
2013-12-23 02:13 tisi Note Added: 0034855
2014-04-13 05:43 Peter Kuemmel Assigned To Peter Kuemmel =>
2014-04-13 05:46 Peter Kuemmel Status assigned => confirmed
2016-06-10 14:29 Kitware Robot Note Added: 0042452
2016-06-10 14:29 Kitware Robot Status confirmed => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team