diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-18 12:42:31 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-18 22:37:18 +0200 |
commit | 284e782917a43a9b3b861034e29470c4340b6343 (patch) | |
tree | fefee9a27f11bf3f14cf400ef638f215114f660b /dep | |
parent | f9451f1cf51d5c4bbe49a30f027bf33f85cd1024 (diff) |
Build: Fixed CMake 3.30 FindBoost deprecation warning
(cherry picked from commit ab5fab5ee9fd0dde509d19ffc26503379a02c41b)
Diffstat (limited to 'dep')
-rw-r--r-- | dep/boost/CMakeLists.txt | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt index b374a88989e..47e3d5faa62 100644 --- a/dep/boost/CMakeLists.txt +++ b/dep/boost/CMakeLists.txt @@ -8,18 +8,31 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +set(BOOST_SEARCH_HINTS) if(WIN32) if(DEFINED ENV{BOOST_ROOT}) set(BOOST_ROOT $ENV{BOOST_ROOT}) endif() + if(DEFINED BOOST_ROOT AND MSVC) + # insert a dot (.) character before last digit of MSVC_TOOLSET_VERSION + # turn 143 into 14.3 + string(LENGTH "${MSVC_TOOLSET_VERSION}" _BOOST_MSVC_TOOLSET_VERSION_LENGTH) + math(EXPR _BOOST_MSVC_TOOLSET_VERSION_LENGTH "${_BOOST_MSVC_TOOLSET_VERSION_LENGTH} - 1" OUTPUT_FORMAT DECIMAL) + string(SUBSTRING "${MSVC_TOOLSET_VERSION}" 0 ${_BOOST_MSVC_TOOLSET_VERSION_LENGTH} _BOOST_MSVC_TOOLSET_VERSION_MAJOR) + string(SUBSTRING "${MSVC_TOOLSET_VERSION}" ${_BOOST_MSVC_TOOLSET_VERSION_LENGTH} -1 _BOOST_MSVC_TOOLSET_VERSION_MINOR) + + set(BOOST_SEARCH_HINTS "${BOOST_ROOT}/lib${PLATFORM}-msvc-${_BOOST_MSVC_TOOLSET_VERSION_MAJOR}.${_BOOST_MSVC_TOOLSET_VERSION_MINOR}/cmake") + + unset(_BOOST_MSVC_TOOLSET_VERSION_LENGTH) + unset(_BOOST_MSVC_TOOLSET_VERSION_MAJOR) + unset(_BOOST_MSVC_TOOLSET_VERSION_MINOR) + endif() set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) endif() -set(Boost_NO_WARN_NEW_VERSIONS ON) - if (WIN32) # On windows the requirements are higher according to the wiki. set(BOOST_REQUIRED_VERSION 1.78) @@ -27,7 +40,18 @@ else() set(BOOST_REQUIRED_VERSION 1.74) endif() -find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem program_options iostreams regex locale) +find_package(Boost ${BOOST_REQUIRED_VERSION} + REQUIRED + COMPONENTS + system + filesystem + program_options + iostreams + regex + locale + CONFIG + HINTS + ${BOOST_SEARCH_HINTS}) if(NOT Boost_FOUND) if(NOT DEFINED ENV{BOOST_ROOT} AND NOT DEFINED Boost_DIR AND NOT DEFINED BOOST_ROOT AND NOT DEFINED BOOSTROOT) |