diff --git a/CMakeLists.txt b/CMakeLists.txt index 9688c711bc7..53859196cfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -888,7 +888,11 @@ endif() if(WITH_CYCLES AND WITH_CYCLES_DEVICE_CUDA AND NOT WITH_CUDA_DYNLOAD) find_package(CUDA) if(NOT CUDA_FOUND) - message(STATUS "CUDA toolkit not found, using dynamic runtime loading of libraries (WITH_CUDA_DYNLOAD) instead") + message( + STATUS + "CUDA toolkit not found, " + "using dynamic runtime loading of libraries (WITH_CUDA_DYNLOAD) instead" + ) set(WITH_CUDA_DYNLOAD ON) endif() endif() @@ -905,7 +909,8 @@ if(WITH_INTERNATIONAL) file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/datafiles/locale") list(LENGTH RESULT DIR_LEN) if(DIR_LEN EQUAL 0) - message(WARNING + message( + WARNING "Translation path '${CMAKE_SOURCE_DIR}/release/datafiles/locale' is missing, " "This is a 'git submodule', which are known not to work with bridges to other version " "control systems, disabling 'WITH_INTERNATIONAL'." @@ -923,13 +928,17 @@ if(WITH_PYTHON) # because UNIX will search for the old Python paths which may not exist. # giving errors about missing paths before this case is met. if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.10") - message(FATAL_ERROR "At least Python 3.10 is required to build, but found Python ${PYTHON_VERSION}") + message( + FATAL_ERROR + "At least Python 3.10 is required to build, but found Python ${PYTHON_VERSION}" + ) endif() file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons") list(LENGTH RESULT DIR_LEN) if(DIR_LEN EQUAL 0) - message(WARNING + message( + WARNING "Addons path '${CMAKE_SOURCE_DIR}/release/scripts/addons' is missing, " "This is a 'git submodule', which are known not to work with bridges to other version " "control systems: * CONTINUING WITHOUT ADDONS *" @@ -1037,13 +1046,15 @@ endif() if(WITH_CYCLES) if(NOT WITH_OPENIMAGEIO) - message(FATAL_ERROR + message( + FATAL_ERROR "Cycles requires WITH_OPENIMAGEIO, the library may not have been found. " "Configure OIIO or disable WITH_CYCLES" ) endif() if(NOT WITH_BOOST) - message(FATAL_ERROR + message( + FATAL_ERROR "Cycles requires WITH_BOOST, the library may not have been found. " "Configure BOOST or disable WITH_CYCLES" ) @@ -1051,7 +1062,8 @@ if(WITH_CYCLES) if(WITH_CYCLES_OSL) if(NOT WITH_LLVM) - message(FATAL_ERROR + message( + FATAL_ERROR "Cycles OSL requires WITH_LLVM, the library may not have been found. " "Configure LLVM or disable WITH_CYCLES_OSL" ) @@ -1061,7 +1073,8 @@ endif() if(WITH_INTERNATIONAL) if(NOT WITH_BOOST) - message(FATAL_ERROR + message( + FATAL_ERROR "Internationalization requires WITH_BOOST, the library may not have been found. " "Configure BOOST or disable WITH_INTERNATIONAL" ) @@ -1606,7 +1619,8 @@ endif() # be most problematic. if(WITH_PYTHON) if(NOT EXISTS "${PYTHON_INCLUDE_DIR}/Python.h") - message(FATAL_ERROR + message( + FATAL_ERROR "Missing: \"${PYTHON_INCLUDE_DIR}/Python.h\",\n" "Set the cache entry 'PYTHON_INCLUDE_DIR' to point " "to a valid python include path. Containing " @@ -1675,9 +1689,11 @@ if(WITH_COMPILER_SHORT_FILE_MACRO) if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0) # Developers may have say LLVM Clang-10.0.1 toolchain (which supports the flag) # with Xcode-11 (the Clang of which doesn't support the flag). - message(WARNING + message( + WARNING "-fmacro-prefix-map flag is NOT supported by Clang shipped with Xcode-${XCODE_VERSION}." - " Some Xcode functionality in Product menu may not work. Disabling WITH_COMPILER_SHORT_FILE_MACRO." + " Some Xcode functionality in Product menu may not work. " + "Disabling WITH_COMPILER_SHORT_FILE_MACRO." ) set(WITH_COMPILER_SHORT_FILE_MACRO OFF) endif() @@ -1693,7 +1709,8 @@ if(WITH_COMPILER_SHORT_FILE_MACRO) unset(_bin_dir) endif() else() - message(WARNING + message( + WARNING "-fmacro-prefix-map flag is NOT supported by C/C++ compiler." " Disabling WITH_COMPILER_SHORT_FILE_MACRO." ) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 23cb38362c2..f8cbb9bc07c 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -193,7 +193,10 @@ if(WITH_BUILDINFO) set(buildinfo_h_fake "${CMAKE_CURRENT_BINARY_DIR}/buildinfo.h_fake") if(EXISTS ${buildinfo_h_fake}) - message(FATAL_ERROR "File \"${buildinfo_h_fake}\" found, this should never be created, remove!") + message( + FATAL_ERROR + "File \"${buildinfo_h_fake}\" found, this should never be created, remove!" + ) endif() # From the CMAKE documentation "If the output of the custom command is not actually created as a @@ -214,12 +217,14 @@ if(WITH_BUILDINFO) OUTPUT ${buildinfo_h_fake} # ensure we always run ${buildinfo_h_real} - COMMAND ${CMAKE_COMMAND} - -DSOURCE_DIR=${CMAKE_SOURCE_DIR} - # Overrides only used when non-empty strings. - -DBUILD_DATE=${BUILDINFO_OVERRIDE_DATE} - -DBUILD_TIME=${BUILDINFO_OVERRIDE_TIME} - -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake) + COMMAND + ${CMAKE_COMMAND} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + # Overrides only used when non-empty strings. + -DBUILD_DATE=${BUILDINFO_OVERRIDE_DATE} + -DBUILD_TIME=${BUILDINFO_OVERRIDE_TIME} + -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake + ) # `buildinfo.h` is a generated file. set_source_files_properties( @@ -476,8 +481,9 @@ if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*") # Message to display after building. add_custom_command( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND ${CMAKE_COMMAND} -E - echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}' + COMMAND + ${CMAKE_COMMAND} -E + echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}' ) endif() @@ -491,9 +497,10 @@ if(UNIX AND NOT APPLE) if(WITH_DOC_MANPAGE) add_custom_target( blender_man_page ALL - COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py - --blender ${EXECUTABLE_OUTPUT_PATH}/blender - --output ${CMAKE_CURRENT_BINARY_DIR}/blender.1 + COMMAND + ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py + --blender ${EXECUTABLE_OUTPUT_PATH}/blender + --output ${CMAKE_CURRENT_BINARY_DIR}/blender.1 ) add_dependencies(blender_man_page blender) endif() @@ -785,7 +792,11 @@ elseif(WIN32) string(REPLACE "cl.exe" "clang_rt.asan_dynamic-x86_64.dll" ASAN_DLL ${CMAKE_C_COMPILER}) string(REPLACE "cl.exe" "clang_rt.asan_dbg_dynamic-x86_64.dll" ASAN_DEBUG_DLL ${CMAKE_C_COMPILER}) if(NOT EXISTS "${ASAN_DLL}") - message(FATAL_ERROR "ASAN is enabled, but the ASAN runtime is not detected, this is an optional component during the MSVC install, please install it") + message( + FATAL_ERROR + "ASAN is enabled, but the ASAN runtime is not detected, " + "this is an optional component during the MSVC install, please install it" + ) endif() install( FILES ${ASAN_DLL} @@ -1100,9 +1111,11 @@ elseif(APPLE) set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/Blender.app) # Setup `Info.plist`. - execute_process(COMMAND date "+%Y-%m-%d" - OUTPUT_VARIABLE BLENDER_DATE - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND date "+%Y-%m-%d" + OUTPUT_VARIABLE BLENDER_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) set_target_properties(blender PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist @@ -1111,9 +1124,11 @@ elseif(APPLE) ) # Gather the date in finder-style. - execute_process(COMMAND date "+%m/%d/%Y/%H:%M" - OUTPUT_VARIABLE SETFILE_DATE - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND date "+%m/%d/%Y/%H:%M" + OUTPUT_VARIABLE SETFILE_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) # Give the bundle actual creation/modification date. # @@ -1121,8 +1136,9 @@ elseif(APPLE) if(NOT EXISTS ${EXECUTABLE_OUTPUT_PATH}/Blender.app) file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/Blender.app) endif() - execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE} - ${EXECUTABLE_OUTPUT_PATH}/Blender.app) + execute_process( + COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE} ${EXECUTABLE_OUTPUT_PATH}/Blender.app + ) install( TARGETS blender