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

passing parameters to post build program

Hello,

is it possible to pass a #define to a progam started after build/rebuild.

At the moment I call this program in targetoptions - User - After Build/Rebuild:

QBin2Prf.exe ".\files\objTS\ts.bin" 1 8

It would be helpful to replace the 1 and the 8 by a define which is already defined in my source.

#define USR_K_NODENUMBER (1)
#define USR_K_TYPENUMBER (8)

Unfortunately I did not find a way to pass these defines to teh command line :-(

  • No, that's not possible. You could do it partially the other way round, though, i.e. instead of digging those settings out of the depths of some random source file, they could be in the IDE from the start, and be pushed into the source from there, as -D flags to the compiler.

    If you're serious about this kind of configuration management, the IDE is probably the wrong tool for the job. In a makefile, OTOH, this would be trivial:

    # settings section
    MAKE_NODE_NUMBER = 1
    MAKE_TYPE_NUMBER = 8
    
    #...compiler setion
    CFLAGS += -DUSR_K_NODENUMBER=($(MAKE_NODE_NUMBER))
    CFLAGS += -DUSR_K_TYPENUMBER=($(MAKE_TYPE_NUMBER))
    
    #...postprocessing section
    somefile.prf: ./files/objTS/ts.bin
        QBin2Prf.exe "$<" $(MAKE_NODE_NUMBER) (MAKE_TYPE_NUMBER)
    

  • On the other hand, you can specify a script (powershell, python...) as the command, and pass the MDK project file to it.
    So it would fish the needed defines out of the project and run the tool.

    -- pa