From ebd0e7608860e0a7a1b0fbe563a4329919f78799 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 28 Jan 2022 14:08:11 +1100 Subject: [PATCH] Cleanup: indentation for CMake files Also minor white-space & case changes. --- CMakeLists.txt | 2 +- build_files/cmake/macros.cmake | 26 +++---- extern/CMakeLists.txt | 2 +- intern/cycles/cmake/external_libs.cmake | 4 +- intern/ghost/CMakeLists.txt | 12 ++-- source/CMakeLists.txt | 2 +- source/blender/blenlib/CMakeLists.txt | 4 +- source/blender/gpu/CMakeLists.txt | 92 ++++++++++++------------- tests/python/CMakeLists.txt | 2 +- 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a73a2fae1a..f73149adc04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -685,7 +685,7 @@ if(WIN32 OR XCODE) option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON) mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS) - if (IDE_GROUP_PROJECTS_IN_FOLDERS) + if(IDE_GROUP_PROJECTS_IN_FOLDERS) set_property(GLOBAL PROPERTY USE_FOLDERS ON) endif() endif() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index e0219cd1121..94d5fe1e31b 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1197,21 +1197,21 @@ endfunction() macro(openmp_delayload projectname ) - if(MSVC) - if(WITH_OPENMP) - if(MSVC_CLANG) - set(OPENMP_DLL_NAME "libomp") - elseif(MSVC_VERSION EQUAL 1800) - set(OPENMP_DLL_NAME "vcomp120") - else() - set(OPENMP_DLL_NAME "vcomp140") - endif() - set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") - set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib") - set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") - set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + if(MSVC) + if(WITH_OPENMP) + if(MSVC_CLANG) + set(OPENMP_DLL_NAME "libomp") + elseif(MSVC_VERSION EQUAL 1800) + set(OPENMP_DLL_NAME "vcomp120") + else() + set(OPENMP_DLL_NAME "vcomp140") endif() + set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib") + set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") endif() + endif() endmacro() macro(set_and_warn_dependency diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 1fdc8e60167..be76e8b0db1 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -113,6 +113,6 @@ if(WITH_MOD_FLUID) add_subdirectory(mantaflow) endif() -if (WITH_COMPOSITOR) +if(WITH_COMPOSITOR) add_subdirectory(smaa_areatex) endif() diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index f46d18a4926..8d9631e5b44 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -559,10 +559,10 @@ if(WITH_CYCLES_DEVICE_METAL) find_library(METAL_LIBRARY Metal) # This file was added in the 12.0 SDK, use it as a way to detect the version. - if (METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h") + if(METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h") message(STATUS "Metal version too old, must be SDK 12.0 or newer, disabling WITH_CYCLES_DEVICE_METAL") set(WITH_CYCLES_DEVICE_METAL OFF) - elseif (NOT METAL_LIBRARY) + elseif(NOT METAL_LIBRARY) message(STATUS "Metal not found, disabling WITH_CYCLES_DEVICE_METAL") set(WITH_CYCLES_DEVICE_METAL OFF) else() diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 84f156949aa..34d1ab1150e 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -291,7 +291,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) include(CheckSymbolExists) set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE) - if (HAVE_MEMFD_CREATE) + if(HAVE_MEMFD_CREATE) add_definitions(-DHAVE_MEMFD_CREATE) endif() @@ -307,7 +307,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) pkg_check_modules(wayland-protocols wayland-protocols>=1.15) - if (${wayland-protocols_FOUND}) + if(${wayland-protocols_FOUND}) pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) else() find_path(WAYLAND_PROTOCOLS_DIR @@ -316,7 +316,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) ) endif() - if (NOT EXISTS ${WAYLAND_PROTOCOLS_DIR}) + if(NOT EXISTS ${WAYLAND_PROTOCOLS_DIR}) message(FATAL_ERROR "path to wayland-protocols not found") endif() @@ -518,11 +518,11 @@ if(WITH_XR_OPENXR) ) elseif(UNIX AND NOT APPLE) list(APPEND XR_PLATFORM_DEFINES -DXR_OS_LINUX) - if (WITH_GHOST_WAYLAND) + if(WITH_GHOST_WAYLAND) list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_WAYLAND) endif() - if (WITH_GHOST_X11) - if (WITH_GL_EGL) + if(WITH_GHOST_X11) + if(WITH_GL_EGL) list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL) else() list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 6c2cbb5df33..73e16c38cb7 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -27,7 +27,7 @@ if(WITH_CLANG_TIDY AND NOT MSVC) message(WARNING "Currently Clang-Tidy might fail with GCC toolchain, switch to Clang toolchain if that happens") if(COMMAND target_precompile_headers) message(STATUS "Clang-Tidy and GCC precompiled headers are incompatible, disabling precompiled headers") - set(CMAKE_DISABLE_PRECOMPILE_HEADERS On) + set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON) endif() endif() diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index e9446f36c83..31e550379f1 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -363,8 +363,8 @@ if(WITH_GMP) endif() if(WIN32) - if (WITH_BLENDER_THUMBNAILER) - # Needed for querying the thumbnailer .dll in winstuff.c + if(WITH_BLENDER_THUMBNAILER) + # Needed for querying the `thumbnailer .dll` in `winstuff.c`. add_definitions(-DWITH_BLENDER_THUMBNAILER) endif() list(APPEND INC diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 49b6b478148..1219b04effa 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -402,57 +402,57 @@ list(APPEND SRC ${glsl_source_list_file}) list(APPEND INC ${CMAKE_CURRENT_BINARY_DIR}) set(SHADER_CREATE_INFOS -../draw/engines/workbench/shaders/infos/workbench_composite_info.hh -../draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh -../draw/engines/workbench/shaders/infos/workbench_effect_cavity_info.hh -../draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh -../draw/engines/workbench/shaders/infos/workbench_effect_outline_info.hh -../draw/engines/workbench/shaders/infos/workbench_merge_infront_info.hh -../draw/engines/workbench/shaders/infos/workbench_prepass_info.hh -../draw/engines/workbench/shaders/infos/workbench_shadow_info.hh -../draw/engines/workbench/shaders/infos/workbench_transparent_resolve_info.hh -../draw/engines/workbench/shaders/infos/workbench_volume_info.hh -../draw/intern/shaders/draw_fullscreen_info.hh -../draw/intern/shaders/draw_object_infos_info.hh -../draw/intern/shaders/draw_view_info.hh -../draw/intern/shaders/draw_hair_refine_info.hh + ../draw/engines/workbench/shaders/infos/workbench_composite_info.hh + ../draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh + ../draw/engines/workbench/shaders/infos/workbench_effect_cavity_info.hh + ../draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh + ../draw/engines/workbench/shaders/infos/workbench_effect_outline_info.hh + ../draw/engines/workbench/shaders/infos/workbench_merge_infront_info.hh + ../draw/engines/workbench/shaders/infos/workbench_prepass_info.hh + ../draw/engines/workbench/shaders/infos/workbench_shadow_info.hh + ../draw/engines/workbench/shaders/infos/workbench_transparent_resolve_info.hh + ../draw/engines/workbench/shaders/infos/workbench_volume_info.hh + ../draw/intern/shaders/draw_fullscreen_info.hh + ../draw/intern/shaders/draw_object_infos_info.hh + ../draw/intern/shaders/draw_view_info.hh + ../draw/intern/shaders/draw_hair_refine_info.hh -shaders/infos/gpu_clip_planes_info.hh -shaders/infos/gpu_shader_2D_area_borders_info.hh -shaders/infos/gpu_shader_2D_checker_info.hh -shaders/infos/gpu_shader_2D_diag_stripes_info.hh -shaders/infos/gpu_shader_2D_flat_color_info.hh -shaders/infos/gpu_shader_2D_image_color_info.hh -shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh -shaders/infos/gpu_shader_2D_image_info.hh -shaders/infos/gpu_shader_2D_image_multi_rect_color_info.hh -shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh -shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh -shaders/infos/gpu_shader_2D_image_rect_color_info.hh -shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh -shaders/infos/gpu_shader_2D_nodelink_info.hh -shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh -shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh -shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh -shaders/infos/gpu_shader_2D_smooth_color_info.hh -shaders/infos/gpu_shader_2D_uniform_color_info.hh -shaders/infos/gpu_shader_3D_depth_only_info.hh -shaders/infos/gpu_shader_3D_flat_color_info.hh -shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh -shaders/infos/gpu_shader_3D_point_info.hh -shaders/infos/gpu_shader_3D_smooth_color_info.hh -shaders/infos/gpu_shader_3D_uniform_color_info.hh -shaders/infos/gpu_shader_gpencil_stroke_info.hh -shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh -shaders/infos/gpu_shader_keyframe_shape_info.hh -shaders/infos/gpu_shader_simple_lighting_info.hh -shaders/infos/gpu_shader_text_info.hh -shaders/infos/gpu_srgb_to_framebuffer_space_info.hh + shaders/infos/gpu_clip_planes_info.hh + shaders/infos/gpu_shader_2D_area_borders_info.hh + shaders/infos/gpu_shader_2D_checker_info.hh + shaders/infos/gpu_shader_2D_diag_stripes_info.hh + shaders/infos/gpu_shader_2D_flat_color_info.hh + shaders/infos/gpu_shader_2D_image_color_info.hh + shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh + shaders/infos/gpu_shader_2D_image_info.hh + shaders/infos/gpu_shader_2D_image_multi_rect_color_info.hh + shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh + shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh + shaders/infos/gpu_shader_2D_image_rect_color_info.hh + shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh + shaders/infos/gpu_shader_2D_nodelink_info.hh + shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh + shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh + shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh + shaders/infos/gpu_shader_2D_smooth_color_info.hh + shaders/infos/gpu_shader_2D_uniform_color_info.hh + shaders/infos/gpu_shader_3D_depth_only_info.hh + shaders/infos/gpu_shader_3D_flat_color_info.hh + shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh + shaders/infos/gpu_shader_3D_point_info.hh + shaders/infos/gpu_shader_3D_smooth_color_info.hh + shaders/infos/gpu_shader_3D_uniform_color_info.hh + shaders/infos/gpu_shader_gpencil_stroke_info.hh + shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh + shaders/infos/gpu_shader_keyframe_shape_info.hh + shaders/infos/gpu_shader_simple_lighting_info.hh + shaders/infos/gpu_shader_text_info.hh + shaders/infos/gpu_srgb_to_framebuffer_space_info.hh ) set(SHADER_CREATE_INFOS_CONTENT "") foreach(DESCRIPTOR_FILE ${SHADER_CREATE_INFOS}) -string(APPEND SHADER_CREATE_INFOS_CONTENT "#include \"${DESCRIPTOR_FILE}\"\n") + string(APPEND SHADER_CREATE_INFOS_CONTENT "#include \"${DESCRIPTOR_FILE}\"\n") endforeach() set(shader_create_info_list_file "${CMAKE_CURRENT_BINARY_DIR}/gpu_shader_create_info_list.hh") diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 062dc5517db..d6575436bd6 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -692,7 +692,7 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS) foreach(render_test ${_cycles_render_tests}) # Enable just one simple test for Metal until more tests are passing. - if ((NOT (_cycles_device MATCHES "METAL")) OR (render_test MATCHES "camera")) + if((NOT (_cycles_device MATCHES "METAL")) OR (render_test MATCHES "camera")) add_python_test( cycles_${render_test}_${_cycles_device_lower} ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py