title: No compile_commands.json file using cmake with vs code on windows
body: <p>I am trying to integrate the Clang-Tidy static analysis tool into my build system.
  I am getting a few issues with my setup.</p>
  <p>Step <code>cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..</code> is not generating compile_commands.json file.
  Hence, clang-tidy is giving below error.</p>
  <p><code>&gt;cmake --build .</code> result</p>
  <pre><code>Could not auto-detect compilation database from directory &quot;C:/dev/my-project/build/compile_commands.json&quot;
    No compilation database found in C:\dev\my-project\build\compile_commands.json or any parent directory
    fixed-compilation-database: Error while opening fixed database: no such file or directory
    json-compilation-database: Error while opening JSON database: no such file or directory
    Running without flags.
    Error while processing C:\dev\my-project\src\.
  CUSTOMBUILD : error : unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error] [C:\dev\my-project\build\analyze_clang_tidy.vcxproj]
    Suppressed 1 warnings (1 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
  </code></pre>
  <p><code>Clang-tidy.cmake</code> file</p>
  <pre><code>set(CLANG_TIDY_CHECKS &quot;-checks='${CLANG_TIDY_CHECKS}'&quot;)
  
              add_custom_target(analyze_clang_tidy ALL
                  COMMAND ${CLANG_TIDY}
                  -p ${CMAKE_BINARY_DIR}/compile_commands.json
                  ${CLANG_TIDY_CHECKS}
                  -header-filter='.*'
                  ${CMAKE_CURRENT_SOURCE_DIR}/src/
                  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
                  COMMENT &quot;Static code analysis with Clang-Tidy&quot;
              )
  </code></pre>
  <p>Please also find the configuration result</p>
  <pre><code>-- Building for: Visual Studio 14 2015
  -- Selecting Windows SDK version  to target Windows 10.0.17763.
  -- The CXX compiler identification is MSVC 19.0.24215.1
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  Default build type: Debug
  iD MSVC
  -- ccache found and enabled
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/dev/my-project/build
  </code></pre>
  <p>I have a simple hello world <code>int main() {...}</code> in my <code>../src/</code> folder.</p>
  <p>Please suggest to me how to generate the compile_commands.json file using CMake with VS code on windows.
  Thank you!</p>