Skip to content

Commit 36a19c5

Browse files
authored
warn user if any of the submodules is not initialised (#297)
1 parent c8b0913 commit 36a19c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77
cmake_minimum_required(VERSION 3.8) # CXX17
88

9-
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/gitmodules/pybind11/include/pybind11/pybind11.h" )
10-
message(FATAL_ERROR "git submodules not initialised.\n Please run `git submodule update --init`")
11-
endif()
9+
file(GLOB mods RELATIVE ${CMAKE_SOURCE_DIR} gitmodules/*)
10+
foreach(mod ${mods})
11+
file(GLOB tmp RELATIVE ${CMAKE_SOURCE_DIR} ${mod}/*)
12+
if (tmp STREQUAL "")
13+
message(FATAL_ERROR "git submodule ${mod} not initialised.\n Please run `git submodule update --init`")
14+
endif()
15+
endforeach()
1216

1317
project(_PyPartMC LANGUAGES C CXX Fortran)
1418

0 commit comments

Comments
 (0)