Re: [CMake] FIND_XXX problem with symlinks when using ENV
On Sun, 2010-02-21 at 16:37 +0100, Alexander Neundorf wrote: On Friday 19 February 2010, Marcel Loose wrote: Hi all, I've noticed a problematic behaviour with the FIND_XXX macros when using ENV in either PATHS or HINTS: symbolic links get converted to the real paths. This happens with cmake 2.6.x and 2.8.0. Is this a bug? No. Ok, longer answer: why do you think this is bad ? Alex I think it's bad for at least two reasons: 1) Consistency! It happens when using ENV, but not when hard-coding the exact same path. See my example, where using HINTS ENV HDF5_ROOT (with HDF5_ROOT set to '/opt/hdf5') resulted in the symlink being converted to a real path, whereas using HINTS /opt/hdf5 did not result in a real path. 2) The symlink exists for a reason! The build is done on a cluster front-end node, which provides access to third-party software for the compute nodes using NFS. So, for example, HDF5 resides in the directory '/data/sys/opt/hdf5' on the front-end node. The compute nodes, however, see this directory as '/opt/hdf5'. Therefore, on the front node, a symlink /opt/hdf5 - /data/sys/opt/hdf5 exists. Translating '/opt/hdf5' into the real path results in the compute nodes not being able to locate the required shared libraries. IMHO, CMake should not mess with symlinks. Best regards, Marcel Loose. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] FIND_XXX problem with symlinks when using ENV
On Friday 19 February 2010, Marcel Loose wrote: Hi all, I've noticed a problematic behaviour with the FIND_XXX macros when using ENV in either PATHS or HINTS: symbolic links get converted to the real paths. This happens with cmake 2.6.x and 2.8.0. Is this a bug? No. Ok, longer answer: why do you think this is bad ? Alex ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] FIND_XXX problem with symlinks when using ENV
Hi all, I've noticed a problematic behaviour with the FIND_XXX macros when using ENV in either PATHS or HINTS: symbolic links get converted to the real paths. This happens with cmake 2.6.x and 2.8.0. Is this a bug? Here's an example: $ ls -l /opt/hdf5 lrwxrwxrwx 1 root root 18 2009-09-21 10:08 /opt/hdf5 - /data/sys/opt/hdf5 $ cat CMakeLists.txt cmake_minimum_required(VERSION 2.6) project(MyHDF5) set(ENV{HDF5_ROOT} /opt/hdf5) find_path(HDF5_INCLUDE_DIR hdf5.h HINTS ENV HDF5_ROOT PATH_SUFFIXES include) $ grep HDF5_INCLUDE_DIR CMakeCache.txt HDF5_INCLUDE_DIR:PATH=/data/sys/opt/hdf5/include Replacing 'ENV HDF5_ROOT' in find_path() with the literal string '/opt/hdf5' gives me: $ grep HDF5_INCLUDE_DIR CMakeCache.txt HDF5_INCLUDE_DIR:PATH=/opt/hdf5/include Best regards, Marcel Loose. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake