From 3a15643b906f186c87b4777b0ed95f04712dcb82 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Thu, 5 Sep 2019 14:22:52 -0400 Subject: 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 --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '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 " -- cgit v1.2.3