CMake находит Boost, но не находит его компоненты. (CLion)

205
05 мая 2022, 22:50

Возникла проблема подключения Boost к CMake. При попытке найти Boost, все хорошо, но когда надо найти любой компонент, CMake фейлится. Ниже приведен код с CMakeLists.txt, где я пытаюсь найти компонент unit_test_framework в find_package.

cmake_minimum_required(VERSION 3.17)
set(CMAKE_CXX_STANDARD 20)
set(PROJECT
        Tests)
set(HEADERS)
set(SOURCES
        ../main.cpp)
project(${PROJECT})
set(Boost_USE_STATIC_LIBS OFF)
find_package(Boost 1.74.0 REQUIRED COMPONENTS unit_test_framework)
message(STATUS "Boost_INCLUDE_DIRS = " ${Boost_INCLUDE_DIRS})
message(STATUS "Boost_LIBRARY_DIRS = " ${Boost_LIBRARY_DIRS})
if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
    link_directories(${Boost_LIBRARY_DIRS})
    add_executable(${PROJECT} ${HEADERS} ${SOURCES})
    target_link_libraries(${PROJECT} ${Boost_LIBRARIES})
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

При этом CMake падает со следующей ошибкой:

"C:\Program Files\JetBrains\CLion 2020.2.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\Antl_M\Documents\GitHub\ForMe)\Asio\build
CMake Error at C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: unit_test_framework) (found suitable version
  "1.74.0", minimum required is "1.74.0")
Call Stack (most recent call first):
  C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:2180 (find_package_handle_standard_args)
  CMakeLists.txt:16 (find_package)

Когда же я убираю unit_test_framework, CMake завершается успешно со следующим сообщением:

"C:\Program Files\JetBrains\CLion 2020.2.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\Antl_M\Documents\GitHub\ForMe)\Asio\build
-- Boost_INCLUDE_DIRS = C:/boost/boost_1_74_0
-- Boost_LIBRARY_DIRS = C:/boost/boost_1_74_0/stage/lib
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/build/cmake-build-debug
[Finished]

Но теперь во время сборки линкер не может найти динамические библиотеки Boost:

c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: DWARF error: could not find variable specification at offset 32c52
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: DWARF error: could not find variable specification at offset 30b58
CMakeFiles\Tests.dir/objects.a(main.cpp.obj):C:/boost/boost_1_74_0/boost/test/unit_test.hpp:64: undefined reference to `__imp__ZN5boost9unit_test14unit_test_mainEPFbvEiPPc'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj):C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `first_test_invoker':
C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj):C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:8: more undefined references to `__imp__ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEyS4_' follow
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj):C:/boost/boost_1_74_0/boost/test/unit_test_log.hpp:227: undefined reference to `__imp__ZN5boost9unit_test15unit_test_log_t8instanceEv'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `__static_initialization_and_destruction_0':
C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:5: undefined reference to `__imp__ZN5boost9unit_test9decorator11collector_t8instanceEv'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:5: undefined reference to `__imp__ZN5boost9unit_test9ut_detail24auto_test_unit_registrarC1ENS0_13basic_cstringIKcEES5_yRNS0_9decorator11collector_tE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test9decorator11collector_t8instanceEv'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:7: undefined reference to `__imp__ZN5boost9unit_test9ut_detail24auto_test_unit_registrarC1EPNS0_9test_caseERNS0_9decorator11collector_tEm'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/main.cpp:11: undefined reference to `__imp__ZN5boost9unit_test9ut_detail24auto_test_unit_registrarC1Ei'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `boost::unit_test::lazy_ostream::~lazy_ostream()':
C:/boost/boost_1_74_0/boost/test/utils/lazy_ostream.hpp:33: undefined reference to `__imp__ZTVN5boost9unit_test12lazy_ostreamE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `boost::unit_test::lazy_ostream::~lazy_ostream()':
C:/boost/boost_1_74_0/boost/test/utils/lazy_ostream.hpp:33: undefined reference to `__imp__ZTVN5boost9unit_test12lazy_ostreamE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `boost::unit_test::lazy_ostream::instance()':
C:/boost/boost_1_74_0/boost/test/utils/lazy_ostream.hpp:35: undefined reference to `__imp__ZN5boost9unit_test12lazy_ostream4instE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `boost::unit_test::lazy_ostream::lazy_ostream(bool)':
C:/boost/boost_1_74_0/boost/test/utils/lazy_ostream.hpp:53: undefined reference to `__imp__ZTVN5boost9unit_test12lazy_ostreamE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long long)':
C:/boost/boost_1_74_0/boost/test/tree/test_unit.hpp:265: undefined reference to `__imp__ZN5boost9unit_test9ut_detail24normalize_test_case_nameB5cxx11ENS0_13basic_cstringIKcEE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/boost/boost_1_74_0/boost/test/tree/test_unit.hpp:265: undefined reference to `__imp__ZN5boost9unit_test9test_caseC1ENS0_13basic_cstringIKcEES4_yRKNS_8functionIFvvEEE'
c:/gcc10.2/gcc10.2_mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\Tests.dir/objects.a(main.cpp.obj): in function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, int, int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, int const&, char const*, int const&, char const*)':
C:/boost/boost_1_74_0/boost/test/tools/old/impl.hpp:92: undefined reference to `__imp__ZN5boost10test_tools9tt_detail16report_assertionERKNS0_16assertion_resultERKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEyNS1_10tool_levelENS1_10check_typeEyz'
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [CMakeFiles\Tests.dir\build.make:106: Tests.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:95: CMakeFiles/Tests.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:102: CMakeFiles/Tests.dir/rule] Error 2
mingw32-make: *** [makefile:137: Tests] Error 2

