cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

basisproject cannot find template files when build directory path contains symbolic links #480

Closed schuhschuh closed 8 years ago

schuhschuh commented 9 years ago

The relative path returned by basis_set_script_path is incorrect when the __DIR__ contains symbolic links whereas the exedir utility function returns the real path.

schuhschuh commented 9 years ago

Due to an issue with get_filename_component (cf. #482), this cannot be done right now because basis_get_relative_path uses this command to normalise absolute paths to avoid known bugs of the file(RELATIVE_PATH) command (search CMake bug tracker).

Instead, the relative path should be made absolute again using the exedir('<target>') which is the absolute path to the build directory used when CMake was run first for scripts in the build tree instead of exedir() which returns the real path of the directory containing the executable. For installations, the relative path is assumed to be the same whether or not the installation root directory contains symbolic links. The issue only came up for the build tree version of the basisproject command which used the real path of the build tree to make the relative path computed by basis_set_script_path absolute at run time.