[Bf-blender-cvs] [6d3cc9c38a7] master: Cleanup: cmake indentation

Campbell Barton noreply at git.blender.org
Sat Dec 17 03:16:00 CET 2022


Commit: 6d3cc9c38a7a951beb964b20089223df78204033
Author: Campbell Barton
Date:   Sat Dec 17 12:28:10 2022 +1100
Branches: master
https://developer.blender.org/rB6d3cc9c38a7a951beb964b20089223df78204033

Cleanup: cmake indentation

===================================================================

M	build_files/build_environment/cmake/harvest.cmake

===================================================================

diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index 252e52361c5..4ea121492e2 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -11,276 +11,301 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
 
 if(WIN32)
 
-if(BUILD_MODE STREQUAL Release)
-  add_custom_target(Harvest_Release_Results
-    COMMAND # jpeg rename libfile + copy include
+  if(BUILD_MODE STREQUAL Release)
+    add_custom_target(Harvest_Release_Results
+      COMMAND # JPEG rename lib-file + copy include.
       ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
       ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
-      # png
+      # PNG.
       ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
       ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
-      # freeglut-> opengl
+      # FREEGLUT -> OPENGL.
       ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
       ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
-    DEPENDS
-  )
-endif()
-
-else(WIN32)
-
-function(harvest from to)
-  set(pattern "")
-  foreach(f ${ARGN})
-    set(pattern ${f})
-  endforeach()
 
-  if(pattern STREQUAL "")
-    get_filename_component(dirpath ${to} DIRECTORY)
-    get_filename_component(filename ${to} NAME)
-    install(
-      FILES ${LIBDIR}/${from}
-      DESTINATION ${HARVEST_TARGET}/${dirpath}
-      RENAME ${filename}
-    )
-  else()
-    install(
-      DIRECTORY ${LIBDIR}/${from}/
-      DESTINATION ${HARVEST_TARGET}/${to}
-      USE_SOURCE_PERMISSIONS
-      FILES_MATCHING PATTERN ${pattern}
-      PATTERN "pkgconfig" EXCLUDE
-      PATTERN "cmake" EXCLUDE
-      PATTERN "__pycache__" EXCLUDE
-      PATTERN "tests" EXCLUDE
-      PATTERN "meson*" EXCLUDE
+      DEPENDS
     )
   endif()
-endfunction()
 
-# Set rpath on shared libraries to $ORIGIN since all will be installed in the same
-# lib folder, and remove any absolute paths.
-#
-# Ideally this would be done as part of the Blender build since it makes assumptions
-# about where the files will be installed. However it would add patchelf as a new
-# dependency for building.
-#
-# Also removes versioned symlinks, which give errors with macOS notarization.
-if(APPLE)
-  set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path)
 else()
-  set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
-endif()
 
-function(harvest_rpath_lib from to pattern)
-  harvest(${from} ${to} ${pattern})
+  function(harvest from to)
+    set(pattern "")
+    foreach(f ${ARGN})
+      set(pattern ${f})
+    endforeach()
+
+    if(pattern STREQUAL "")
+      get_filename_component(dirpath ${to} DIRECTORY)
+      get_filename_component(filename ${to} NAME)
+      install(
+        FILES ${LIBDIR}/${from}
+        DESTINATION ${HARVEST_TARGET}/${dirpath}
+        RENAME ${filename}
+      )
+    else()
+      install(
+        DIRECTORY ${LIBDIR}/${from}/
+        DESTINATION ${HARVEST_TARGET}/${to}
+        USE_SOURCE_PERMISSIONS
+        FILES_MATCHING PATTERN ${pattern}
+        PATTERN "pkgconfig" EXCLUDE
+        PATTERN "cmake" EXCLUDE
+        PATTERN "__pycache__" EXCLUDE
+        PATTERN "tests" EXCLUDE
+        PATTERN "meson*" EXCLUDE
+      )
+    endif()
+  endfunction()
 
