[CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt

Fabrício Ceolin fabricio.ceolin at miningmath.com
Mon Dec 5 06:31:46 EST 2016


Hi,

I am trying to put
set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but the
command has no effect there. I've tried to put it in CMakeLists.txt too
using the previosly set and
add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) without success.

The command only works in command line, when I put
 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 in cmake args.

I am using ubuntu 16.04 with cmake 3.5.1 from ubuntu (3.5.1-1ubuntu1).

Is it possible to use CMAKE_EXPORT_COMPILE_COMMANDS inside external
toolchain file (using args -DCMAKE_TOOLCHAIN_FILE=<filename>.cmake) or in
CMakeLists.txt?

Thanks,


Fabrício Ceolin
+55 (31) 98675-1359
MiningMath Associates
www.miningmath.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161205/104b6a1e/attachment-0001.html>


More information about the CMake mailing list