На всякий случай приведу код моей примитивной программы:

#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include "boost/test/unit_test.hpp"
BOOST_AUTO_TEST_SUITE(FirstTest);
BOOST_AUTO_TEST_CASE(first_test) {
  BOOST_CHECK_EQUAL(1 + 3, 2 + 2);
}
BOOST_AUTO_TEST_SUITE_END();

Надеюсь, мне сможет кто-то помочь и я смогу подключить Boost)

UPD:

После того, как выставить set(Boost_DEBUG ON) в смейк файле, на выходе получаю следующее сообщение:

-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1501 ] _boost_TEST_VERSIONS = "1.74.0;1.74"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1502 ] Boost_USE_MULTITHREADED = "TRUE"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1503 ] Boost_USE_STATIC_LIBS = "OFF"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1504 ] Boost_USE_STATIC_RUNTIME = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1505 ] Boost_ADDITIONAL_VERSIONS = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1506 ] Boost_NO_SYSTEM_PATHS = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1538 ] BOOST_ROOT = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1539 ] ENV{BOOST_ROOT} = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1540 ] BOOST_INCLUDEDIR = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1541 ] ENV{BOOST_INCLUDEDIR} = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1542 ] BOOST_LIBRARYDIR = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1543 ] ENV{BOOST_LIBRARYDIR} = <unset>
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1631 ] location of version.hpp: C:/boost/boost_1_74_0/boost/version.hpp
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1671 ] Boost_VERSION = "1.74.0"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1672 ] Boost_VERSION_STRING = "1.74.0"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1673 ] Boost_VERSION_MACRO = "107400"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1674 ] Boost_VERSION_MAJOR = "1"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1675 ] Boost_VERSION_MINOR = "74"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1676 ] Boost_VERSION_PATCH = "0"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1677 ] Boost_VERSION_COUNT = "3"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1694 ] Boost_LIB_PREFIX = ""
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1695 ] Boost_NAMESPACE = "boost"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:797 ] _boost_COMPILER = "-mgw10" (guessed)
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1731 ] _boost_MULTITHREADED = "-mt"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1808 ] _boost_ARCHITECTURE_TAG = "" (detected)
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1812 ] _boost_RELEASE_ABI_TAG = "-"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1813 ] _boost_DEBUG_ABI_TAG = "-d"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1873 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = "C:/boost/boost_1_74_0/lib;C:/boost/boost_1_74_0/../lib;C:/boost/boost_1_74_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:1874 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = "C:/boost/boost_1_74_0/lib;C:/boost/boost_1_74_0/../lib;C:/boost/boost_1_74_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:2059 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE: boost_unit_test_framework-mgw10-mt-1_74;boost_unit_test_framework-mgw10-mt;boost_unit_test_framework-mgw10-mt;boost_unit_test_framework-mt-1_74;boost_unit_test_framework-mt;boost_unit_test_framework-mt;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:2114 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG: boost_unit_test_framework-mgw10-mt-d-1_74;boost_unit_test_framework-mgw10-mt-d;boost_unit_test_framework-mgw10-mt-d;boost_unit_test_framework-mt-d-1_74;boost_unit_test_framework-mt-d;boost_unit_test_framework-mt-d;boost_unit_test_framework-mt;boost_unit_test_framework
CMake Error at C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: unit_test_framework) (found suitable version
  "1.74.0", minimum required is "1.74.0")
Call Stack (most recent call first):
  C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindBoost.cmake:2180 (find_package_handle_standard_args)
  CMakeLists.txt:17 (find_package)

