title: Linking boost in CLion project
body: <p>I want to link my c++ project on CLion with Boost. In order to make everything way easier to port I'd prefer having all the libraries directly in the project files so I put the boost folder directly in my project files and then proceeded to edit the CMakeList.txt to link the library.
  I want to link my c++ project on CLion with Boost. In order to make everything way easier to port I'd prefer having all the libraries directly in the project files so I put the boost folder directly in my project files and then proceeded to edit the CMakeList.txt to link the library.</p>
  
  <pre><code>set(BOOST_NO_SYSTEM_PATHS ON)
  set(BOOST_ROOT ${PROJECT_SOURCE_DIR}/boost_1_71_0/)
  set(BOOST_INCLUDEDIR ${PROJECT_SOURCE_DIR}/boost_1_71_0/boost)
  find_package(Boost COMPONENTS system filesystem)
  /.../
  target_link_libraries(untitled ${Boost_LIBRARIES})
  </code></pre>
  
  <p>But CMake keeps tellming me that it "-- Could NOT find Boost (missing: system filesystem) (found version "1.71.0")". I tried to add 1.71.0 to the find_package but it won't change the fact that CMake tells me that it can't find Boost. The thing is that if my find_package line becomes this :</p>
  
  <pre><code>find_package(Boost COMPONENTS)
  </code></pre>
  
  <p>CMake says "Found Boost: C:/Users/kimer/CLionProjects/untitled/boost_1_71_0 (found suitable version "1.71.0", minimum required is "1.71.0")".
  I'm not sure what to think about this.</p>
  
  <p>I don't necessarily want to compile the library since most of the components are header only and don't require to be compiled. Furthermore I tried to compile Boost but it requires msvc, but the compiler i'm using is mingw w64 g++ and have not found any solutions about that either (I tried running the boost.build bootstrap.bat with the mingw parameter but it returns a cpp error and won't compile).</p>
  
  <p>What am I doing wrong to link the library?</p>
  
  <p>Edit : I have the exact same problem with header only libs such as chrono</p>
  
  <p>Edit 2 : Alright it seems that I have to compile Boost with my compiler which is Mingw x86_64-win32, but whenever i try to compile it I get this error :</p>
  
  <pre><code>.\bootstrap.bat gcc
  Bootstrapping the build engine
  sysinfo.cpp: In function 'unsigned int {anonymous}::std_thread_hardware_concurrency()':
  sysinfo.cpp:93:21: error: 'std::thread' has not been declared
           return std::thread::hardware_concurrency();
                       ^~~~~~
  Fichier introuvable
  
  Failed to bootstrap the build engine
  Please consult bootstrap.log for further diagnostics.
  </code></pre>
  
  <p>Edit 3 : I found out why it did not compile : I was using the w32 version of Mingw and not the POSIX one. The whole thing compiled fine with the POSIX version ; I now have the compiled boost library in a "boost" folder. I changed my CMakeLists.txt file :</p>
  
  <pre><code>set(Boost_DEBUG ON)
  set(BOOST_INCLUDEDIR ${PROJECT_SOURCE_DIR}/boost/include/boost-1_71/)
  set(BOOST_LIBRARYDIR ${PROJECT_SOURCE_DIR}/boost/lib)
  set(BOOST_NO_SYSTEM_PATHS ON)
  find_package(Boost COMPONENTS system)
  </code></pre>
  
  <p>The boost library searches in the right directories as the debug tells me. It is also searching for files with names like these :</p>
  
  <pre><code>-- [ D:/Dev/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-mgw81-mt-1_71;boost_system-mgw81-mt;boost_system-mgw81-mt;boost_system-mt-1_71;boost_system-mt;boost_system-mt;boost_system-mt;boost_system
  -- [ D:/Dev/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-mgw81-mt-d-1_71;boost_system-mgw81-mt-d;boost_system-mgw81-mt-d;boost_system-mt-d-1_71;boost_system-mt-d;boost_system-mt-d;boost_system-mt;boost_system
  </code></pre>
  
  <p>while my compiled boost library produced these A files :</p>
  
  <pre><code>libboost_system-mgw81-mt-d-x64-1_71.a
  libboost_system-mgw81-mt-x64-1_71.a
  </code></pre>
  
  <p>That might be the issue but how can i solve it ?</p>