diff --git a/cmake.sh b/cmake.sh index 2d3526f..6145a14 100755 --- a/cmake.sh +++ b/cmake.sh @@ -86,6 +86,15 @@ CMAKE_ARGS="" [ ! -f "${SOURCE_DIR}/CMakeLists.txt" ] && { echo "Source directory does not contain CMakeLists.txt"; exit 4; } +if grep -i ^"project.*fortran" "${SOURCE_DIR}/CMakeLists.txt" >/dev/null 2>&1 ; then + if [ -x "$(command -v make)" ]; then + GENERATOR="Unix Makefiles" + else + echo "Projects with Fortran sources need Make to build" + exit 5 + fi +fi + export GENERATOR export SOURCE_DIR export BUILD_DIR