CMake/Win32: Install boost dlls during install phase

During install all dlls should copy to the blender.shared
folder regardless if the dependency is on or off, creators
CmakeLists.txt already did this correctly, but for boost
the BOOST_POSTFIX and BOOST_DEBUG_POSTFIX variables were
not set causing the boost dll's not to be copied.

This change takes the setting of these variables out of the
WITH_BOOST block, but still guards it with a
WITH_WINDOWS_FIND_MODULES block so we don't break the build
for people building with that on.
This commit is contained in:
Ray Molenkamp 2023-03-04 14:07:17 -07:00
parent adacf5a706
commit 38407b319a
1 changed files with 22 additions and 16 deletions

View File

@ -522,6 +522,28 @@ if(WITH_PYTHON)
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
endif()
if(NOT WITH_WINDOWS_FIND_MODULES)
# even if boost is off, we still need to install the dlls when we use our lib folder since
# some of the other dependencies may need them. For this to work, BOOST_VERSION,
# BOOST_POSTFIX, and BOOST_DEBUG_POSTFIX need to be set.
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/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 "vc142-mt-x64-${BOOST_VERSION}")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "")
endif()
if(WITH_BOOST)
if(WITH_CYCLES AND WITH_CYCLES_OSL)
set(boost_extra_libs wave)
@ -537,22 +559,6 @@ if(WITH_BOOST)
endif()
if(NOT Boost_FOUND)
warn_hardcoded_paths(BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/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 "vc142-mt-x64-${BOOST_VERSION}")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "")
# This is file new in 3.4 if it does not exist, assume we are building against 3.3 libs
set(BOOST_34_TRIGGER_FILE ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib)
if(NOT EXISTS ${BOOST_34_TRIGGER_FILE})