This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM: How to get project name for preprocessor

Hi all,

I'm wonder is possible to get project name for preprocessor commands as define (ie. #ifdef...)
like compilation date/time by using "__DATE__" & "__TIME__".

Greetings,
Lukasz.

Parents
  • That will work only by ...

    Why do people say stupid things such as that?

    An alternative to the only way might be to do the following:

    In the Project->Options->User->Run User Programs Before Build/Rebuild add a command of:

    PreProcess.Bat @L
    

    Have a batch file in your project directory (with the name PreProcess.Bat) that contains:

    echo #define PROJECT_NAME %1 >MyProjectName.H
    

    Now, just include that header into your code and bam.

    You might like to tinker with it, but I think it shows the basic principle.

Reply
  • That will work only by ...

    Why do people say stupid things such as that?

    An alternative to the only way might be to do the following:

    In the Project->Options->User->Run User Programs Before Build/Rebuild add a command of:

    PreProcess.Bat @L
    

    Have a batch file in your project directory (with the name PreProcess.Bat) that contains:

    echo #define PROJECT_NAME %1 >MyProjectName.H
    

    Now, just include that header into your code and bam.

    You might like to tinker with it, but I think it shows the basic principle.

Children