(cmake) build directory: use "as is" or normalised for calling cmake?

René J.V. Bertin rjvbertin at gmail.com
Thu Sep 21 08:29:45 UTC 2017


Hi,

A quick existential question: how to use the build directory of cmake projects? Chdir into it "as is" (as entered by the user) before calling CMake, or normalise/canonicalise/expand it first? That would be the cross-platform consistent thing to do (on Mac it's near impossible to avoid what [t]csh calls chasing symlinks) and would avoid build problems with certain projects like KDevelop itself.

KDevelop code ends up including auto-generated files via clever relative links which break on Linux when symlinks on the path aren't expanded.

I guess you can argue one shouldn't use symlinks to shortcut into hidden build directories and that normalising such paths can break user expectactions At some point in the distant past I actually would have believed that, for reasons long forgotten; nowadays I am used to the simplicity of "chdir takes you to the actual location no matter via what detour or shortcut".

This all sounded clearer in my head...

R.


More information about the KDevelop-devel mailing list