mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Build: Fixed CMake 3.30 FindBoost deprecation warning
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -47,9 +47,9 @@ target_include_directories(common
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_compile_definitions(common
|
||||
PRIVATE
|
||||
TRINITY_API_EXPORT_COMMON)
|
||||
set_target_properties(common
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL TRINITY_API_EXPORT_COMMON)
|
||||
|
||||
target_link_libraries(common
|
||||
PRIVATE
|
||||
|
||||
@@ -36,9 +36,9 @@ target_include_directories(database
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_compile_definitions(database
|
||||
PRIVATE
|
||||
TRINITY_API_EXPORT_DATABASE)
|
||||
set_target_properties(database
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL TRINITY_API_EXPORT_DATABASE)
|
||||
|
||||
target_link_libraries(database
|
||||
PRIVATE
|
||||
|
||||
@@ -46,9 +46,9 @@ target_include_directories(game
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_compile_definitions(game
|
||||
PRIVATE
|
||||
TRINITY_API_EXPORT_GAME)
|
||||
set_target_properties(game
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL TRINITY_API_EXPORT_GAME)
|
||||
|
||||
target_link_libraries(game
|
||||
PRIVATE
|
||||
|
||||
@@ -38,9 +38,9 @@ target_include_directories(proto
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_compile_definitions(proto
|
||||
PRIVATE
|
||||
TRINITY_API_EXPORT_PROTO)
|
||||
set_target_properties(proto
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL TRINITY_API_EXPORT_PROTO)
|
||||
|
||||
target_link_libraries(proto
|
||||
PRIVATE
|
||||
|
||||
@@ -36,9 +36,9 @@ target_include_directories(shared
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_compile_definitions(shared
|
||||
PRIVATE
|
||||
TRINITY_API_EXPORT_SHARED)
|
||||
set_target_properties(shared
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL TRINITY_API_EXPORT_SHARED)
|
||||
|
||||
target_link_libraries(shared
|
||||
PRIVATE
|
||||
|
||||
Reference in New Issue
Block a user