<div dir="ltr"><div><div><div>Hi Vania.<br><br></div>For your case, it's best to forget about the not-as-convenient-as-they-could-be convenience functions set_*_properties, and just invoke set_property:<br><br></div>set_property(<br>  SOURCE source.cpp<br>  PROPERTY COMPILE_DEFINITIONS<br>    VAR1=${MY_VAR1} VAR2=${MY_VAR2}<br></div><div>)<br><br>Petr<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 3:14 PM, Vania Joloboff <span dir="ltr"><<a href="mailto:vania.joloboff@inria.fr" target="_blank">vania.joloboff@inria.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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>
<br>
Thankx<br>
<br>
PS I am using cmake 3.2.2 on Linux Mint.<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>