Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-02-22 21:03:44 +0300
committerRay Molenkamp <github@lazydodo.com>2021-02-22 21:03:44 +0300
commitcd8f2dfecc58604bb7a8bc342380e5236fbb4ba8 (patch)
tree845eae7a60af01c2a732fd1ee12c0d553238909c /build_files/cmake/platform/platform_win32.cmake
parent5f8b6a9c0eb3ae61c3b3e910e6a59cdd2cd9d260 (diff)
CMake/Windows: Detect Boost version
Rather than hardcoding the lib names, read boosts version.hpp and extract the version from there. This will make it easier to land lib changes in the near future.
Diffstat (limited to 'build_files/cmake/platform/platform_win32.cmake')
-rw-r--r--build_files/cmake/platform/platform_win32.cmake14
1 files changed, 11 insertions, 3 deletions
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 06cee51344a..b303358d0b8 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -454,10 +454,18 @@ if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/lib)
- if(CMAKE_CL_64)
- set(BOOST_POSTFIX "vc141-mt-x64-1_70.lib")
- set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-1_70.lib")
+ set(BOOST_VERSION_HEADER ${BOOST_INCLUDE_DIR}/boost/version.hpp)
+ if(EXISTS ${BOOST_VERSION_HEADER})
+ file(STRINGS "${BOOST_VERSION_HEADER}" BOOST_LIB_VERSION REGEX "#define BOOST_LIB_VERSION ")
+ if(BOOST_LIB_VERSION MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
+ set(BOOST_VERSION "${CMAKE_MATCH_1}")
+ endif()
endif()
+ if(NOT BOOST_VERSION)
+ message(FATAL_ERROR "Unable to determine Boost version")
+ endif()
+ set(BOOST_POSTFIX "vc141-mt-x64-${BOOST_VERSION}.lib")
+ set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-${BOOST_VERSION}.lib")
set(BOOST_LIBRARIES
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
optimized ${BOOST_LIBPATH}/libboost_filesystem-${BOOST_POSTFIX}