[CMake] passing arguments to the final make

Michael Hertling mhertling at online.de
Wed Feb 22 16:18:14 EST 2012


On 02/22/2012 06:56 PM, Andrea Crotti wrote:
> On 02/22/2012 05:32 PM, Andrea Crotti wrote:
>>
>> Ah that's nice thanks, I'm not sure though that I can rely on being >= 
>> 2.8 always,
>> and that's probably a requirement, right?
>>
> 
> I tried what you suggested and with this:
> add_custom_target(dev_no_run
>    COMMAND ${PYTHON_EXECUTABLE} ${DEV_MAIN} -w ${WORKSPACE} 
> ${APPLICATION} --develop_only -l info
>    COMMAND ${PYTHON_EXECUTABLE} \${SCRIPT}
>    )
> 
> I get this in the Makefile:
> 
> CMakeFiles/dev_no_run:
>      /usr/bin/python 
> /home/andrea/git_projs/PSI_Hamburg/utils/utils/bin/dev_main.py -w 
> /home/andrea/git_projs 
> /home/andrea/git_projs/Minimum_Drag/airbus.application.minimum_drag 
> --develop_only -l info
>      /usr/bin/python ${SCRIPT}
> 
> which is probably not what I want, because for a Makefile it should be 
> $(SCRIPT), right?

In Makefiles, $(SCRIPT) and ${SCRIPT} are equivalent, see [1]. However,
parentheses can have a special meaning w.r.t. a library's object files,
and $() is primarily associated with the shell's command substitution.
Thus, I personally prefer ${} for dereferencing macros in Makefiles
since it's quite unambiguous.

Regards,

Michael

> [1] http://www.gnu.org/software/make/manual/html_node/Reference.html#Reference


More information about the CMake mailing list