Browse Source

Fix Blender 2.79b+VS2013 build issues.

pull/277/head
Adam Johnson 3 years ago
parent
commit
9cd8eecf61
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 3
      CMakeLists.txt
  2. 16
      cmake/FindBlender.cmake
  3. 7
      cmake/Finddumpbin.cmake

3
CMakeLists.txt

@ -42,6 +42,9 @@ elseif("${Blender_PYTHON_VERSION}" AND NOT "${Blender_PYTHON_VERSION}" MATCHES "
message(FATAL_ERROR "Your manually defined Blender python version ($CACHE{Blender_PYTHON_VERSION}) doesn't pass muster.") message(FATAL_ERROR "Your manually defined Blender python version ($CACHE{Blender_PYTHON_VERSION}) doesn't pass muster.")
endif() endif()
find_package(Blender 2.79 EXACT ${_Blender_REQUIRED}) find_package(Blender 2.79 EXACT ${_Blender_REQUIRED})
if(NOT Blender_FOUND)
set(Blender_VERSION "2.79")
endif()
# Gotta do this because libHSPlasma is still using the old broke-ass pre-3.12 find modules. # Gotta do this because libHSPlasma is still using the old broke-ass pre-3.12 find modules.
set(Python3_FIND_STRATEGY VERSION) set(Python3_FIND_STRATEGY VERSION)

16
cmake/FindBlender.cmake

@ -35,7 +35,7 @@ if(WIN32 AND EXISTS "${Blender_EXECUTABLE}")
COMMAND "${dumpbin_EXECUTABLE}" /headers "${Blender_EXECUTABLE}" COMMAND "${dumpbin_EXECUTABLE}" /headers "${Blender_EXECUTABLE}"
RESULTS_VARIABLE _RETURNCODE RESULTS_VARIABLE _RETURNCODE
OUTPUT_VARIABLE _dumpbin_output OUTPUT_VARIABLE _dumpbin_output
ERROR_VARIABLE _dumpbin_error ERROR_VARIABLE _dumpbin_output
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE
) )
@ -57,6 +57,14 @@ if(WIN32 AND EXISTS "${Blender_EXECUTABLE}")
endif() endif()
if(EXISTS "${Blender_EXECUTABLE}") if(EXISTS "${Blender_EXECUTABLE}")
execute_process(
COMMAND "${Blender_EXECUTABLE}" -b -v
RESULTS_VARIABLE _RETURNCODE
OUTPUT_VARIABLE _Blender_VERSION_OUTPUT
ERROR_VARIABLE _Blender_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
# Starting Blender is noisy on stdout, so all the extra characters will make sure things go right. # Starting Blender is noisy on stdout, so all the extra characters will make sure things go right.
# https://youtu.be/SlQFIsQ0dbs?t=19 # https://youtu.be/SlQFIsQ0dbs?t=19
set(_Blender_PYTHON_EXPR set(_Blender_PYTHON_EXPR
@ -65,14 +73,14 @@ if(EXISTS "${Blender_EXECUTABLE}")
execute_process( execute_process(
COMMAND "${Blender_EXECUTABLE}" -b --python-expr "${_Blender_PYTHON_EXPR}" COMMAND "${Blender_EXECUTABLE}" -b --python-expr "${_Blender_PYTHON_EXPR}"
RESULTS_VARIABLE _RETURNCODE RESULTS_VARIABLE _RETURNCODE
OUTPUT_VARIABLE _Blender_VERSION_OUTPUT OUTPUT_VARIABLE _Blender_PYTHON_OUTPUT
ERROR_VARIABLE _Blender_VERSION_OUTPUT ERROR_VARIABLE _Blender_PYTHON_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE
) )
string(REGEX MATCH [[Blender ([0-9]+\.[0-9]+)]] _match "${_Blender_VERSION_OUTPUT}") string(REGEX MATCH [[Blender ([0-9]+\.[0-9]+)]] _match "${_Blender_VERSION_OUTPUT}")
set(Blender_VERSION "${CMAKE_MATCH_1}") set(Blender_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH [[!!! OOGABOOGA ([0-9]+\.[0-9]+) AGOOBAGOO !!!]] _match "${_Blender_VERSION_OUTPUT}") string(REGEX MATCH [[!!! OOGABOOGA ([0-9]+\.[0-9]+) AGOOBAGOO !!!]] _match "${_Blender_PYTHON_OUTPUT}")
set(Blender_PYTHON_VERSION "${CMAKE_MATCH_1}") set(Blender_PYTHON_VERSION "${CMAKE_MATCH_1}")
endif() endif()

7
cmake/Finddumpbin.cmake

@ -15,9 +15,14 @@
get_filename_component(_linker_dir "${CMAKE_LINKER}" DIRECTORY) get_filename_component(_linker_dir "${CMAKE_LINKER}" DIRECTORY)
# In Visual Studio 2013, the dumpbin.exe in the linker directory is missing an important DLL.
# But, it's present in the parent directory, so prefer that one.
get_filename_component(_msvc_bin_dir "${_linker_dir}/../" ABSOLUTE)
find_program(dumpbin_EXECUTABLE find_program(dumpbin_EXECUTABLE
NAMES dumpbin NAMES dumpbin
PATHS ${_linker_dir} PATHS "${_msvc_bin_dir}" "${_linker_dir}"
) )
mark_as_advanced(dumpbin_EXECUTABLE) mark_as_advanced(dumpbin_EXECUTABLE)

Loading…
Cancel
Save