CMAKE_SYSTEM_PREFIX_PATH entry based on CMake install prefix
Hi Team,
The issue in detail,
We are installing cmake via below steps,
tar -xvf cmake-3.8.1.tar.gz
cd cmake-3.8.1
mkdir build
Cd build
../bootstrap --prefix=/opt/cmake/x86_64/3.8.1/ --datadir=/share --docdir=/doc --mandir=/man --parallel=`/usr/bin/getconf _NPROCESSORS_ONLN`
make VERBOSE=1
Cd build
make test
Cd ../
make install DESTDIR=/opt/cmake/x86_64/3.8.1/
After installation CMAKE_SYSTEM_PREFIX_PATH is looks like below,
[root@anil-test ~]$ /opt/cmake/x86_64/3.8.1/bin/cmake --system-information |grep CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_PREFIX_PATH "/usr/local;/usr;/;/opt/cmake/x86_64;/usr/local"
We have installed different versions of cmake, So it is taking Modules randomly from below files, due to CMAKE_SYSTEM_PREFIX_PATH have /opt/cmake/x86_64
/opt/cmake/x86_64/2.8.7/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/2.8.2/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/3.8.1/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/3.4.3/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/3.1.0/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/3.10.2/share/Modules/FindBoost.cmake
/opt/cmake/x86_64/3.7.1/share/Modules/FindBoost.cmake
We need to change the path /opt/cmake/x86_64 to /opt/cmake/x86_64/3.8.1/
CMAKE_SYSTEM_PREFIX_PATH "/opt/cmake/x86_64/3.8.1/"
Please let me know how to do this
Edited by Brad King