Commit: fad7a30de31977dee8c090dc196c796e17d2fcde Author: Campbell Barton Date: Fri Sep 9 11:09:01 2022 +1000 Branches: master https://developer.blender.org/rBfad7a30de31977dee8c090dc196c796e17d2fcde
Cleanup: comments, spelling, line length for creator's CMake file =================================================================== M source/creator/CMakeLists.txt =================================================================== diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index a5afcefbc29..2aa534d55eb 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -26,9 +26,8 @@ if(HAVE_FEENABLEEXCEPT) endif() if(WITH_TBB) - # Force TBB libraries to be in front of MKL (part of OpenImageDenoise), so - # that it is initialized before MKL and static library initialization order - # issues are avoided. + # Force TBB libraries to be in front of MKL (part of `OpenImageDenoise`), so + # that it is initialized before MKL and static library initialization order issues are avoided. # # This isn't fully robust but seems to work. list(INSERT LIB 0 ${TBB_LIBRARIES}) @@ -58,7 +57,7 @@ endif() if(WITH_TBB) blender_include_dirs(${TBB_INCLUDE_DIRS}) if(WIN32) - # For pragma that links tbbmalloc_proxy.lib + # For `pragma` that links `tbbmalloc_proxy.lib`. link_directories(${LIBDIR}/tbb/lib) endif() endif() @@ -108,7 +107,7 @@ if(WITH_OPENCOLORIO) add_definitions(-DWITH_OCIO) endif() -# Setup the exe sources and buildinfo +# Setup the EXE sources and `buildinfo`. set(SRC creator.c creator_args.c @@ -117,7 +116,7 @@ set(SRC creator_intern.h ) -# MSVC 2010 gives linking errors with the manifest +# MSVC 2010 gives linking errors with the manifest. if(WIN32 AND NOT UNIX) add_definitions( -DBLEN_VER_RC_STR="${BLENDER_VERSION}" @@ -173,19 +172,20 @@ if(WITH_BUILDINFO) unset(BUILD_SYSTEM) # -------------------------------------------------------------------------- - # write header for values that change each build - # note, generated file is in build dir's source/creator - # except when used as an include path. + # Write header for values that change each build + # + # NOTE: generated file is in build directory `source/creator` + # except when used as an include path. add_definitions(-DWITH_BUILDINFO_HEADER) - # include the output directory, where the buildinfo.h file is generated + # Include the output directory, where the `buildinfo.h` file is generated. include_directories(${CMAKE_CURRENT_BINARY_DIR}) - # XXX, ${buildinfo_h_fake} is used here, + # XXX: `${buildinfo_h_fake}` is used here, # because we rely on that file being detected as missing - # every build so that the real header "buildinfo.h" is updated. + # every build so that the real header `buildinfo.h` is updated. # # Keep this until we find a better way to resolve! @@ -196,11 +196,12 @@ if(WITH_BUILDINFO) 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 + # From the CMAKE documentation "If the output of the custom command is not actually created as a # file on disk it should be marked with the SYMBOLIC source file property." # - # Not doing this leads to build warnings for the not generated file on windows when using msbuild - SET_SOURCE_FILES_PROPERTIES(${buildinfo_h_fake} PROPERTIES SYMBOLIC TRUE) + # Not doing this leads to build warnings for the not generated file on + # MS-Windows when using `msbuild`. + set_source_files_properties(${buildinfo_h_fake} PROPERTIES SYMBOLIC TRUE) # a custom target that is always built add_custom_target( @@ -208,19 +209,19 @@ if(WITH_BUILDINFO) DEPENDS ${buildinfo_h_fake} ) - # creates buildinfo.h using cmake script + # Creates `buildinfo.h` using CMAKE script. add_custom_command( 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 + # 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 + # `buildinfo.h` is a generated file. set_source_files_properties( ${buildinfo_h_real} PROPERTIES GENERATED TRUE @@ -229,7 +230,7 @@ if(WITH_BUILDINFO) unset(buildinfo_h_real) unset(buildinfo_h_fake) - # add deps below, after adding blender + # Add dependencies below, after adding Blender # -------------- done with header values. list(APPEND SRC @@ -247,10 +248,9 @@ add_cc_flags_custom_test(blender) if(WITH_PYTHON_MODULE) add_definitions(-DWITH_PYTHON_MODULE) - # Creates `./bpy/__init__.so` which can be imported as a python module. + # Creates `./bpy/__init__.so` which can be imported as a Python module. # - # note that 'SHARED' works on Linux and Windows, - # but not OSX which _must_ be 'MODULE' + # Note that 'SHARED' works on Linux and Windows, but not MACOS which _must_ be 'MODULE'. add_library(blender MODULE ${SRC}) @@ -276,7 +276,7 @@ if(WITH_PYTHON_MODULE) endif() if(WIN32) - # python modules use this + # Python modules use this. set_target_properties( blender PROPERTIES @@ -298,20 +298,22 @@ else() endif() if(WITH_BUILDINFO) - # explicitly say that the executable depends on the buildinfo + # Explicitly say that the executable depends on the `buildinfo`. add_dependencies(blender buildinfo) endif() set(BLENDER_TEXT_FILES ${CMAKE_SOURCE_DIR}/release/text/copyright.txt - # generate this file - # ${CMAKE_SOURCE_DIR}/release/text/readme.html + # Generate this file: + # `${CMAKE_SOURCE_DIR}/release/text/readme.html` ) # ----------------------------------------------------------------------------- -# Platform specific target destinations for version dir, libs, bpy, text files. +# Platform specific target destinations +# +# Setup version directory, libraries, `bpy` & text files. if(UNIX AND NOT APPLE) if(WITH_PYTHON_MODULE) @@ -365,7 +367,7 @@ elseif(APPLE) set(TARGETDIR_TEXT Blender.app/Contents/Resources/text) endif() - # Skip relinking on cpack / install + # Skip re-linking on CPACK / install. set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true) endif() @@ -388,14 +390,14 @@ if(WITH_PYTHON) "${BLENDER_VERSION_CYCLE}" STREQUAL "rc") set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*") else() - set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, won't do anything + set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # Dummy, won't do anything. endif() # do not install freestyle dir if disabled if(NOT WITH_FREESTYLE) set(FREESTYLE_EXCLUDE_CONDITIONAL "freestyle/*") else() - set(FREESTYLE_EXCLUDE_CONDITIONAL "_freestyle/*") # dummy, won't do anything + set(FREESTYLE_EXCLUDE_CONDITIONAL "_freestyle/*") # Dummy, won't do anything. endif() install( @@ -415,8 +417,7 @@ endif() # fonts install( - DIRECTORY - ${CMAKE_SOURCE_DIR}/release/datafiles/fonts + DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/fonts DESTINATION ${TARGETDIR_VER}/datafiles ) @@ -430,14 +431,14 @@ if(WITH_INTERNATIONAL) msgfmt_simple(${_po_file} _all_mo_files) endforeach() - # Create a custom target which will compile all po to mo + # Create a custom target which will compile all `*.po` to `*.mo`. add_custom_target( locales DEPENDS ${_all_mo_files} ) add_dependencies(blender locales) - # Generate INSTALL rules + # Generate INSTALL rules. install( FILES ${_locale_dir}/languages DESTINATION ${_locale_target_dir} @@ -462,7 +463,7 @@ if(WITH_INTERNATIONAL) unset(_locale_dir) endif() -# color management +# Color management. if(WITH_OPENCOLORIO) install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/colormanagement @@ -470,9 +471,9 @@ if(WITH_OPENCOLORIO) ) endif() -# helpful tip when using make +# Helpful tip when using make. if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*") - # message after building. + # Message to display after building. add_custom_command( TARGET blender POST_BUILD MAIN_DEPENDENCY blender COMMAND ${CMAKE_COMMAND} -E @@ -505,7 +506,7 @@ if(UNIX AND NOT APPLE) ) endif() - # there are a few differences between portable and system install + # There are a few differences between portable and system install. if(WITH_PYTHON_MODULE) if(WITH_INSTALL_PORTABLE) install( @@ -578,14 +579,14 @@ if(UNIX AND NOT APPLE) DESTINATION bin ) if(WITH_DOC_MANPAGE) - # manpage only with 'blender' binary + # Manual page (only with `blender` binary). install( FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1 DESTINATION share/man/man1 ) endif() - # misc files + # Misc files. install( FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop DESTINATION share/applications @@ -614,11 +615,9 @@ if(UNIX AND NOT APPLE) DESTINATION ${TARGETDIR_VER}/python/bin ) - # on some platforms (like openSUSE) Python is linked - # to be used from lib64 folder. - # determine this from Python's libraries path - # - # ugh, its possible 'lib64' is just a symlink to 'lib' which causes incorrect use of 'lib64' + # On some platforms (like openSUSE) Python is linked to be used from `lib64` directory. + # determine this from Python's libraries path. + # Ugh, its possible `lib64` is just a symlink to 'lib' which causes incorrect use of `lib64`. get_filename_component(_pypath_real ${PYTHON_LIBPATH} REALPATH) if(${_pypath_real} MATCHES "lib64$") set(_target_LIB "lib64") @@ -627,7 +626,7 @@ if(UNIX AND NOT APPLE) endif() unset(_pypath_real) - # Copy the systems python into the install directory + # Copy the systems python into the install directory: # install(CODE "message(\"copying a subset of the systems python...\")") install( DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION} @@ -645,8 +644,8 @@ if(UNIX AND NOT APPLE) PATTERN "wininst*.exe" EXCLUDE # from distutils, avoid malware false positive ) - # Needed for distutils/pip - # get the last part of the include dir, will be 'python{version}{a @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs