[Bf-blender-cvs] [3a15643b906] master: Cleanup: Cmake submodule checks
Aaron Carlisle
noreply at git.blender.org
Thu Sep 5 20:29:00 CEST 2019
Commit: 3a15643b906f186c87b4777b0ed95f04712dcb82
Author: Aaron Carlisle
Date: Thu Sep 5 14:22:52 2019 -0400
Branches: master
https://developer.blender.org/rB3a15643b906f186c87b4777b0ed95f04712dcb82
Cleanup: Cmake submodule checks
It is a pain if the subfile we are checking if it exists gets
renamed/removed.
Instead we can check if the directory is empty.
Reviewers: mont29
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D5653
===================================================================
M CMakeLists.txt
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2939d33c4a8..747acf27c64 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -752,14 +752,12 @@ if(NOT WITH_CUDA_DYNLOAD)
endif()
#-----------------------------------------------------------------------------
-# Check for valid directories
-# ... a partial checkout may cause this.
-#
-# note: we need to check for a known subdir in both cases.
-# since uninitialized git submodules will give blank dirs
+# Check check if submodules are cloned
if(WITH_INTERNATIONAL)
- if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/datafiles/locale/languages")
+ file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
+ list(LENGTH RESULT DIR_LEN)
+ if(DIR_LEN EQUAL 0)
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 "
@@ -781,7 +779,9 @@ if(WITH_PYTHON)
message(FATAL_ERROR "At least Python 3.7 is required to build")
endif()
- if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules")
+ file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
+ list(LENGTH RESULT DIR_LEN)
+ if(DIR_LEN EQUAL 0)
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 "
More information about the Bf-blender-cvs
mailing list