<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Yes, <br>
    </p>
    <p>after more reading and thinking, I think it might need some
      adaptation of the tools. CMake targets NVCC, I was kinda hoping
      that it would spew out the nvcc options that could then be fed to
      the tools I want to yo use. </p>
    <p>But those specific tools are all clang based, so they probably
      don't know about nvcc commands. I don't know how genric that
      compilation database is. (although for what I want, the tools
      probably only need gcc compatible flags, like -D and -I to
      recognise defines and include paths. If you tell them to work in
      C++ mode, you can actually get them to run on *.cu files as clang
      knows about CUDA, so they just need to know about include paths.)</p>
    <p>Maybe it would work if I made a CMake file without using NVCC to
      target clang directly as a specific compiler for *.cu file.</p>
    <p>So from what I currently understand, what you suggest might be
      the simplest. Parse the verbose output and make my own compilation
      database.</p>
    <p>Thanks,</p>
    <p>Urs</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 10/19/18 5:26 PM, Dmitry Mikushin
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJoDaPYYxmOEcxigHKUzhzYuMssuEkgb_zFa46rW6xBaxOqCSg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">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.
        <div><br>
        </div>
        <div>Kind regards,</div>
        <div>- Dmitry.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">пт, 19 окт. 2018 г. в 18:17, Urs <<a
            href="mailto:nab%2Bcmake@lampshade.ch"
            moz-do-not-send="true">nab+cmake@lampshade.ch</a>>:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0&#xA;
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
          <br>
          I'm trying to get CMake to output a compilation database for
          my project <br>
          using gcc and CUDA (nvcc). I'd use the compile_commands.json
          file for <br>
          rtags navigation in emacs and clang-tidy inspection.<br>
          <br>
          To do that, I just added<br>
          <br>
          set(CMAKE_EXPORT_COMPILE_COMMANDS 1)<br>
          <br>
          to my CMakeLists.txt<br>
          <br>
          But it looks like the output I get is only having the
          information for <br>
          the *.cpp files. It looks like the *.cu files are all compiled
          as <br>
          external objects taht have their own cmake code in subroutines
          and are <br>
          not built by the Makefile generator.<br>
          <br>
          I'm not a cmake expert, is what I'm trying to do possible? Am
          I doing <br>
          something wrong somewhere?<br>
          <br>
          Thanks,<br>
          <br>
          Urs<br>
          <br>
          -- <br>
          <br>
          Powered by <a href="http://www.kitware.com" rel="noreferrer"
            target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">http://cmake.org/cmake/help/support.html</a><br>
          CMake Consulting: <a
            href="http://cmake.org/cmake/help/consulting.html"
            rel="noreferrer" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">http://www.kitware.com/opensource/opensource.html</a><br>
          <br>
          Follow this link to subscribe/unsubscribe:<br>
          <a href="https://cmake.org/mailman/listinfo/cmake"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://cmake.org/mailman/listinfo/cmake</a><br>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>