Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-23 07:33:44 +0300
committerCampbell Barton <campbell@blender.org>2022-09-23 07:33:44 +0300
commit998ace3463c73a172c62418e438bddc93f78a22e (patch)
treee384f1236d2d9c9bd40f8f6050e8364852974642 /build_files/cmake
parentadd1b6ab3c91d408635b311127224dd4cc33f1ab (diff)
Cleanup: use lowercase function calls & macros in for CMake
This is already the case for most CMake usage. Although some find modules are an exception to this, as they were originally maintained externally they use some different conventions. Also corrected bad indentation in: intern/cycles/CMakeLists.txt
Diffstat (limited to 'build_files/cmake')
-rw-r--r--build_files/cmake/buildinfo.cmake4
-rw-r--r--build_files/cmake/macros.cmake20
-rw-r--r--build_files/cmake/packaging.cmake6
-rw-r--r--build_files/cmake/platform/platform_unix.cmake2
-rw-r--r--build_files/cmake/platform/platform_win32.cmake10
5 files changed, 22 insertions, 20 deletions
diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake
index 53e22ed23ad..b0640acbe96 100644
--- a/build_files/cmake/buildinfo.cmake
+++ b/build_files/cmake/buildinfo.cmake
@@ -150,10 +150,10 @@ endif()
# BUILD_PLATFORM is taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
if(NOT BUILD_DATE)
- STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
+ string(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
endif()
if(NOT BUILD_TIME)
- STRING(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
+ string(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
endif()
# Write a file with the BUILD_HASH define
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index b197cd01bbb..d41024759fc 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -381,7 +381,7 @@ function(blender_add_test_suite)
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Figure out the release dir, as some tests need files from there.
- GET_BLENDER_TEST_INSTALL_DIR(TEST_INSTALL_DIR)
+ get_blender_test_install_dir(TEST_INSTALL_DIR)
if(APPLE)
set(_test_release_dir ${TEST_INSTALL_DIR}/Blender.app/Contents/Resources/${BLENDER_VERSION})
else()
@@ -424,10 +424,10 @@ function(blender_add_test_lib
# This duplicates logic that's also in GTestTesting.cmake, macro BLENDER_SRC_GTEST_EX.
# TODO(Sybren): deduplicate after the general approach in D7649 has been approved.
- LIST(APPEND includes
+ list(APPEND includes
${CMAKE_SOURCE_DIR}/tests/gtests
)
- LIST(APPEND includes_sys
+ list(APPEND includes_sys
${GLOG_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/extern/gtest/include
@@ -468,7 +468,7 @@ function(blender_add_test_executable
## Otherwise external projects will produce warnings that we cannot fix.
remove_strict_flags()
- BLENDER_SRC_GTEST_EX(
+ blender_src_gtest_ex(
NAME ${name}
SRC "${sources}"
EXTRA_LIBS "${library_deps}"
@@ -764,7 +764,7 @@ function(ADD_CHECK_C_COMPILER_FLAG
include(CheckCCompilerFlag)
- CHECK_C_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
+ check_c_compiler_flag("${_FLAG}" "${_CACHE_VAR}")
if(${_CACHE_VAR})
# message(STATUS "Using CFLAG: ${_FLAG}")
set(${_CFLAGS} "${${_CFLAGS}} ${_FLAG}" PARENT_SCOPE)
@@ -781,7 +781,7 @@ function(ADD_CHECK_CXX_COMPILER_FLAG
include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
+ check_cxx_compiler_flag("${_FLAG}" "${_CACHE_VAR}")
if(${_CACHE_VAR})
# message(STATUS "Using CXXFLAG: ${_FLAG}")
set(${_CXXFLAGS} "${${_CXXFLAGS}} ${_FLAG}" PARENT_SCOPE)
@@ -799,9 +799,11 @@ function(get_blender_version)
# - BLENDER_VERSION_PATCH
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
- # So cmake depends on BKE_blender.h, beware of inf-loops!
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h
- ${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender_version.h.done)
+ # So CMAKE depends on `BKE_blender.h`, beware of infinite-loops!
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h
+ ${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender_version.h.done
+ )
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
diff --git a/build_files/cmake/packaging.cmake b/build_files/cmake/packaging.cmake
index f6073eba82e..2f2e90dc934 100644
--- a/build_files/cmake/packaging.cmake
+++ b/build_files/cmake/packaging.cmake
@@ -17,9 +17,9 @@ set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
set(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
-SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
-SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
-SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
+set(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
+set(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
+set(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
# Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index d9f06811984..bfbc6b76b40 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -1089,7 +1089,7 @@ function(CONFIGURE_ATOMIC_LIB_IF_NEEDED)
endif()
endfunction()
-CONFIGURE_ATOMIC_LIB_IF_NEEDED()
+configure_atomic_lib_if_needed()
if(PLATFORM_BUNDLED_LIBRARIES)
# For the installed Python module and installed Blender executable, we set the
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 7d7efb83b8e..eeec4760b80 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -26,7 +26,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "/clang:-fopenmp")
set(OpenMP_CXX_FLAGS "/clang:-fopenmp")
- GET_FILENAME_COMPONENT(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE)
+ get_filename_component(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE)
set(CLANG_OPENMP_DLL "${LLVMROOT}/bin/libomp.dll")
set(CLANG_OPENMP_LIB "${LLVMROOT}/lib/libomp.lib")
if(NOT EXISTS "${CLANG_OPENMP_DLL}")
@@ -874,8 +874,8 @@ endif()
if(WINDOWS_PYTHON_DEBUG)
# Include the system scripts in the blender_python_system_scripts project.
- FILE(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
- ADD_CUSTOM_TARGET(blender_python_system_scripts SOURCES ${inFiles})
+ file(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
+ add_custom_target(blender_python_system_scripts SOURCES ${inFiles})
foreach(_source IN ITEMS ${inFiles})
get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}")
@@ -895,8 +895,8 @@ if(WINDOWS_PYTHON_DEBUG)
endif()
file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
- FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
- ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
+ file(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
+ add_custom_target(blender_python_user_scripts SOURCES ${inFiles})
foreach(_source IN ITEMS ${inFiles})
get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${USER_SCRIPTS_ROOT}" "" _source_path "${_source_path}")