On 03/25/2015 10:15 AM, Roger Leigh wrote: > Question: Why is TESTDIR2 transformed from "t2" to > "/home/rleigh/pathtest/test/t2" (which is > "$PROJECT_BINARY_DIR/$TESTDIR2)?
It looks like the behavior has been this way since 2003: ENH: When fixing cache value with uninitialized type, collapse full paths for PATH and FILEPATH. Closes Bug #82 - Specifying relative path when entering path can break things http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6567329 but was added without documentation back in our wild west days. > Copying the GNUInstallDirs behaviour of wrapping in an "if (NOT DEFINED foo)" > test > mitigates the problem. > > For my usage, I'm defining project-specific install dirs derived from the > toplevel GNUInstallDirs dirs. I'd quite like to be able to specify a relative > (or absolute) path, and then later prepend the install prefix / appropriate > GNUInstallDirs toplevel variable. Having the current working directory added > by default screws this up quite badly! >From the commit message above I think the intended behavior is exactly to transform relative paths. The behavior has been this way for so long I don't think we can change it now. We can update the documentation to describe the behavior, but I think using the approach in GNUInstallDirs is the solution for you. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
