<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-01-21 15:14 GMT+01:00 Vania Joloboff <span dir="ltr"><<a href="mailto:vania.joloboff@inria.fr" target="_blank">vania.joloboff@inria.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br>
<br>
I want to add two definitions to compile one specific files<br>
in addition to the global definitions.<br>
I have the following problem. If I use<br>
<br>
set_source_files_properties(source.cpp<br>
PROPERTIES<br>
COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} )<br>
<br>
then I get error message incorrect number of arguments for set_source_files_properties<br>
<br>
If I put<br>
set_source_files_properties(source.cpp<br>
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1} VAR2=${MY_VAR2}" )<br>
<br>
then it generates strangely enough the compile command<br>
<br>
/usr/bin/c++ -DVAR1="path1 VAR2=path2" ... source.cpp<br>
<br>
with the double quotes as above, which gives a weird value to VAR1 and no value to VAR2<br>
<br>
If I use twice set_source_files_properties<br>
the first one is overwritten by the second<br>
and I only get the definition of VAR2<br>
<br>
What am I supposed to do ?<br></blockquote><div><br></div><div>Did you try to separate you VAR1 and VAR2 def suing semicolon as indicated in the doc:<br>"The COMPILE_DEFINITIONS property may be set to a semicolon-separated<br>list of preprocessor definitions using the syntax VAR or VAR=value."<br><br></div><div>see<br>cmake --help-property COMPILE_DEFINITIONS<br><br></div><div>so try:<br>set_source_files_properties(source.cpp<br>
PROPERTIES COMPILE_DEFINITIONS "VAR1=${MY_VAR1};VAR2=${MY_VAR2}" )<br><br></div></div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</div></div>