Cleanup: wrap long lines for CMake

This commit is contained in:
Campbell Barton
2025-04-05 20:21:57 +11:00
parent 8e5c0aedec
commit f48b4e3abf
13 changed files with 163 additions and 54 deletions

View File

@@ -290,7 +290,8 @@ Use pre-compiled headers to speed up compilation."
if(WITH_CLANG_TIDY AND (CMAKE_COMPILER_IS_GNUCC OR APPLE))
if(WITH_COMPILER_PRECOMPILED_HEADERS)
message(STATUS
"Clang-Tidy and the current compiler's precompiled headers are incompatible, disabling precompiled headers."
"Clang-Tidy and the current compiler's precompiled headers are incompatible, "
"disabling precompiled headers."
)
set(WITH_COMPILER_PRECOMPILED_HEADERS OFF)
endif()
@@ -644,7 +645,8 @@ Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even
OFF
)
set(CYCLES_TEST_DEVICES CPU CACHE STRING "\
Run regression tests on the specified device types (CPU CUDA OPTIX HIP HIP-RT METAL METAL-RT ONEAPI ONEAPI-RT)"
Run regression tests on the specified device types \
(CPU CUDA OPTIX HIP HIP-RT METAL METAL-RT ONEAPI ONEAPI-RT)"
)
option(WITH_CYCLES_TEST_OSL "\
Run additional Cycles test with OSL enabled"
@@ -697,7 +699,8 @@ endif()
if(NOT APPLE AND NOT (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64"))
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
# We only support RDNA1 (gfx101X) and newer. Vega and older generations have rendering artifacts and crashing issues.
# We only support RDNA1 (gfx101X) and newer.
# Vega and older generations have rendering artifacts and crashing issues.
set(CYCLES_HIP_BINARIES_ARCH
gfx1010 gfx1011 gfx1012
gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 gfx1036
@@ -830,7 +833,10 @@ Enable GPU drawing related unit testing (draw manager)"
OFF
)
option(WITH_GPU_COMPOSITOR_TESTS "Enable regression testing for GPU compositor" OFF)
option(WITH_GPU_MESH_PAINT_TESTS "Enable visual render-based regression testing for mesh painting" OFF)
option(WITH_GPU_MESH_PAINT_TESTS "\
Enable visual render-based regression testing for mesh painting"
OFF
)
option(WITH_UI_TESTS "\
Enable user-interface tests (Experimental)"
OFF
@@ -892,10 +898,10 @@ Enable tests validating some build-related scripts against the 'system' version
)
mark_as_advanced(WITH_SYSTEM_PYTHON_TESTS)
# We could use `find_package (Python3 COMPONENTS Interpreter)` to set that value automatically.
# However, on some buildbots this will give the default python version of the current virtual environment,
# which may differ from the OS default python version.
# And it would set that global 'python3 exec path' CMake value for all CMake scripts, which could have
# unexpected and dangerous side effects.
# However, on some buildbots this will give the default Python version of the current virtual
# environment, which may differ from the OS default Python version.
# And it would set that global 'python3 exec path' CMake value for all CMake scripts,
# which could have unexpected and dangerous side effects.
# So this has to be set explicitly for all builders.
set(TEST_SYSTEM_PYTHON_EXE "" CACHE PATH "Python executable used to run 'system python' tests")
mark_as_advanced(TEST_SYSTEM_PYTHON_EXE)
@@ -1026,9 +1032,15 @@ endif()
if(WITH_COMPILER_CODE_COVERAGE)
set(_code_coverage_defaults "--coverage")
set(COMPILER_CODE_COVERAGE_CFLAGS ${_code_coverage_defaults} CACHE STRING "C flags for code coverage")
set(COMPILER_CODE_COVERAGE_CFLAGS
${_code_coverage_defaults} CACHE STRING
"C flags for code coverage"
)
mark_as_advanced(COMPILER_CODE_COVERAGE_CFLAGS)
set(COMPILER_CODE_COVERAGE_CXXFLAGS ${_code_coverage_defaults} CACHE STRING "C++ flags for code coverage")
set(COMPILER_CODE_COVERAGE_
CXXFLAGS ${_code_coverage_defaults} CACHE STRING
"C++ flags for code coverage"
)
mark_as_advanced(COMPILER_CODE_COVERAGE_CXXFLAGS)
unset(_code_coverage_defaults)
endif()

View File

@@ -68,7 +68,10 @@ function(download_source dep)
if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH)
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}")
message(FATAL_ERROR
"${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\n"
"Expected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}"
)
endif()
endif()
endif()

View File

@@ -56,7 +56,10 @@ file(GLOB EMBREE_INSTALLED_VCTOOLS RELATIVE ${EMBREE_VCTOOLSDIR_PATH} ${EMBREE_V
# Check that at least one the installed tool versions
# (there may be different subversions) is present.
if(NOT EMBREE_INSTALLED_VCTOOLS)
message(FATAL_ERROR "When building for Windows ARM64 platforms, embree requires VC Tools ${EMBREE_VCTOOLS_REQUIRED_VERSION} to be installed alongside the current version.")
message(FATAL_ERROR
"When building for Windows ARM64 platforms, embree requires VC Tools "
"${EMBREE_VCTOOLS_REQUIRED_VERSION} to be installed alongside the current version."
)
endif()
# Get the last item in the list (latest, when list is sorted)

View File

@@ -41,7 +41,10 @@ file(GLOB OPENPGL_INSTALLED_VCTOOLS RELATIVE ${OPENPGL_VCTOOLSDIR_PATH} ${OPENPG
# Check that at least one the installed tool versions
# (there may be different subversions) is present.
if(NOT OPENPGL_INSTALLED_VCTOOLS)
message(FATAL_ERROR "When building for Windows ARM64 platforms, OpenPGL requires VC Tools ${OPENPGL_VCTOOLS_REQUIRED_VERSION} to be installed alongside the current version.")
message(FATAL_ERROR
"When building for Windows ARM64 platforms, "
"OpenPGL requires VC Tools ${OPENPGL_VCTOOLS_REQUIRED_VERSION} "
"to be installed alongside the current version.")
endif()
# Get the last item in the list (latest, when list is sorted)

View File

@@ -11,10 +11,11 @@
##################################################################################################
macro(download_package package_name)
# this will
# 1 - download the required package from either the upstream location or blender mirror depending on MSYS2_USE_UPSTREAM_PACKAGES
# 2 - Set a global variable [package_name]_FILE to point to the downloaded file
# 3 - Verify the hash if FORCE_CHECK_HASH is on
# This will:
# 1 - Download the required package from either the upstream location or blender mirror
# depending on `MSYS2_USE_UPSTREAM_PACKAGES`.
# 2 - Set a global variable [package_name]_FILE to point to the downloaded file.
# 3 - Verify the hash if FORCE_CHECK_HASH is on.
set(URL ${MSYS2_${package_name}_URL})
set(HASH ${MSYS2_${package_name}_HASH})
string(REPLACE "/" ";" _url_list ${URL})
@@ -52,8 +53,9 @@ macro(download_package package_name)
unset(_file_name)
endmacro()
# Note we use URL here rather than URI as the deps checker will check all *_URI vars for package/license/homepage requirements
# since none of this will end up on end users systems the requirements are not as strict
# Note we use URL here rather than URI as the dependencies checker will check all `*_URI`
# variables for package/license/homepage requirements since none of this will end up
# on end users systems the requirements are not as strict.
set(MSYS2_BASE_URL https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20221028.tar.xz)
set(MSYS2_BASE_HASH 545cc6a4c36bb98058f2b2945c5d06de523516db)
@@ -113,7 +115,8 @@ if((NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd") AND
# Do initial upgrade of pacman packages (only required for initial setup, to get
# latest packages as opposed to to what the installer comes with)
execute_process(
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -Sy --noconfirm && exit"
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c
"pacman -Sy --noconfirm && exit"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64
)
endif()
@@ -123,13 +126,15 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/m4.exe")
# Refresh pacman repositories (similar to debian's `apt update`)
message("Refreshing pacman")
execute_process(
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -Syy --noconfirm && exit"
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c
"pacman -Syy --noconfirm && exit"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64
)
message("Installing required packages")
execute_process(
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -S patch m4 coreutils pkgconf make diffutils autoconf-wrapper --noconfirm && exit"
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c
"pacman -S patch m4 coreutils pkgconf make diffutils autoconf-wrapper --noconfirm && exit"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64
)
endif()

View File

@@ -21,7 +21,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(DEFINED MSVC_REDIST_DIR)
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
else()
message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.")
message(
"Unable to detect the Visual Studio redist directory, "
"copying of the runtime dlls will not work, "
"try running from the visual studio developer prompt."
)
endif()
if(WITH_WINDOWS_STRIPPED_PDB)
message(WARNING "stripped pdb not supported with clang, disabling..")
@@ -30,28 +34,41 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
else()
if(WITH_BLENDER)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28.29921) # MSVC 2019 16.9.16
message(FATAL_ERROR "Compiler is unsupported, MSVC 2019 16.9.16 or newer is required for building blender.")
message(FATAL_ERROR
"Compiler is unsupported, MSVC 2019 16.9.16 or newer is required for building blender."
)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.36.32532 AND # MSVC 2022 17.6.0 has a bad codegen
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.37.32705) # But it is fixed in 2022 17.7 preview 1
message(FATAL_ERROR "Compiler is unsupported, MSVC 2022 17.6.x has codegen issues and cannot be used to build blender. Please upgrade to 17.7 or newer.")
message(FATAL_ERROR
"Compiler is unsupported, "
"MSVC 2022 17.6.x has codegen issues and cannot be used to build blender. "
"Please upgrade to 17.7 or newer."
)
endif()
endif()
endif()
set(WINDOWS_ARM64_MIN_VSCMD_VER 17.12.3)
# We have a minimum version of VSCMD for ARM64 (ie, the version the libs were compiled against)
# This checks for the version on initial run, and caches it, so users do not have to run the VS CMD window every time
# This checks for the version on initial run, and caches it,
# so users do not have to run the VS CMD window every time
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
set(VC_VSCMD_VER $ENV{VSCMD_VER} CACHE STRING "Version of the VSCMD initially run from")
mark_as_advanced(VC_VSCMD_VER)
set(VSCMD_VER ${VC_VSCMD_VER})
if(DEFINED VSCMD_VER)
if(VSCMD_VER VERSION_LESS WINDOWS_ARM64_MIN_VSCMD_VER)
message(FATAL_ERROR "Windows ARM64 requires VS2022 version ${WINDOWS_ARM64_MIN_VSCMD_VER} or greater - please update your VS2022 install!")
message(FATAL_ERROR
"Windows ARM64 requires VS2022 version ${WINDOWS_ARM64_MIN_VSCMD_VER} or greater - "
"please update your VS2022 install!"
)
endif()
else()
message(FATAL_ERROR "Unable to detect the Visual Studio CMD version, try running from the visual studio developer prompt.")
message(FATAL_ERROR
"Unable to detect the Visual Studio CMD version, "
"try running from the visual studio developer prompt."
)
endif()
endif()
@@ -279,7 +296,8 @@ string(APPEND PLATFORM_LINKFLAGS " /SUBSYSTEM:CONSOLE /STACK:2097152")
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
if(NOT WITH_COMPILER_ASAN)
# Asan is incompatible with fastlink, it will appear to work, but will not resolve symbols which makes it somewhat useless
# ASAN is incompatible with `fastlink`, it will appear to work,
# but will not resolve symbols which makes it somewhat useless.
string(APPEND PLATFORM_LINKFLAGS_DEBUG "/debug:fastlink ")
endif()
string(APPEND PLATFORM_LINKFLAGS_DEBUG " /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
@@ -308,10 +326,16 @@ if(NOT DEFINED LIBDIR)
set(LIBDIR_BASE "windows_x64")
endif()
else()
message(FATAL_ERROR "32 bit compiler detected, blender no longer provides pre-build libraries for 32 bit windows, please set the LIBDIR cmake variable to your own library folder")
message(FATAL_ERROR
"32 bit compiler detected, "
"blender no longer provides pre-build libraries for 32 bit windows, "
"please set the LIBDIR cmake variable to your own library folder"
)
endif()
if(MSVC_CLANG)
message(STATUS "Clang version ${CMAKE_CXX_COMPILER_VERSION} detected, masquerading as MSVC ${MSVC_VERSION}")
message(STATUS
"Clang version ${CMAKE_CXX_COMPILER_VERSION} detected, masquerading as MSVC ${MSVC_VERSION}"
)
set(LIBDIR ${CMAKE_SOURCE_DIR}/lib/${LIBDIR_BASE})
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.30.30423)
message(STATUS "Visual Studio 2022 detected.")
@@ -326,7 +350,10 @@ else()
endif()
endif()
if(NOT EXISTS "${LIBDIR}/.git")
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
message(FATAL_ERROR
"\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. "
"Please run `make update` in the blender source folder to obtain them."
)
endif()
include(platform_old_libs_update)
@@ -611,7 +638,9 @@ if(FALSE)
set(_PYTHON_VERSION "3.12")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PYTHON_VERSION})
if(NOT EXISTS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS})
message(FATAL_ERROR "Missing python libraries! Neither 3.12 nor 3.11 are found in ${LIBDIR}/python")
message(FATAL_ERROR
"Missing python libraries! Neither 3.12 nor 3.11 are found in ${LIBDIR}/python"
)
endif()
endif()
endif()
@@ -751,7 +780,9 @@ if(WITH_LLVM)
set(LLVM_LIBRARY ${LLVM_LIBS})
else()
message(WARNING "LLVM debug libs not present on this system. Using release libs for debug builds.")
message(WARNING
"LLVM debug libs not present on this system. Using release libs for debug builds."
)
set(LLVM_LIBRARY ${LLVM_LIBRARY_OPTIMIZED})
endif()
@@ -1152,7 +1183,9 @@ if(WINDOWS_PYTHON_DEBUG)
# If the user scripts env var is set, include scripts from there otherwise
# include user scripts in the profile folder.
if(DEFINED ENV{BLENDER_USER_SCRIPTS})
message(STATUS "Including user scripts from environment BLENDER_USER_SCRIPTS=$ENV{BLENDER_USER_SCRIPTS}")
message(STATUS
"Including user scripts from environment BLENDER_USER_SCRIPTS=$ENV{BLENDER_USER_SCRIPTS}"
)
set(USER_SCRIPTS_ROOT "$ENV{BLENDER_USER_SCRIPTS}")
else()
message(STATUS "Including user scripts from the profile folder")

View File

@@ -13,7 +13,9 @@ else()
if(NOT WINDOWS_PYTHON_DEBUG)
set(CYCLES_INSTALL_PATH "scripts/addons_core/cycles")
else()
set(CYCLES_INSTALL_PATH "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}/scripts/addons_core/cycles")
set(CYCLES_INSTALL_PATH
"$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}/scripts/addons_core/cycles"
)
endif()
endif()
@@ -299,7 +301,10 @@ if(WITH_CYCLES_EMBREE)
add_compile_definitions("$<$<CONFIG:RelWithDebInfo>:WITH_EMBREE_GPU>")
add_compile_definitions("$<$<CONFIG:MinSizeRel>:WITH_EMBREE_GPU>")
if(CMAKE_BUILD_TYPE MATCHES "Debug" OR GENERATOR_IS_MULTI_CONFIG)
message(STATUS "The use of Embree GPU is disabled for the Debug configuration as embree${EMBREE_MAJOR_VERSION}_sycl_d.lib is not found.")
message(STATUS
"The use of Embree GPU is disabled for the Debug configuration "
"as embree${EMBREE_MAJOR_VERSION}_sycl_d.lib is not found."
)
endif()
else()
add_definitions(-DWITH_EMBREE_GPU)

View File

@@ -1015,7 +1015,10 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
endif()
if(NOT oclocids_ret EQUAL 0)
list(REMOVE_ITEM CYCLES_ONEAPI_INTEL_BINARIES_ARCH ${device})
message(STATUS "Cycles oneAPI: binaries for ${device} not supported by Intel Graphics Compiler/ocloc, skipped.")
message(STATUS
"Cycles oneAPI: "
"binaries for ${device} not supported by Intel Graphics Compiler/ocloc, skipped."
)
endif()
endforeach()
list(JOIN CYCLES_ONEAPI_INTEL_BINARIES_ARCH "," gen_devices_string)

View File

@@ -76,7 +76,8 @@ elseif(APPLE)
# Command taken from XCode build process.
add_custom_command(
TARGET blender-thumbnailer POST_BUILD
COMMAND codesign --deep --force --sign - --entitlements "${CMAKE_SOURCE_DIR}/release/darwin/thumbnailer_entitlements.plist"
COMMAND codesign --deep --force --sign -
--entitlements "${CMAKE_SOURCE_DIR}/release/darwin/thumbnailer_entitlements.plist"
--timestamp=none $<TARGET_BUNDLE_DIR:blender-thumbnailer>
)
elseif(UNIX)

View File

@@ -2,7 +2,13 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WITH_IO_WAVEFRONT_OBJ OR WITH_IO_PLY OR WITH_IO_STL OR WITH_IO_GREASE_PENCIL OR WITH_ALEMBIC OR WITH_USD OR WITH_IO_CSV)
if(WITH_IO_WAVEFRONT_OBJ OR
WITH_IO_PLY OR
WITH_IO_STL OR
WITH_IO_GREASE_PENCIL OR
WITH_ALEMBIC OR
WITH_USD OR
WITH_IO_CSV)
add_subdirectory(common)
endif()

View File

@@ -23,7 +23,10 @@ file(MAKE_DIRECTORY ${TEST_OUT_DIR}/blendfile_io)
if(WITH_SYSTEM_PYTHON_TESTS)
if(NOT EXISTS "${TEST_SYSTEM_PYTHON_EXE}")
message(ERROR "'System Python' tests requested but no valid system python path, set TEST_SYSTEM_PYTHON_EXE.")
message(ERROR
"'System Python' tests requested but no valid system python path, "
"set TEST_SYSTEM_PYTHON_EXE."
)
set(WITH_SYSTEM_PYTHON_TESTS OFF)
endif()
endif()
@@ -677,7 +680,8 @@ if(WITH_CYCLES OR WITH_GPU_RENDER_TESTS)
if(WITH_CYCLES_TEST_OSL AND WITH_CYCLES_OSL)
# OSL is only supported with CPU and OptiX
# TODO: Enable OptiX support once it's more stable
if(("${_cycles_device_lower}" STREQUAL "cpu") OR ("${_cycles_device_lower}" STREQUAL "optix"))
if(("${_cycles_device_lower}" STREQUAL "cpu") OR
("${_cycles_device_lower}" STREQUAL "optix"))
add_render_test(
${_cycles_test_name}_osl
${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
@@ -1016,7 +1020,10 @@ foreach(geo_node_test ${geo_node_tests})
)
endforeach()
else()
message(STATUS "Directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ Not Found, disabling test.")
message(STATUS
"Directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ "
"Not Found, disabling test."
)
endif()
endforeach()
@@ -1032,7 +1039,10 @@ if(EXISTS "${TEST_SRC_DIR}/modeling/geometry_nodes/simulation/")
)
endforeach()
else()
message(STATUS "Directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/simulation/ not found, disabling tests")
message(STATUS
"Directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/simulation/ "
"Not found, disabling tests."
)
endif()
if(WITH_GPU_RENDER_TESTS)

View File

@@ -23,12 +23,29 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
# all calls to blender use this
if(APPLE)
if(${CMAKE_GENERATOR} MATCHES "Xcode")
set(TEST_BLENDER_EXE_PARAMS --background --factory-startup --debug-memory --debug-exit-on-error)
set(TEST_BLENDER_EXE_PARAMS
--background
--factory-startup
--debug-memory
--debug-exit-on-error
)
else()
set(TEST_BLENDER_EXE_PARAMS --background --factory-startup --debug-memory --debug-exit-on-error --env-system-scripts ${CMAKE_SOURCE_DIR}/scripts)
set(TEST_BLENDER_EXE_PARAMS
--background
--factory-startup
--debug-memory
--debug-exit-on-error
--env-system-scripts ${CMAKE_SOURCE_DIR}/scripts
)
endif()
else()
set(TEST_BLENDER_EXE_PARAMS --background --factory-startup --debug-memory --debug-exit-on-error --env-system-scripts ${CMAKE_SOURCE_DIR}/scripts)
set(TEST_BLENDER_EXE_PARAMS
--background
--factory-startup
--debug-memory
--debug-exit-on-error
--env-system-scripts ${CMAKE_SOURCE_DIR}/scripts
)
endif()
# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
@@ -40,7 +57,9 @@ endif()
macro(COLLADA_TEST module test_name blend_file)
add_test(
NAME bf_io_collada_${module}_${test_name}
COMMAND "$<TARGET_FILE:blender>" ${TEST_BLENDER_EXE_PARAMS} ${TEST_SRC_DIR}/collada/${module}/${blend_file}
COMMAND "$<TARGET_FILE:blender>"
${TEST_BLENDER_EXE_PARAMS}
${TEST_SRC_DIR}/collada/${module}/${blend_file}
--python ${CMAKE_CURRENT_LIST_DIR}/${module}/test_${module}_${test_name}.py --
--testdir ${TEST_SRC_DIR}/collada/${module}
)

View File

@@ -16,9 +16,15 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
# message(FATAL_ERROR "CMake test directory not found!")
# endif()
# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
set(TEST_BLENDER_EXE $<TARGET_FILE:blender> --background --factory-startup --debug-memory --debug-exit-on-error --env-system-scripts ${CMAKE_SOURCE_DIR}/scripts)
# For testing with VALGRIND prefix: `valgrind --track-origins=yes --error-limit=no`
set(TEST_BLENDER_EXE
$<TARGET_FILE:blender>
--background
--factory-startup
--debug-memory
--debug-exit-on-error
--env-system-scripts ${CMAKE_SOURCE_DIR}/scripts
)
# ------------------------------------------------------------------------------