<div dir="ltr">Putting <div><br>set(CMAKE_EXPORT_COMPILE_COMMANDS 1)</div><div><br></div><div>right above defining target solve the problem. <br><div> </div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">Fabrício Ceolin<br>+55 (31) 98675-1359<br>MiningMath Associates<br><a href="http://www.miningmath.com" target="_blank">www.miningmath.com</a><br><br></div></div>
<br><div class="gmail_quote">2016-12-07 8:48 GMT-02:00 Wagner, David <span dir="ltr"><<a href="mailto:david.wagner@intel.com" target="_blank">david.wagner@intel.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've tested this on Ubuntu 15.10 using CMake 3.2.2<br>
<br>
Where, in the CMakeLists did you put it? As far as I can tell, it needs to be done before defining the targets for which you want compile commands to be exported.<br>
<br>
W<span class=""><br>
<br>
On 07/12/2016 11:35, Fabrício Ceolin wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hi,<br>
<br>
Thank you David. Which version of cmake and operational system are you using?<br>
In my CMakeLists.txt file, I tried to set<br>
<br>
set(CMAKE_EXPORT_COMPILE_COMMA<wbr>NDS 1)<br>
<br>
and<br>
<br>
set(CMAKE_EXPORT_COMPILE_COMMA<wbr>NDS ON)<br>
<br>
without success, unfortunately.<br>
<br>
Em qua, 7 de dez de 2016 às 08:13, Wagner, David <<a href="mailto:david.wagner@intel.com" target="_blank">david.wagner@intel.com</a><br></span>
<mailto:<a href="mailto:david.wagner@intel.com" target="_blank">david.wagner@intel.com</a><wbr>>> escreveu:<div><div class="h5"><br>
<br>
<br>
<br>
    On 05/12/2016 12:31, Fabrício Ceolin wrote:<br>
     > Hi,<br>
     ><br>
     > I am trying to put<br>
     > set(CMAKE_EXPORT_COMPILE_COMMA<wbr>NDS ,1) inside a toolchain file but the command<br>
     > has no effect there. I've tried to put it in CMakeLists.txt too using the<br>
     > previosly set and add_definitions(-DCMAKE_EXPORT<wbr>_COMPILE_COMMANDS=1) without<br>
     > success.<br>
<br>
    "set(CMAKE_EXPORT_COMPILE_COMM<wbr>ANDS 1)" inside the CMakeLists.txt works for me<br>
    but note that you have an extra comma before the "1" value. CMake only uses<br>
    commas for lists. It probably also works in the toolchain file. I don't see how<br>
    using add_definitions() would work because it is only used in the compiler's<br>
    command line.<br>
<br>
    W<br>
<br>
    --<br>
    David Wagner<br>
<br>
    complex != complicated<br>
    ------------------------------<wbr>------------------------------<wbr>---------<br>
    Intel Corporation SAS (French simplified joint stock company)<br>
    Registered headquarters: "Les Montalets"- 2, rue de Paris,<br>
    92196 Meudon Cedex, France<br>
    Registration Number:  302 456 199 R.C.S. NANTERRE<br>
    Capital: 4,572,000 Euros<br>
<br>
    This e-mail and any attachments may contain confidential material for<br>
    the sole use of the intended recipient(s). Any review or distribution<br>
    by others is strictly prohibited. If you are not the intended<br>
    recipient, please contact the sender and delete all copies.<br>
<br>
    --<br>
<br></div></div>
    Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><span class=""><br>
<br>
    Please keep messages on-topic and check the CMake FAQ at:<br></span>
    <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_FAQ</a> <<a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMa<wbr>ke_FAQ</a>><span class=""><br>
<br>
    Kitware offers various services to support the CMake community. For more<br>
    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/su<wbr>pport.html</a><br>
    <<a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/s<wbr>upport.html</a>><br>
    CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
    <<a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/c<wbr>onsulting.html</a>><br>
    CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
    <<a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/t<wbr>raining.html</a>><br>
<br>
    Visit other Kitware open-source projects at<br>
    <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
    <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/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/mail<wbr>man/listinfo/cmake</a><br></span>
    <<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/cmake</a>><br>
<br>
</blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
David Wagner<br>
<br>
complex != complicated<br>
------------------------------<wbr>------------------------------<wbr>---------<br>
Intel Corporation SAS (French simplified joint stock company)<br>
Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France<br>
Registration Number:  302 456 199 R.C.S. NANTERRE<br>
Capital: 4,572,000 Euros<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
</div></div></blockquote></div><br></div>