Getting Eclipse CDT to use relative include paths in generated Makefiles

前端 未结 4 779
难免孤独
难免孤独 2020-12-17 16:56

I am using the Eclipse CDT. I have configured the \"external Builder\" and I am generating the Makefiles automatically. Unfortunately, the generated Makefiles contain the ab

4条回答
  •  暖寄归人
    2020-12-17 17:38

    I found this question asked long time ago. I'm trying to setup GitLab CI with Eclipse CDT, the easiest way suggested is to use the existing makefile the CDT generated. But, I was unable to easily config the Eclipse CDT to generate the makefile in my project with relative path easily, I can see I can get "include" settings changed, but there are other files referenced in the makefile using absolute path in the make files too. So I just used a PowerShell script to update all the absolute path into relative path. Check the PWD for the absolute path, then count the ../ to back out to the root of the project. Mine was 5 folder deep.

    ls *.mk -rec | %{ $f=$_; (gc $f.PSPath) | %{ $_ -replace "c:/absolute path", "../../../../.." } | sc $f.PSPath }
    

提交回复
热议问题