Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » name of the generated file
name of the generated file [message #1749314] Mon, 05 December 2016 11:41 Go to next message
Adam xad is currently offline Adam xadFriend
Messages: 1
Registered: December 2016
Junior Member
hello. I want to generate the name of output file that depends of #define statement from code . Is it possible ?

To explain what I want:
I have in code:
#define CODE_VERSION 100

after linking I want to have output file like this:

with regards,
Re: name of the generated file [message #1749329 is a reply to message #1749314] Mon, 05 December 2016 15:15 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 404
Registered: June 2014
Senior Member
AFAIK this isn't going to be possible with any of the tools I know of out of the box (CDT or otherwise).

Since you presumably want to do this in your daily builds as well as within CDT you could do something like this to get the version out of the file:

gcc -E -dM version.h | grep CODE_VERSION | cut -f3 -d' '

I expect you may have rejected this option already, but I would recommend considering whether your version can be defined at the command line, so that you do a -DCODE_VERSION=100 to GCC and then that 100 (presumably in a makefile variable or similar) can then be used for the rule.
Previous Topic:Extending CDT configurations/tools
Next Topic:Launch failed, binary not found
Goto Forum:

Current Time: Wed Jan 19 11:54:41 GMT 2022

Powered by FUDForum. Page generated in 0.02031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top