Presuming makefile target, would it help if after CMake you do "make
VERBOSE=1" ? Verbose mode should show all compilation commands, maybe you
could further parse them into the format you want.

Kind regards,
- Dmitry.

пт, 19 окт. 2018 г. в 18:17, Urs <nab+cm...@lampshade.ch>:

> Hi,
>
> I'm trying to get CMake to output a compilation database for my project
> using gcc and CUDA (nvcc). I'd use the compile_commands.json file for
> rtags navigation in emacs and clang-tidy inspection.
>
> To do that, I just added
>
> set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
>
> to my CMakeLists.txt
>
> But it looks like the output I get is only having the information for
> the *.cpp files. It looks like the *.cu files are all compiled as
> external objects taht have their own cmake code in subroutines and are
> not built by the Makefile generator.
>
> I'm not a cmake expert, is what I'm trying to do possible? Am I doing
> something wrong somewhere?
>
> Thanks,
>
> Urs
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to