[Bf-blender-cvs] [fd0dd95fea4] tmp_lib_update_32: CMake: compat fixes for win32
Ray Molenkamp
noreply at git.blender.org
Wed Apr 6 00:35:08 CEST 2022
Commit: fd0dd95fea4bc0de95f3fb4c010fc6c79f0a81aa
Author: Ray Molenkamp
Date: Tue Apr 5 16:34:14 2022 -0600
Branches: tmp_lib_update_32
https://developer.blender.org/rBfd0dd95fea4bc0de95f3fb4c010fc6c79f0a81aa
CMake: compat fixes for win32
These should be the last of the fixes required
to build successfully against both old and new
lib folders.
===================================================================
M build_files/cmake/platform/platform_win32.cmake
M source/creator/CMakeLists.txt
===================================================================
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 9161296fb4c..2396f548602 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -343,13 +343,18 @@ if(WITH_FFTW3)
set(FFTW3_LIBPATH ${FFTW3}/lib)
endif()
-windows_find_package(WebP)
-if(NOT WEBP_FOUND)
- if(EXISTS ${LIBDIR}/webp)
- set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
- set(WEBP_ROOT_DIR ${LIBDIR}/webp)
- set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
- set(WEBP_FOUND ON)
+if(WITH_IMAGE_WEBP)
+ windows_find_package(WebP)
+ if(NOT WEBP_FOUND)
+ if(EXISTS ${LIBDIR}/webp)
+ set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
+ set(WEBP_ROOT_DIR ${LIBDIR}/webp)
+ set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
+ set(WEBP_FOUND ON)
+ else()
+ message(STATUS "WITH_IMAGE_WEBP is ON but WEBP libraries are not found, setting WITH_IMAGE_WEBP=OFF")
+ set(WITH_IMAGE_WEBP OFF)
+ endif()
endif()
endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d17afad0918..7457358698d 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -896,16 +896,32 @@ elseif(WIN32)
endif()
if(WITH_CODEC_FFMPEG)
- install(
- FILES
- ${LIBDIR}/ffmpeg/lib/avcodec-58.dll
- ${LIBDIR}/ffmpeg/lib/avformat-58.dll
- ${LIBDIR}/ffmpeg/lib/avdevice-58.dll
- ${LIBDIR}/ffmpeg/lib/avutil-56.dll
- ${LIBDIR}/ffmpeg/lib/swscale-5.dll
- ${LIBDIR}/ffmpeg/lib/swresample-3.dll
- DESTINATION "."
- )
+ # Filenames change slightly between ffmpeg versions
+ # check both 5.0 and fallback to 4.4 to ease the transition
+ # between versions.
+ if(EXISTS "${LIBDIR}/ffmpeg/lib/avcodec-59.dll")
+ install(
+ FILES
+ ${LIBDIR}/ffmpeg/lib/avcodec-59.dll
+ ${LIBDIR}/ffmpeg/lib/avformat-59.dll
+ ${LIBDIR}/ffmpeg/lib/avdevice-59.dll
+ ${LIBDIR}/ffmpeg/lib/avutil-57.dll
+ ${LIBDIR}/ffmpeg/lib/swscale-6.dll
+ ${LIBDIR}/ffmpeg/lib/swresample-4.dll
+ DESTINATION "."
+ )
+ else()
+ install(
+ FILES
+ ${LIBDIR}/ffmpeg/lib/avcodec-58.dll
+ ${LIBDIR}/ffmpeg/lib/avformat-58.dll
+ ${LIBDIR}/ffmpeg/lib/avdevice-58.dll
+ ${LIBDIR}/ffmpeg/lib/avutil-56.dll
+ ${LIBDIR}/ffmpeg/lib/swscale-5.dll
+ ${LIBDIR}/ffmpeg/lib/swresample-3.dll
+ DESTINATION "."
+ )
+ endif()
endif()
if(WITH_TBB)
install(
More information about the Bf-blender-cvs
mailing list