[CMake] passing arguments to the final make

Andrea Crotti andrea.crotti.0 at gmail.com
Wed Feb 22 17:53:57 EST 2012


On 02/22/2012 09:18 PM, Michael Hertling wrote:
> 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
>
>

Ah good thanks, I have to check what happened then tomorrow because it 
didn't
work properly anyway...
And another thing, is it actually \${SCRIPT} a portable solution that 
works on all the generators?


More information about the CMake mailing list