0

再次..

第一的:

Plattform: Windows
Cmake: 3.20 (Clion Bundled)
Kit: Mingw64 (msys2-Mingw64)
Boost Version: 1.69 - 1.77 (from boost.org)

以下情况:

我想通过 Cmake find_package boost。因此,我下载了 boost zip,解压缩并设置了 BOOST_ROOT。这是我当前的 CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(Tester LANGUAGES CXX)
set(TEST_PROJECT ${PROJECT_NAME})

project(Runtime LANGUAGES CXX)
set(RUNTIME_PROJECT ${PROJECT_NAME})

project(Game_Lib LANGUAGES CXX)
set(LIB_PROJECT ${PROJECT_NAME})

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

SET(CMAKE_BUILD_TYPE Debug)

#=============================================================== Fetch GoogleTest
include(FetchContent)
FetchContent_Declare(
        googletest
        URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip
)
# For Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

#=============================================================== Setup Paths
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(PROJ_INC ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(PROJ_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/libs ${CMAKE_CURRENT_SOURCE_DIR})
set(PROJ_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/tests)
set(PROJ_TST ${CMAKE_CURRENT_SOURCE_DIR}/test)
set(PROJ_SHADES ${CMAKE_CURRENT_SOURCE_DIR}/../TileGameStudio_Editor_Build_Debug/Shipped/Data/InitProj/shaders)

set(ANGLE_INCLUDE_PATH "D:/angle/include")
set(ANGLE_LIBRARY_PATH ${PROJ_LIBS})

include(FindPkgConfig)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
pkg_check_modules(SDL2_TTF REQUIRED SDL2_ttf)
pkg_check_modules(SDL2_MIXER REQUIRED SDL2_mixer)
find_package(Freetype REQUIRED)
find_package(LuaJIT REQUIRED)
find_package(FLAC REQUIRED)
find_package(OGG REQUIRED)
find_package(THEORA REQUIRED)
find_package(OpenSSL REQUIRED)
set(Boost_DEBUG ON)
set(BOOST_ROOT "D:/boost")
find_package(Boost REQUIRED COMPONENTS filesystem)

#=============================================================== OUTPUT <LIB>_FOUND
if (NOT PKG_CONFIG_FOUND)
    message(STATUS "PKG-CONFIG:   NO")
else ()
    message(STATUS "PKG-CONFIG:   YES - under: ${PKG_CONFIG_EXECUTABLE} >> used to find packages")
endif ()

if (NOT SDL2_FOUND)
    message(STATUS "SDL2:   NO")
else ()
    message(STATUS "SDL2:   YES - under: ${SDL2_INCLUDE_DIRS} >> included and linked")
    include_directories(
            ${SDL2_INCLUDE_DIRS}
            ${SDL2_IMAGE_INCLUDE_DIRS}
            ${SDL2_TTF_INCLUDE_DIRS}
            ${SDL2_MIXER_INCLUDE_DIRS})
    link_directories(
            ${SDL2_INCLUDE_DIRS}
            ${SDL2_IMAGE_INCLUDE_DIRS}
            ${SDL2_TTF_INCLUDE_DIRS}
            ${SDL2_MIXER_INCLUDE_DIRS}
            ${SDL2_LIBRARY_DIRS}
            ${SDL2_IMAGE_LIBRARY_DIRS}
            ${SDL2_TTF_LIBRARY_DIRS}
            ${SDL2_MIXER_LIBRARY_DIRS})
endif ()

if (NOT FREETYPE_FOUND)
    message(STATUS "freetype2:   NO")
else ()
    message(STATUS "freetype2:   YES - under: ${FREETYPE_INCLUDE_DIR_ft2build} >> included and linked")
    include_directories(${FREETYPE_INCLUDE_DIR_ft2build})
    link_directories(${FREETYPE_INCLUDE_DIR_ft2build})
endif ()

if (NOT LUAJIT_FOUND)
    message(STATUS "LuaJit:   NO")
else ()
    message(STATUS "LuaJit:   YES - under: ${LUA_INCLUDE_DIR} >> included and linked")
    include_directories(${LUA_INCLUDE_DIR})
    link_directories(${LUA_INCLUDE_DIR})
endif ()

if (NOT FLAC_FOUND)
    message(STATUS "FLAC:   NO")
else ()
    message(STATUS "FLAC:   YES - under: ${FLAC_INCLUDE_DIR} >> included and linked")
    include_directories(${FLAC_INCLUDE_DIR})
    link_directories(${FLAC_INCLUDE_DIR})
endif ()

if (NOT OGG_FOUND)
    message(STATUS "OGG:   NO")
else ()
    message(STATUS "OGG:   YES - under: ${OGG_INCLUDE_DIR} >> included and linked")
    include_directories(${OGG_INCLUDE_DIR})
    link_directories(${OGG_INCLUDE_DIR})
endif ()

if (NOT THEORA_FOUND)
    message(STATUS "THEORA:   NO")
else ()
    message(STATUS "THEORA:   YES - under: ${THEORA_INCLUDE_DIR} >> included and linked")
    include_directories(${THEORA_INCLUDE_DIR})
    link_directories(${THEORA_INCLUDE_DIR})
endif ()

if (NOT OPENSSL_FOUND)
    message(STATUS "OpenSSL:   NO")
else ()
    message(STATUS "OpenSSL:   YES - under: ${OPENSSL_INCLUDE_DIR} >> included and linked")
    include_directories(${OPENSSL_INCLUDE_DIR})
    link_directories(${OPENSSL_INCLUDE_DIR})
endif ()

if (NOT BOOST_FOUND)
    message(STATUS "Boost:   NO")
else ()
    message(STATUS "Boost:   YES - under: ${Boost_INCLUDE_DIR} >> included and linked")
    include_directories(${Boost_INCLUDE_DIR} ${Boost_LIBRARY_DIR})
    link_directories(${Boost_INCLUDE_DIR} ${Boost_LIBRARY_DIR})
endif ()

#=============================================================== Include Directories
include_directories(
        ${PROJ_INC}
        ${PROJ_SRC}
        ${PROJ_LIBS}
        ${PROJ_SHADES}
        ${ANGLE_INCLUDE_PATH}
        ${ANGLE_LIBRARY_PATH}
        gtest/
)

link_directories(
        ${PROJ_INC}
        ${PROJ_SRC}
        ${PROJ_LIBS}
        ${PROJ_SHADES}
        ${ANGLE_INCLUDE_PATH}
        ${ANGLE_LIBRARY_PATH}
        gtest/
)

#=============================================================== Find GLES Libraries
message("Looking for GLES Libraries")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" ".dll.lib")
find_library(D3D_Lib NAMES d3dcompiler_47 PATHS ${PROJ_LIBS} REQUIRED)
find_library(GLES2_Lib NAMES libGLESv2 PATHS ${PROJ_LIBS} REQUIRED)
message("Done: Looking for GLES Libraries")

#=============================================================== Find GTest and GMock Libraries
#find_library(GTEST_LIBRARIES NAMES libgtest_main libgtest libgmock libgmock_main REQUIRED)

#=============================================================== Collect Sources, Tests and Headers
file(GLOB PROJECT_SOURCES CONFIGURE_DEPENDS
        ${PROJ_SRC}/*.cpp
        )

file(GLOB PROJECT_TESTS CONFIGURE_DEPENDS
        ${PROJ_TST}/*.cpp
        )

file(GLOB PROJECT_HEADERS CONFIGURE_DEPENDS
        ${PROJ_INC}/*.h
        )

file(GLOB PROJECT_SHADERS CONFIGURE_DEPENDS
        ${PROJ_SHADES}/*.glsl
        )

#=============================================================== Create STATIC Lib of Engine Sources
if (NOT PROJECT_SOURCES)
    message("No Sources available to build static Library!")
else ()
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../TileGameStudio_Editor_Build_Debug/Shipped/Data/InitProj/Libs")
    add_library(${LIB_PROJECT} STATIC ${PROJECT_HEADERS} ${PROJECT_SOURCES})
    set_target_properties(${LIB_PROJECT} PROPERTIES OUTPUT_NAME "GameLib")
    message("Added Sources to the Library and created it in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}!")
endif ()

#=============================================================== Build App
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../TileGameStudio_Editor_Build_Debug/Shipped/Data/InitProj")
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/res.rc")
add_executable(${RUNTIME_PROJECT}
        ${PROJECT_SOURCES}
        ${PROJECT_HEADERS}
        ${PROJECT_SHADERS}
        ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/res.rc
        )

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../TileGameStudio_Editor_Build_Debug/Shipped/Data/InitProj/Tests")
add_executable(${TEST_PROJECT}
        ${PROJECT_SOURCES}
        ${PROJECT_HEADERS}
        ${PROJECT_SHADERS}
        ${PROJECT_TESTS}
        )

#=============================================================== Set Building Target
set_target_properties(${RUNTIME_PROJECT} PROPERTIES OUTPUT_NAME "Game" SUFFIX ".exe")
set_target_properties(${TEST_PROJECT} PROPERTIES OUTPUT_NAME "Tests" SUFFIX ".exe")
#=============================================================== Link Libraries
target_link_libraries(${RUNTIME_PROJECT}
        ${SDL2_LIBRARIES}
        ${SDL2_IMAGE_LIBRARIES}
        ${SDL2_TTF_LIBRARIES}
        ${SDL2_MIXER_LIBRARIES}
        ${FREETYPE_LIBRARIES}
        ${LUA_LIBRARY}
        ${GLES2_Lib}
        ${D3D_Lib}
        ${FLAC_LIBRARY}
        ${OGG_LIBRARY}
        ${THEORA_LIBRARY}
        ${OPENSSL_CRYPTO_LIBRARY}
        ${OPENSSL_SSL_LIBRARY}
        ${OPENSSL_LIBRARIES}
        ${Boost_LIBRARIES}
        )

target_link_libraries(${TEST_PROJECT}
        ${SDL2_LIBRARIES}
        ${SDL2_IMAGE_LIBRARIES}
        ${SDL2_TTF_LIBRARIES}
        ${SDL2_MIXER_LIBRARIES}
        ${FREETYPE_LIBRARIES}
        ${LUA_LIBRARY}
        ${GLES2_Lib}
        ${D3D_Lib}
        ${FLAC_LIBRARY}
        ${OGG_LIBRARY}
        ${THEORA_LIBRARY}
        ${OPENSSL_CRYPTO_LIBRARY}
        ${OPENSSL_SSL_LIBRARY}
        ${OPENSSL_LIBRARIES}
        ${Boost_LIBRARIES}
        gtest_main
        )
enable_testing()
include(GoogleTest)

#=============================================================== Add GoogleTests
message("")
message("Adding Tests to ${TEST_PROJECT}")
message("")
if (NOT PROJECT_TESTS)
    message("No Tests available!")
else ()
    gtest_add_tests(TARGET ${TEST_PROJECT} TEST_LIST var)
    message("Tests were added to ${TEST_PROJECT}. The List:")
    foreach (X ${var})
        message("-  ${X}")
    endforeach ()
endif ()
message("")

这导致了这个 Outlog:

-- Found Ogg: C:/msys64/mingw64/lib/libogg.dll.a
-- Found Ogg: C:/msys64/mingw64/lib/libogg.dll.a
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1673 ] _boost_TEST_VERSIONS = "1.77.0;1.77;1.76.0;1.76;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"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1674 ] Boost_USE_MULTITHREADED = "TRUE"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1675 ] Boost_USE_STATIC_LIBS = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1676 ] Boost_USE_STATIC_RUNTIME = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1677 ] Boost_ADDITIONAL_VERSIONS = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1678 ] Boost_NO_SYSTEM_PATHS = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1710 ] BOOST_ROOT = "D:/boost"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1711 ] ENV{BOOST_ROOT} = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1712 ] BOOST_INCLUDEDIR = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1713 ] ENV{BOOST_INCLUDEDIR} = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1714 ] BOOST_LIBRARYDIR = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1715 ] ENV{BOOST_LIBRARYDIR} = <unset>
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1787 ] _boost_INCLUDE_SEARCH_DIRS = "D:/boost/include;D:/boost;PATHS;C:/boost/include;C:/boost;/sw/local/include"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1788 ] _boost_PATH_SUFFIXES = "boost-1_77_0;boost_1_77_0;boost/boost-1_77_0;boost/boost_1_77_0;boost-1_77;boost_1_77;boost/boost-1_77;boost/boost_1_77;boost-1_76_0;boost_1_76_0;boost/boost-1_76_0;boost/boost_1_76_0;boost-1_76;boost_1_76;boost/boost-1_76;boost/boost_1_76;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;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"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1803 ] location of version.hpp: D:/boost/boost/version.hpp
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1843 ] Boost_VERSION = "106900"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1844 ] Boost_VERSION_STRING = "1.69.0"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1845 ] Boost_VERSION_MACRO = "106900"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1846 ] Boost_VERSION_MAJOR = "1"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1847 ] Boost_VERSION_MINOR = "69"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1848 ] Boost_VERSION_PATCH = "0"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1849 ] Boost_VERSION_COUNT = "3"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1873 ] Boost_LIB_PREFIX = ""
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1874 ] Boost_NAMESPACE = "boost"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:953 ] _boost_COMPILER = "-mgw112" (guessed)
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1910 ] _boost_MULTITHREADED = "-mt"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1988 ] _boost_ARCHITECTURE_TAG = "" (detected)
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1992 ] _boost_RELEASE_ABI_TAG = "-"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:1993 ] _boost_DEBUG_ABI_TAG = "-d"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:2053 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = "D:/boost/lib;D:/boost/stage/lib;D:/boost/lib;D:/boost/../lib;D:/boost/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:2054 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = "D:/boost/lib;D:/boost/stage/lib;D:/boost/lib;D:/boost/../lib;D:/boost/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:2239 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-mgw112-mt-1_69;boost_filesystem-mgw112-mt;boost_filesystem-mgw112-mt;boost_filesystem-mt-1_69;boost_filesystem-mt;boost_filesystem-mt;boost_filesystem-mt;boost_filesystem
-- [ D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:2294 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-mgw112-mt-d-1_69;boost_filesystem-mgw112-mt-d;boost_filesystem-mgw112-mt-d;boost_filesystem-mt-d-1_69;boost_filesystem-mt-d;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
CMake Error at D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: filesystem) (found version "1.69.0")
Call Stack (most recent call first):
  D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  D:/CLion/bin/cmake/win/share/cmake-3.20/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
  CMakeLists.txt:53 (find_package)


-- Configuring incomplete, errors occurred!

是的,我..

我现在在网上搜索了 3 天,并偶然发现了不同的方法来解决这个问题。

从构建库,到安装东西..做东西和其他东西..等等..我真的不知道我在那里做了什么,因为对于我作为爱好的我来说,手册和修复比逻辑更神秘程序员...

我将 FindBoost.cmake 更改为更新的,支持 Boost 1.77 .. 尝试设置 Hinbt 路径,如 BOOST_INCLUDEDIR 和 BOOST_LIBRARYDIR .. 没有任何改变..

我尝试了 Boost 版本:1.77.0、1.76.0、1.69.0(当前)

所以..我不知道我还能做些什么,才能将提升链接到我的项目......

我希望有人可以在这里帮助我..

编辑:Sry Guys..但是..我对这个东西真的很陌生...

我使用 gcc 作为参数引导 boost 并在 boost 目录中调用 b2 ..

现在我有一个 bin.v2 + 收到消息:

The following directory should be added to compiler include paths:
    D:\boost
The following directory should be added to linker library paths:
    D:\boost\stage\lib

完成:

set(BOOST_ROOT "D:/boost")
set(BOOST_INCLUDEDIR "D:/boost")
set(BOOST_LIBRARYDIR "D:/boost/stage/lib")

在 find_package 之前

还是得到

Could NOT find Boost (missing: filesystem) (found version "1.77.0")

:(

4

0 回答 0