-  install(CODE "\
-    cmake_policy(SET CMP0009 NEW)\n
-    file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
-    foreach(f \${shared_libs}) \n
-      if(IS_SYMLINK \${f})\n
-        if(APPLE)\n
-          file(REMOVE_RECURSE \${f})
+  # Set rpath on shared libraries to $ORIGIN since all will be installed in the same
+  # lib folder, and remove any absolute paths.
+  #
+  # Ideally this would be done as part of the Blender build since it makes assumptions
+  # about where the files will be installed. However it would add patchelf as a new
+  # dependency for building.
+  #
+  # Also removes versioned symlinks, which give errors with macOS notarization.
+  if(APPLE)
+    set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path)
+  else()
+    set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
+  endif()
+
+  function(harvest_rpath_lib from to pattern)
+    harvest(${from} ${to} ${pattern})
+
+    install(CODE "\
+      cmake_policy(SET CMP0009 NEW)\n
+      file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
+      foreach(f \${shared_libs}) \n
+        if(IS_SYMLINK \${f})\n
+          if(APPLE)\n
+            file(REMOVE_RECURSE \${f})
+          endif()\n
+        else()\n
+          execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
         endif()\n
-      else()\n
-        execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
-      endif()\n
-    endforeach()")
-endfunction()
+      endforeach()")
+  endfunction()
 
-# Set rpath on utility binaries assuming they are run from their install location.
-function(harvest_rpath_bin from to pattern)
-  harvest(${from} ${to} ${pattern})
+  # Set rpath on utility binaries assuming they are run from their install location.
+  function(harvest_rpath_bin from to pattern)
+    harvest(${from} ${to} ${pattern})
 
-  install(CODE "\
-    file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
-    foreach(f \${shared_libs}) \n
-      execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
-    endforeach()")
-endfunction()
+    install(CODE "\
+      file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
+      foreach(f \${shared_libs}) \n
+        execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
+      endforeach()")
+  endfunction()
 
-# Set rpath on Python module to point to the shared libraries folder in the Blender
-# installation.
-function(harvest_rpath_python from to pattern)
-  harvest(${from} ${to} ${pattern})
+  # Set rpath on Python module to point to the shared libraries folder in the Blender
+  # installation.
+  function(harvest_rpath_python from to pattern)
+    harvest(${from} ${to} ${pattern})
 
-  install(CODE "\
-    file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
-    foreach(f \${shared_libs}) \n
-      if(IS_SYMLINK \${f})\n
-        if(APPLE)\n
-          file(REMOVE_RECURSE \${f})
+    install(CODE "\
+      file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
+      foreach(f \${shared_libs}) \n
+        if(IS_SYMLINK \${f})\n
+          if(APPLE)\n
+            file(REMOVE_RECURSE \${f})
+          endif()\n
+        else()\n
+          get_filename_component(f_dir \${f} DIRECTORY) \n
+          file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
+          execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
         endif()\n
-      else()\n
-        get_filename_component(f_dir \${f} DIRECTORY) \n
-        file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
-        execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
-      endif()\n
-    endforeach()")
-endfunction()
+      endforeach()")
+  endfunction()
 
-harvest(alembic/include alembic/include "*.h")
-harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
-harvest_rpath_bin(alembic/bin alembic/bin "*")
-harvest(brotli/include brotli/include "*.h")
-harvest(brotli/lib brotli/lib "*.a")
-harvest(boost/include boost/include "*")
-harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
-harvest(imath/include imath/include "*.h")
-harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
-harvest(ffmpeg/include ffmpeg/include "*.h")
-harvest(ffmpeg/lib ffmpeg/lib "*.a")
-harvest(fftw3/include fftw3/include "*.h")
-harvest(fftw3/lib fftw3/lib "*.a")
-harvest(flac/lib sndfile/lib "libFLAC.a")
-harvest(freetype/include freetype/include "*.h")
-harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
-harvest(fribidi/include fribidi/include "*.h")
-harvest(fribidi/lib fribidi/lib "*.a")
-harvest(epoxy/include epoxy/include "*.h")
-harvest(epoxy/lib epoxy/lib "*.a")
-harvest(gmp/include gmp/include "*.h")
-harvest(gmp/lib gmp/lib "*.a")
-harvest(harfbuzz/include harfbuzz/include "*.h")
-harvest(harfbuzz/lib harfbuzz/lib "*.a")
-harvest(jemalloc/include jemalloc/include "*.h")
-harvest(jemalloc/lib jemalloc/lib "*.a")
-harvest(jpeg/include jpeg/include "*.h")
-harvest(jpeg/lib jpeg/lib "libjpeg.a")
-harvest(lame/lib ffmpeg/lib "*.a")
-if(NOT APPLE)
-  harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
-  harvest(level-zero/lib level-zero/lib "*${SHAREDLIBEXT}*")
-endif()
-harvest(llvm/bin llvm/bin "clang-format")
-if(BUILD_CLANG_TOOLS)
-  harvest(llvm/bin llvm/bin "clang-tidy")
-  harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
-endif()
-harvest(llvm/include llvm/include "*")
-harvest(llvm/bin llvm/bin "llvm-config")
-harvest(llvm/lib llvm/lib "libLLVM*.a")
-harvest(llvm/lib llvm/lib "libclang*.a")
-harvest(llvm/lib/clang llvm/lib/clang "*.h")
-if(APPLE)
-  harvest(openmp/lib openmp/lib "libomp.dylib")
-  harvest(openmp/include openmp/include "*.h")
-endif()
-if(BLENDER_PLATFORM_ARM)
-  harvest(sse2neon sse2neon "*.h")
-endif()
-harvest(ogg/lib ffmpeg/lib "*.a")
-harvest(openal/include openal/include "*.h")
-if(UNIX AND NOT APPLE)
-  harvest(openal/lib openal/lib "*.a")
+  harvest(alembic/include alembic/include "*.h")
+  harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
+  harvest_rpath_bin(alembic/bin alembic/bin "*")
+  harvest(brotli/include brotli/include "*.h")
+  harvest(brotli/lib brotli/lib "*.a")
+  harvest(boost/include boost/include "*")
+  harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
+  harvest(imath/include imath/include "*.h")
+  harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
+  harvest(ffmpeg/include ffmpeg/include "*.h")
+  harvest(ffmpeg/lib ffmpeg/lib "*.a")
+  harvest(fftw3/include fftw3/include "*.h")
+  harvest(fftw3/lib fftw3/lib "*.a")
+  harvest(flac/lib sndfile/lib "libFLA

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list