-- Configuring incomplete, errors occurred!
See also "C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/build/cmake-build-debug/CMakeFiles/CMakeOutput.log".

Мне кажется, смейк пытается найти какую-то не такую по названию папку или файл, но не могу понять какую именно, поэтому вот иерархия файлов в C:/boost/boost_1_74_0:

  • C:/boost/boost_1_74_0:
    • boost/test:
      • unit_test.hpp (и прочие файлы)
    • stage/lib:
      • libboost_unit_test_framework-mgw10-mt-d-x32-1_74.a
      • libboost_unit_test_framework-mgw10-mt-d-x64-1_74.a
      • libboost_unit_test_framework-mgw10-mt-d-x64-1_74.dll
      • libboost_unit_test_framework-mgw10-mt-d-x64-1_74.dll.a
      • libboost_unit_test_framework-mgw10-mt-sd-x32-1_74.a
      • libboost_unit_test_framework-mgw10-mt-sd-x64-1_74.a
      • libboost_unit_test_framework-mgw10-mt-s-x32-1_74.a
      • libboost_unit_test_framework-mgw10-mt-s-x64-1_74.a
      • libboost_unit_test_framework-mgw10-mt-x32-1_74.a
      • libboost_unit_test_framework-mgw10-mt-x64-1_74.a
      • libboost_unit_test_framework-mgw10-mt-x64-1_74.dll
      • libboost_unit_test_framework-mgw10-mt-x64-1_74.dll.a
      • cmake:
        • BoostDetectToolset-1.74.0.cmake
        • boost_unit_test_framework-1.74.0:
          • boost_unit_test_framework-config.cmake
          • boost_unit_test_framework-config-version.cmake
          • libboost_unit_test_framework-variant-mgw10-mt-d-x64-1_74-shared.cmake (и прочие скрипты с другими комбинациями архитектур и версий)
Answer 1

Вопрос решился пересборкой буста в дефолтную директорию. Тепер мой CMakeLists.txt выглядит вот так:

cmake_minimum_required(VERSION 3.17)
set(CMAKE_CXX_STANDARD 20)
set(PROJECT
        Tests)
set(HEADERS)
set(SOURCES
        ../main.cpp)
project(${PROJECT})
find_package(Boost REQUIRED COMPONENTS system regex date_time)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(${PROJECT} ${SOURCES} ${HEADERS})
message(STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}")
target_link_libraries(${PROJECT} ${Boost_LIBRARIES} ws2_32)

И все работает!!!

"C:\Program Files\JetBrains\CLion 2020.2.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MODULE_PATH=C:/boost/boost_1_74_0/stage/lib/cmake -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -G "CodeBlocks - MinGW Makefiles" C:\Users\Antl_M\Documents\GitHub\ForMe)\Asio\build
-- Boost_LIBRARIES = optimized;C:/boost/boost_1_74_0/stage/lib/libboost_system-mgw10-mt-x64-1_74.dll.a;debug;C:/boost/boost_1_74_0/stage/lib/libboost_system-mgw10-mt-d-x64-1_74.dll.a;optimized;C:/boost/boost_1_74_0/stage/lib/libboost_regex-mgw10-mt-x64-1_74.dll.a;debug;C:/boost/boost_1_74_0/stage/lib/libboost_regex-mgw10-mt-d-x64-1_74.dll.a;optimized;C:/boost/boost_1_74_0/stage/lib/libboost_date_time-mgw10-mt-x64-1_74.dll.a;debug;C:/boost/boost_1_74_0/stage/lib/libboost_date_time-mgw10-mt-d-x64-1_74.dll.a
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Antl_M/Documents/GitHub/ForMe)/Asio/build/cmake-build-debug
[Finished]
READ ALSO
Как очистить буфер ввода C++? [дубликат]

Как очистить буфер ввода C++? [дубликат]

Есть вот такой недописанный кодПосле ввода количества member enter остается во входной очереди и не получается ввести name класса string с помощью...

258
Как реализовать цикл нахождения простых чисел?

Как реализовать цикл нахождения простых чисел?

Даны N положительных целых чисел, которые не делятся ни на какие простые числа, кроме 2 и 3Удалить из массива числа так, чтобы из любых двух...

270
Сортировка строк с файла на С++

Сортировка строк с файла на С++

Есть файл в котором больше 3к строк, и нужно их отсортировать по количеству символовМой код:

239
Подсчёт количества цифр 1 в числе [закрыт]

Подсчёт количества цифр 1 в числе [закрыт]

Хотите улучшить этот вопрос? Обновите вопрос так, чтобы он вписывался в тематику Stack Overflow на русском

244