FindBoost ignores Boost_ROOT when CMAKE_PREFIX_PATH is also set
Consider this CMakeLists.txt:
cmake_minimum_required(VERSION 3.14)
project(test CXX)
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
and compare the output from cmake with and without -DBoost_LIBRARY_DIR=$MYBOOST/lib
, i.e.,
cmake .. \
-DCMAKE_PREFIX_PATH=$MYLIBS \
-DBoost_NO_SYSTEM_PATHS=TRUE \
-DBoost_NO_BOOST_CMAKE=TRUE \
-DBOOST_ROOT=$MYBOOST \
-DBoost_COMPILER="-clang8" \
-DBoost_ARCHITECTURE="-x64" \
-DBoost_DEBUG=ON
vs
cmake .. \
-DCMAKE_PREFIX_PATH=$MYLIBS \
-DBoost_NO_SYSTEM_PATHS=TRUE \
-DBoost_NO_BOOST_CMAKE=TRUE \
-DBOOST_ROOT=$MYBOOST \
-DBoost_LIBRARY_DIR=$MYBOOST/lib \
-DBoost_COMPILER="-clang8" \
-DBoost_ARCHITECTURE="-x64" \
-DBoost_DEBUG=ON
where $MYLIBS/lib
is a directory where the user libraries are installed, including libboost_unit_test_framework-mt.so.1.69.0
and $MYBOOST is the directory of the same boost version but built with clang instead of gcc, i.e., it has libboost_unit_test_framework-clang8-mt-x64-1_69.so
The expected behavior is that either commands would make cmake use $MYBOOST/lib/libboost_unit_test_framework-clang8-mt-x64-1_69.so
instead of $MYLIBS/lib/libboost_unit_test_framework-mt.so.1.69.0
. But in cmake 3.14.2, I got different results from the two. The first one gives:
-- The CXX compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1181 ] _boost_TEST_VERSIONS = 1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1183 ] Boost_USE_MULTITHREADED = TRUE
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1185 ] Boost_USE_STATIC_LIBS =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1187 ] Boost_USE_STATIC_RUNTIME =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1189 ] Boost_ADDITIONAL_VERSIONS =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1191 ] Boost_NO_SYSTEM_PATHS = TRUE
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1259 ] Declared as CMake or Environmental Variables:
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1261 ] BOOST_ROOT = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1263 ] BOOST_INCLUDEDIR =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1265 ] BOOST_LIBRARYDIR =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1267 ] _boost_TEST_VERSIONS = 1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1342 ] Include debugging info:
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1344 ] _boost_INCLUDE_SEARCH_DIRS = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/include;/scratch/.linuxbrew/Cellar/boost/1.69.0_clang;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1346 ] _boost_PATH_SUFFIXES = boost-1_70_0;boost_1_70_0;boost/boost-1_70_0;boost/boost_1_70_0;boost-1_70;boost_1_70;boost/boost-1_70;boost/boost_1_70;boost-1_69_0;boost_1_69_0;boost/boost-1_69_0;boost/boost_1_69_0;boost-1_69;boost_1_69;boost/boost-1_69;boost/boost_1_69;boost-1_68_0;boost_1_68_0;boost/boost-1_68_0;boost/boost_1_68_0;boost-1_68;boost_1_68;boost/boost-1_68;boost/boost_1_68;boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67;boost-1_66_0;boost_1_66_0;boost/boost-1_66_0;boost/boost_1_66_0;boost-1_66;boost_1_66;boost/boost-1_66;boost/boost_1_66;boost-1_65_1;boost_1_65_1;boost/boost-1_65_1;boost/boost_1_65_1;boost-1_65_0;boost_1_65_0;boost/boost-1_65_0;boost/boost_1_65_0;boost-1_65;boost_1_65;boost/boost-1_65;boost/boost_1_65;boost-1_64_0;boost_1_64_0;boost/boost-1_64_0;boost/boost_1_64_0;boost-1_64;boost_1_64;boost/boost-1_64;boost/boost_1_64;boost-1_63_0;boost_1_63_0;boost/boost-1_63_0;boost/boost_1_63_0;boost-1_63;boost_1_63;boost/boost-1_63;boost/boost_1_63;boost-1_62_0;boost_1_62_0;boost/boost-1_62_0;boost/boost_1_62_0;boost-1_62;boost_1_62;boost/boost-1_62;boost/boost_1_62;boost-1_61_0;boost_1_61_0;boost/boost-1_61_0;boost/boost_1_61_0;boost-1_61;boost_1_61;boost/boost-1_61;boost/boost_1_61;boost-1_60_0;boost_1_60_0;boost/boost-1_60_0;boost/boost_1_60_0;boost-1_60;boost_1_60;boost/boost-1_60;boost/boost_1_60;boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1366 ] location of version.hpp: /scratch/.linuxbrew/include/boost/version.hpp
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1391 ] version.hpp reveals boost 1.69.0
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1447 ] Boost_LIB_PREFIX =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1449 ] Boost_NAMESPACE = boost
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1474 ] using user-specified Boost_COMPILER = -clang8
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1494 ] _boost_MULTITHREADED = -mt
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1548 ] using user-specified Boost_ARCHITECTURE = -x64
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1578 ] _boost_RELEASE_ABI_TAG = -
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1580 ] _boost_DEBUG_ABI_TAG = -d
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1643 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;/scratch/.linuxbrew/Cellar/boost/1.69.0_clang/stage/lib;/scratch/.linuxbrew/include/lib;/scratch/.linuxbrew/include/../lib;/scratch/.linuxbrew/include/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;/scratch/.linuxbrew/Cellar/boost/1.69.0_clang/stage/lib;/scratch/.linuxbrew/include/lib;/scratch/.linuxbrew/include/../lib;/scratch/.linuxbrew/include/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1837 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE: boost_unit_test_framework-clang8-mt-x64-1_69;boost_unit_test_framework-clang8-mt-x64;boost_unit_test_framework-clang8-mt;boost_unit_test_framework-mt-x64-1_69;boost_unit_test_framework-mt-x64;boost_unit_test_framework-mt;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:405 ] Boost_LIBRARY_DIR_RELEASE = /scratch/.linuxbrew/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /scratch/.linuxbrew/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1894 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG: boost_unit_test_framework-clang8-mt-d-x64-1_69;boost_unit_test_framework-clang8-mt-d-x64;boost_unit_test_framework-clang8-mt-d;boost_unit_test_framework-mt-d-x64-1_69;boost_unit_test_framework-mt-d-x64;boost_unit_test_framework-mt-d;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:405 ] Boost_LIBRARY_DIR_DEBUG = /scratch/.linuxbrew/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /scratch/.linuxbrew/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1968 ] Boost_FOUND = 1
-- Boost version: 1.69.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /scratch/mycodes/cmakeBug/build_clang
where BOOST_ROOT
seems to be ignored and it links ``$MYBOOST/lib/libboost_unit_test_framework-clang8-mt-x64-1_69.so` during link time. On the other hand, the second cmake command gives:
-- The CXX compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1181 ] _boost_TEST_VERSIONS = 1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1183 ] Boost_USE_MULTITHREADED = TRUE
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1185 ] Boost_USE_STATIC_LIBS =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1187 ] Boost_USE_STATIC_RUNTIME =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1189 ] Boost_ADDITIONAL_VERSIONS =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1191 ] Boost_NO_SYSTEM_PATHS = TRUE
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1259 ] Declared as CMake or Environmental Variables:
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1261 ] BOOST_ROOT = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1263 ] BOOST_INCLUDEDIR =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1265 ] BOOST_LIBRARYDIR =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1267 ] _boost_TEST_VERSIONS = 1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1342 ] Include debugging info:
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1344 ] _boost_INCLUDE_SEARCH_DIRS = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/include;/scratch/.linuxbrew/Cellar/boost/1.69.0_clang;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1346 ] _boost_PATH_SUFFIXES = boost-1_70_0;boost_1_70_0;boost/boost-1_70_0;boost/boost_1_70_0;boost-1_70;boost_1_70;boost/boost-1_70;boost/boost_1_70;boost-1_69_0;boost_1_69_0;boost/boost-1_69_0;boost/boost_1_69_0;boost-1_69;boost_1_69;boost/boost-1_69;boost/boost_1_69;boost-1_68_0;boost_1_68_0;boost/boost-1_68_0;boost/boost_1_68_0;boost-1_68;boost_1_68;boost/boost-1_68;boost/boost_1_68;boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67;boost-1_66_0;boost_1_66_0;boost/boost-1_66_0;boost/boost_1_66_0;boost-1_66;boost_1_66;boost/boost-1_66;boost/boost_1_66;boost-1_65_1;boost_1_65_1;boost/boost-1_65_1;boost/boost_1_65_1;boost-1_65_0;boost_1_65_0;boost/boost-1_65_0;boost/boost_1_65_0;boost-1_65;boost_1_65;boost/boost-1_65;boost/boost_1_65;boost-1_64_0;boost_1_64_0;boost/boost-1_64_0;boost/boost_1_64_0;boost-1_64;boost_1_64;boost/boost-1_64;boost/boost_1_64;boost-1_63_0;boost_1_63_0;boost/boost-1_63_0;boost/boost_1_63_0;boost-1_63;boost_1_63;boost/boost-1_63;boost/boost_1_63;boost-1_62_0;boost_1_62_0;boost/boost-1_62_0;boost/boost_1_62_0;boost-1_62;boost_1_62;boost/boost-1_62;boost/boost_1_62;boost-1_61_0;boost_1_61_0;boost/boost-1_61_0;boost/boost_1_61_0;boost-1_61;boost_1_61;boost/boost-1_61;boost/boost_1_61;boost-1_60_0;boost_1_60_0;boost/boost-1_60_0;boost/boost_1_60_0;boost-1_60;boost_1_60;boost/boost-1_60;boost/boost_1_60;boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1366 ] location of version.hpp: /scratch/.linuxbrew/include/boost/version.hpp
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1391 ] version.hpp reveals boost 1.69.0
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1447 ] Boost_LIB_PREFIX =
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1449 ] Boost_NAMESPACE = boost
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1474 ] using user-specified Boost_COMPILER = -clang8
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1494 ] _boost_MULTITHREADED = -mt
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1548 ] using user-specified Boost_ARCHITECTURE = -x64
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1578 ] _boost_RELEASE_ABI_TAG = -
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1580 ] _boost_DEBUG_ABI_TAG = -d
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1643 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1837 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE: boost_unit_test_framework-clang8-mt-x64-1_69;boost_unit_test_framework-clang8-mt-x64;boost_unit_test_framework-clang8-mt;boost_unit_test_framework-mt-x64-1_69;boost_unit_test_framework-mt-x64;boost_unit_test_framework-mt;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:405 ] Boost_LIBRARY_DIR_RELEASE = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1894 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG: boost_unit_test_framework-clang8-mt-d-x64-1_69;boost_unit_test_framework-clang8-mt-d-x64;boost_unit_test_framework-clang8-mt-d;boost_unit_test_framework-mt-d-x64-1_69;boost_unit_test_framework-mt-d-x64;boost_unit_test_framework-mt-d;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:405 ] Boost_LIBRARY_DIR_DEBUG = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /scratch/.linuxbrew/Cellar/boost/1.69.0_clang/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /scratch/.linuxbrew/Cellar/cmake/3.14.2/share/cmake/Modules/FindBoost.cmake:1968 ] Boost_FOUND = 1
-- Boost version: 1.69.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /scratch/mycodes/cmakeBug/build_clang
where it finds the desired library.
I thought setting Boost_ROOT is enough but that's not the case.