cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -D_ECLIPSE_VERSION=4.5 -DCMAKE_SYSTEM_NAME=Windows -DPROJECT_SOURCE_DIR=C:/Projects/tracker ../tracker (unix style path. This is the path where the cmake list files are located)
The above is being used to generate a makefile for a Cygwin environment along with an eclipse project. I am using Eclipse mars on windows 7 with cygwin. The project sets up the debugger with gdb.
Name of the project is "Tracker".
Now in the project browser pane in Eclipse, upon expanding the project name ->[Targets]->[exe]Tracker -> Source files.
The file icons have an exclamation on them. It turns out that on right-click->properties, the file's location is listed as
C:\cygdrive\c\Projects\tracker\hello.cpp - (does not exist)
Since I used the Cmake CDT4 eclipse generator for cygwin (unix makefiles), the path in the command line for the cmake command was also unix style. If I change this to DOS style, make wont recognize the paths and barfs (since cmake makes the makefiles with DOS style paths now).
How can I configure cmake to use windows paths for these source files only under targets so that eclipse can find them when I launch a debugging session ?
Copyright Notice:Content Author:「marc」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/27609326/cmake-with-cdt4-eclipse-generator-to-generate-unix-makefiles