Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

CMake Verbatim

From Merriam Webster Online:
ver·ba·tim (adv): in the exact words : word for word.

That’s my first impression of what CMake VERBATIM option should behave, and so do some folks in http://marc.info/?l=cmake&m=122818556004629&w=2. That is, the WHOLE argument list should be passed exactly as it is in CMakeLists.txt, unchanged.

But apparently CMake developers interpret that word in other way. For them, INDIVIUAL arguments should be passed safely though the tough neighberhood. The idea itself sounds good, unfortunately, CMake is not smart enough to do that.

Following example demostrates this problem:

ADD_CUSTOM_TARGET(hello
    COMMAND echo "How are you doing?" 'Fine, thank you.'
)

generates

CMakeFiles/hello:
	echo How\ are\ you\ doing? 'Fine, thank you.'

While with VERBATIM,

ADD_CUSTOM_TARGET(hello
    COMMAND echo "How are you doing?" 'Fine, thank you.'
    VERBATIM
)

generates

CMakeFiles/hello:
	echo "How are you doing?" "'Fine," thank "you.'"

Seems that VERBATIM only reckons and handles double-quoted strings.
If you need single-quoted strings or any others, sorry,
turn off VERBATIM and do it yourself.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: