<div dir="ltr">I don't get how come the macro works because `<span style="font-size:12.8px">target_compile_definitions` needs at least 3 parameters. The second one must be PRIVATE|PUBLIC|INTERFACE.</span><div><span style="font-size:12.8px">Tamas</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 12, 2016 at 7:43 AM, Michael Surette <span dir="ltr"><<a href="mailto:mjsurette@gmail.com" target="_blank">mjsurette@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would like to use set target properties from within a function.  ie<br>
<br>
function(MINE TGT DEF)<br>
  target_compile_definitions("${TGT}" "${DEF}")<br>
endfunction(MINE TGT DEF)<br>
<br>
This doesn't work.  If I change it to a macro, it does.<br>
<br>
macro(MINE TGT DEF)<br>
  target_compile_definitions("${TGT}" "${DEF}")<br>
endmacro(MINE TGT DEF)<br>
<br>
Is there a way to extend the scope of TGT in the function so that the function variant works?<br>
<br>
TIA<br>
<br>
Mike<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>