title: CMake can't find Boost::thread on Windows 10
body: <p>I'm trying to build windows package of my Qt project.
  The following is part of my <code>CMakeList.txt</code> file.</p>
  <pre class="lang-sh prettyprint-override"><code>set (Boost_USE_STATIC_LIBS ON)
  set (Boost_DEBUG ON)
  set (BOOST_ROOT &quot;C:\\Dev\\boost\\boost_1_78_0&quot;)
  
  FIND_PACKAGE(Boost 1.70 REQUIRED)
  FIND_PACKAGE(Boost REQUIRED COMPONENTS thread)
  target_link_libraries(myAppName Boost::thread)
  </code></pre>
  <p>The output after I enter <code>cmake ..</code> in the <code>myAppName\build</code> is</p>
  <pre><code>-- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1657 ] _boost_TEST_VERSIONS = &quot;1.75.0;1.75;1.74.0;1.74;1.73.0;1.73;1.72.0;1.72;1.71.0;1.71;1.70.0;1.70&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1658 ] Boost_USE_MULTITHREADED = &quot;TRUE&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1659 ] Boost_USE_STATIC_LIBS = &quot;ON&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1660 ] Boost_USE_STATIC_RUNTIME = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1661 ] Boost_ADDITIONAL_VERSIONS = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1662 ] Boost_NO_SYSTEM_PATHS = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1694 ] BOOST_ROOT = &quot;C:\Dev\boost\boost_1_78_0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1695 ] ENV{BOOST_ROOT} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1696 ] BOOST_INCLUDEDIR = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1697 ] ENV{BOOST_INCLUDEDIR} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1698 ] BOOST_LIBRARYDIR = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1699 ] ENV{BOOST_LIBRARYDIR} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1771 ] _boost_INCLUDE_SEARCH_DIRS = &quot;C:\Dev\boost\boost_1_78_0/include;C:\Dev\boost\boost_1_78_0;PATHS;C:/boost/include;C:/boost;/sw/local/include&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1772 ] _boost_PATH_SUFFIXES = &quot;boost-1_75_0;boost_1_75_0;boost/boost-1_75_0;boost/boost_1_75_0;boost-1_75;boost_1_75;boost/boost-1_75;boost/boost_1_75;boost-1_74_0;boost_1_74_0;boost/boost-1_74_0;boost/boost_1_74_0;boost-1_74;boost_1_74;boost/boost-1_74;boost/boost_1_74;boost-1_73_0;boost_1_73_0;boost/boost-1_73_0;boost/boost_1_73_0;boost-1_73;boost_1_73;boost/boost-1_73;boost/boost_1_73;boost-1_72_0;boost_1_72_0;boost/boost-1_72_0;boost/boost_1_72_0;boost-1_72;boost_1_72;boost/boost-1_72;boost/boost_1_72;boost-1_71_0;boost_1_71_0;boost/boost-1_71_0;boost/boost_1_71_0;boost-1_71;boost_1_71;boost/boost-1_71;boost/boost_1_71;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&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1787 ] location of version.hpp: C:/Dev/boost/boost_1_78_0/boost/version.hpp
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1827 ] Boost_VERSION = &quot;107800&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1828 ] Boost_VERSION_STRING = &quot;1.78.0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1829 ] Boost_VERSION_MACRO = &quot;107800&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1830 ] Boost_VERSION_MAJOR = &quot;1&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1831 ] Boost_VERSION_MINOR = &quot;78&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1832 ] Boost_VERSION_PATCH = &quot;0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1833 ] Boost_VERSION_COUNT = &quot;3&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1857 ] Boost_LIB_PREFIX = &quot;&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1858 ] Boost_NAMESPACE = &quot;boost&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:953 ] _boost_COMPILER = &quot;-gcc11&quot; (guessed)
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1894 ] _boost_MULTITHREADED = &quot;-mt&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1972 ] _boost_ARCHITECTURE_TAG = &quot;&quot; (detected)
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1976 ] _boost_RELEASE_ABI_TAG = &quot;-&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1977 ] _boost_DEBUG_ABI_TAG = &quot;-d&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2037 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = &quot;C:\Dev\boost\boost_1_78_0/lib;C:\Dev\boost\boost_1_78_0/stage/lib;C:/Dev/boost/boost_1_78_0/lib;C:/Dev/boost/boost_1_78_0/../lib;C:/Dev/boost/boost_1_78_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2038 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = &quot;C:\Dev\boost\boost_1_78_0/lib;C:\Dev\boost\boost_1_78_0/stage/lib;C:/Dev/boost/boost_1_78_0/lib;C:/Dev/boost/boost_1_78_0/../lib;C:/Dev/boost/boost_1_78_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib&quot;
  -- Found Boost: C:/Dev/boost/boost_1_78_0 (found suitable version &quot;1.78.0&quot;, minimum required is &quot;1.70&quot;)
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1657 ] _boost_TEST_VERSIONS = &quot;1.75.0;1.75;1.74.0;1.74;1.73.0;1.73;1.72.0;1.72;1.71.0;1.71;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&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1658 ] Boost_USE_MULTITHREADED = &quot;TRUE&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1659 ] Boost_USE_STATIC_LIBS = &quot;ON&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1660 ] Boost_USE_STATIC_RUNTIME = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1661 ] Boost_ADDITIONAL_VERSIONS = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1662 ] Boost_NO_SYSTEM_PATHS = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1694 ] BOOST_ROOT = &quot;C:\Dev\boost\boost_1_78_0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1695 ] ENV{BOOST_ROOT} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1696 ] BOOST_INCLUDEDIR = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1697 ] ENV{BOOST_INCLUDEDIR} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1698 ] BOOST_LIBRARYDIR = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1699 ] ENV{BOOST_LIBRARYDIR} = &lt;unset&gt;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1787 ] location of version.hpp: C:/Dev/boost/boost_1_78_0/boost/version.hpp
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1827 ] Boost_VERSION = &quot;107800&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1828 ] Boost_VERSION_STRING = &quot;1.78.0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1829 ] Boost_VERSION_MACRO = &quot;107800&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1830 ] Boost_VERSION_MAJOR = &quot;1&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1831 ] Boost_VERSION_MINOR = &quot;78&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1832 ] Boost_VERSION_PATCH = &quot;0&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1833 ] Boost_VERSION_COUNT = &quot;3&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1857 ] Boost_LIB_PREFIX = &quot;&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1858 ] Boost_NAMESPACE = &quot;boost&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:953 ] _boost_COMPILER = &quot;-gcc11&quot; (guessed)
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1894 ] _boost_MULTITHREADED = &quot;-mt&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1972 ] _boost_ARCHITECTURE_TAG = &quot;&quot; (detected)
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1976 ] _boost_RELEASE_ABI_TAG = &quot;-&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1977 ] _boost_DEBUG_ABI_TAG = &quot;-d&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2037 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = &quot;C:\Dev\boost\boost_1_78_0/lib;C:\Dev\boost\boost_1_78_0/stage/lib;C:/Dev/boost/boost_1_78_0/lib;C:/Dev/boost/boost_1_78_0/../lib;C:/Dev/boost/boost_1_78_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib&quot;
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2038 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = &quot;C:\Dev\boost\boost_1_78_0/lib;C:\Dev\boost\boost_1_78_0/stage/lib;C:/Dev/boost/boost_1_78_0/lib;C:/Dev/boost/boost_1_78_0/../lib;C:/Dev/boost/boost_1_78_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib&quot;
  CMake Warning at /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1354 (message):
    New Boost version may have incorrect or missing dependencies and imported
    targets
  Call Stack (most recent call first):
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:51 (FIND_PACKAGE)
  
  
  CMake Warning at /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1354 (message):
    New Boost version may have incorrect or missing dependencies and imported
    targets
  Call Stack (most recent call first):
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:51 (FIND_PACKAGE)
  
  
  CMake Warning at /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1354 (message):
    New Boost version may have incorrect or missing dependencies and imported
    targets
  Call Stack (most recent call first):
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:51 (FIND_PACKAGE)
  
  
  CMake Warning at /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1354 (message):
    New Boost version may have incorrect or missing dependencies and imported
    targets
  Call Stack (most recent call first):
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:51 (FIND_PACKAGE)
  
  
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2223 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc11-mt-1_78;boost_thread-gcc11-mt;boost_thread-gcc11-mt;boost_thread-mt-1_78;boost_thread-mt;boost_thread-mt;boost_thread-mt;boost_thread
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2278 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc11-mt-d-1_78;boost_thread-gcc11-mt-d;boost_thread-gcc11-mt-d;boost_thread-mt-d-1_78;boost_thread-mt-d;boost_thread-mt-d;boost_thread-mt;boost_thread
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2223 ] Searching for CHRONO_LIBRARY_RELEASE: boost_chrono-gcc11-mt-1_78;boost_chrono-gcc11-mt;boost_chrono-gcc11-mt;boost_chrono-mt-1_78;boost_chrono-mt;boost_chrono-mt;boost_chrono-mt;boost_chrono
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2278 ] Searching for CHRONO_LIBRARY_DEBUG: boost_chrono-gcc11-mt-d-1_78;boost_chrono-gcc11-mt-d;boost_chrono-gcc11-mt-d;boost_chrono-mt-d-1_78;boost_chrono-mt-d;boost_chrono-mt-d;boost_chrono-mt;boost_chrono
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2223 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-gcc11-mt-1_78;boost_date_time-gcc11-mt;boost_date_time-gcc11-mt;boost_date_time-mt-1_78;boost_date_time-mt;boost_date_time-mt;boost_date_time-mt;boost_date_time
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2278 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-gcc11-mt-d-1_78;boost_date_time-gcc11-mt-d;boost_date_time-gcc11-mt-d;boost_date_time-mt-d-1_78;boost_date_time-mt-d;boost_date_time-mt-d;boost_date_time-mt;boost_date_time
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2223 ] Searching for ATOMIC_LIBRARY_RELEASE: boost_atomic-gcc11-mt-1_78;boost_atomic-gcc11-mt;boost_atomic-gcc11-mt;boost_atomic-mt-1_78;boost_atomic-mt;boost_atomic-mt;boost_atomic-mt;boost_atomic
  -- [ /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2278 ] Searching for ATOMIC_LIBRARY_DEBUG: boost_atomic-gcc11-mt-d-1_78;boost_atomic-gcc11-mt-d;boost_atomic-gcc11-mt-d;boost_atomic-mt-d-1_78;boost_atomic-mt-d;boost_atomic-mt-d;boost_atomic-mt;boost_atomic
  CMake Error at /usr/share/cmake-3.20.0/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find Boost (missing: thread) (found version &quot;1.78.0&quot;)
  Call Stack (most recent call first):
    /usr/share/cmake-3.20.0/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /usr/share/cmake-3.20.0/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
    CMakeLists.txt:51 (FIND_PACKAGE)
  </code></pre>
  <p>I've tried precompiled version and gcc11 locally compiled version, same output.</p>
  <p>I'm using gcc-11 now.</p>
  <p>Also tried 1.74.0, similar results except the <code>New Boost version may have incorrect or missing dependencies and imported targets</code> warnings.</p>
  <p>It seems that cmake didn't find <code>thread</code> which is the important package my project used.</p>
  <p>It costs me a lot of time to deal with this.</p>
  <p>Hoping that someone helps me solving this problem.</p>