15knots / cmake4eclipse

Let Eclipse use CMake to generate the buildscripts for Eclipse CDT
Eclipse Public License 2.0
84 stars 25 forks source link

CMAKE_EXPORT_COMPILE_COMMANDS Parser fails for command paths using a forward slash #44

Closed NikBrg closed 7 years ago

NikBrg commented 7 years ago

I am using cmake4eclipse on Windows with MSYS2. Unfortunately, the CMAKE_EXPORT_COMPILE_COMMANDS Parser fails to recognize the command parser due to forward slashes in the command path:

/Project/compile_commands.json: No parser for command 'D:/Project/Tools/MSYS2/mingw64/bin/cc.exe -DSTM32F205xx -DUNITTEST @CMakeFiles/usbh.dir/includes_C.rsp -O3 -DNDEBUG -fprofile-arcs -ftest-coverage -o CMakeFiles/usbh.dir/STMicro/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c.obj -c D:/Project/EclipseWS_MSYS2/PogoSMAC/src/main/ThirdParty/STMicro/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c', skipped

If all forward slashes ("/") are replaced by double backslashes ("\"), everything works as expected.

15knots commented 7 years ago

Which cmake version do you use?

NikBrg commented 7 years ago

CMake 3.8.1 (from MSYS2 MinGW repository)

15knots commented 7 years ago

cmake version 3.5.2 produces C:\\MinGW\\bin\\gcc.exe. Looks like the cmake guys changed it since then