diff options
author | Ray Molenkamp <github@lazydodo.com> | 2019-08-30 17:40:08 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2019-08-30 17:40:08 +0300 |
commit | 66ec72045f8c25ec9e9710f4d70aed9fb1514df6 (patch) | |
tree | 676d5f94863224c8a0de0dec3337a73fb7707dc6 | |
parent | 26c110f2d243eddcb5bf80c1214d00d810181f1a (diff) |
Windows: Move building of blendthumb into the blender codebase.
Previously this was done in the deps builder due to the fact we needed
both 32 and 64 bit versions of this dll and CMAKE does not support that
in a single build folder. Now that 32 bit support has been dropped, this
can be safely moved into the codebase.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5633
-rw-r--r-- | build_files/build_environment/cmake/blendthumb.cmake | 67 | ||||
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 3 | ||||
-rw-r--r-- | source/blender/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/blendthumb/CMakeLists.txt (renamed from release/windows/blendthumb/CMakeLists.txt) | 10 | ||||
-rw-r--r-- | source/blender/blendthumb/src/BlendThumb.def (renamed from release/windows/blendthumb/src/BlendThumb.def) | 0 | ||||
-rw-r--r-- | source/blender/blendthumb/src/BlendThumb.rc (renamed from release/windows/blendthumb/src/BlendThumb.rc) | 0 | ||||
-rw-r--r-- | source/blender/blendthumb/src/BlenderThumb.cpp (renamed from release/windows/blendthumb/src/BlenderThumb.cpp) | 0 | ||||
-rw-r--r-- | source/blender/blendthumb/src/Dll.cpp (renamed from release/windows/blendthumb/src/Dll.cpp) | 0 | ||||
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 12 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 22 |
10 files changed, 17 insertions, 101 deletions
diff --git a/build_files/build_environment/cmake/blendthumb.cmake b/build_files/build_environment/cmake/blendthumb.cmake deleted file mode 100644 index f4cc6ee9d37..00000000000 --- a/build_files/build_environment/cmake/blendthumb.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ***** END GPL LICENSE BLOCK ***** - -if(BUILD_MODE STREQUAL Release) - if(WIN32) - set(THUMB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../release/windows/blendthumb) - - ExternalProject_Add(external_zlib_32 - URL ${ZLIB_URI} - CMAKE_GENERATOR ${GENERATOR_32} - URL_HASH MD5=${ZLIB_HASH} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - PREFIX ${BUILD_DIR}/zlib32 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib32 ${DEFAULT_CMAKE_FLAGS} - INSTALL_DIR ${LIBDIR}/zlib32 - ) - - ExternalProject_Add(external_zlib_64 - URL ${ZLIB_URI} - CMAKE_GENERATOR ${GENERATOR_64} - URL_HASH MD5=${ZLIB_HASH} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - PREFIX ${BUILD_DIR}/zlib64 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib64 ${DEFAULT_CMAKE_FLAGS} - INSTALL_DIR ${LIBDIR}/zlib64 - ) - - ExternalProject_Add(external_blendthumb_32 - CMAKE_GENERATOR ${GENERATOR_32} - SOURCE_DIR ${THUMB_DIR} - PREFIX ${BUILD_DIR}/blendthumb32 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib - INSTALL_DIR ${LIBDIR}/blendthumb32 - ) - add_dependencies( - external_blendthumb_32 - external_zlib_32 - ) - - ExternalProject_Add(external_blendthumb_64 - CMAKE_GENERATOR ${GENERATOR_64} - SOURCE_DIR ${THUMB_DIR} - PREFIX ${BUILD_DIR}/blendthumb64 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib - INSTALL_DIR ${LIBDIR}/blendthumb64 - ) - add_dependencies( - external_blendthumb_64 - external_zlib_64 - ) - endif() -endif() diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 97e4a6b69d4..526e72e2e33 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -51,9 +51,6 @@ if(BUILD_MODE STREQUAL Release) # tiff ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ && - # BlendThumb - ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll && - ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll && # hidapi ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ && # webp, straight up copy diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 76442048594..203543b0ef0 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -153,3 +153,7 @@ endif() if(WITH_ALEMBIC) add_subdirectory(alembic) endif() + +if(WIN32) + add_subdirectory(blendthumb) +endif() diff --git a/release/windows/blendthumb/CMakeLists.txt b/source/blender/blendthumb/CMakeLists.txt index 45c583d1421..3f9e0b1bff5 100644 --- a/release/windows/blendthumb/CMakeLists.txt +++ b/source/blender/blendthumb/CMakeLists.txt @@ -19,13 +19,8 @@ # ***** END GPL LICENSE BLOCK ***** #----------------------------------------------------------------------------- -cmake_minimum_required(VERSION 2.8) -project(BlendThumb) +include_directories(${ZLIB_INCLUDE_DIRS}) -#Bring the headers, such as Student.h into the project -include_directories(${ZLIB_INCLUDE}) - -#Can manually add the sources using the set command as follows: set(SRC src/BlenderThumb.cpp src/BlendThumb.def @@ -34,5 +29,4 @@ set(SRC ) add_library(BlendThumb SHARED ${SRC}) -target_link_libraries(BlendThumb ${ZLIB_LIBS}) -install (TARGETS BlendThumb DESTINATION bin) +target_link_libraries(BlendThumb ${ZLIB_LIBRARIES}) diff --git a/release/windows/blendthumb/src/BlendThumb.def b/source/blender/blendthumb/src/BlendThumb.def index 71f9236735f..71f9236735f 100644 --- a/release/windows/blendthumb/src/BlendThumb.def +++ b/source/blender/blendthumb/src/BlendThumb.def diff --git a/release/windows/blendthumb/src/BlendThumb.rc b/source/blender/blendthumb/src/BlendThumb.rc index 5dfd416b0c5..5dfd416b0c5 100644 --- a/release/windows/blendthumb/src/BlendThumb.rc +++ b/source/blender/blendthumb/src/BlendThumb.rc diff --git a/release/windows/blendthumb/src/BlenderThumb.cpp b/source/blender/blendthumb/src/BlenderThumb.cpp index 553428d5b5d..553428d5b5d 100644 --- a/release/windows/blendthumb/src/BlenderThumb.cpp +++ b/source/blender/blendthumb/src/BlenderThumb.cpp diff --git a/release/windows/blendthumb/src/Dll.cpp b/source/blender/blendthumb/src/Dll.cpp index 7b0521cd5a8..7b0521cd5a8 100644 --- a/release/windows/blendthumb/src/Dll.cpp +++ b/source/blender/blendthumb/src/Dll.cpp diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 9e6ea0bb6ee..724f27f4667 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -172,17 +172,7 @@ void RegisterBlendExtension(void) BLI_getInstallationDir(InstallDir); GetSystemDirectory(SysDir, FILE_MAXDIR); -# ifdef _WIN64 - ThumbHandlerDLL = "BlendThumb64.dll"; -# else - IsWow64Process(GetCurrentProcess(), &IsWOW64); - if (IsWOW64 == true) { - ThumbHandlerDLL = "BlendThumb64.dll"; - } - else { - ThumbHandlerDLL = "BlendThumb.dll"; - } -# endif + ThumbHandlerDLL = "BlendThumb.dll"; snprintf( RegCmd, MAX_PATH * 2, "%s\\regsvr32 /s \"%s\\%s\"", SysDir, InstallDir, ThumbHandlerDLL); system(RegCmd); diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index f74fd57252d..893d3262590 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -820,18 +820,6 @@ elseif(WIN32) ) endif() - if(NOT CMAKE_CL_64) - install( - FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll - DESTINATION "." - ) - endif() - - install( # x86 builds can run on x64 Windows, so this is required at all times - FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll - DESTINATION "." - ) - install( FILES ${CMAKE_SOURCE_DIR}/release/windows/batch/blender_debug_gpu.cmd @@ -1038,6 +1026,16 @@ if (WIN32) endif() # ----------------------------------------------------------------------------- +# Thumbnailer +if(WIN32) + install( + TARGETS BlendThumb + COMPONENT Blender + DESTINATION "." + ) +endif() + +# ----------------------------------------------------------------------------- # Setup launcher if(WIN32 AND NOT WITH_PYTHON_MODULE) |