diff --git a/CMakeLists.txt b/CMakeLists.txt index 30e1d1fc5..d1893ca33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,19 +217,11 @@ endif() # Enforce absolute paths for non-bundle builds: if(NOT BUILD_BUNDLE) - if(NOT(IS_ABSOLUTE "${BINDIR}")) - message(FATAL_ERROR "The BINDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - elseif(NOT(IS_ABSOLUTE "${DATADIR}")) - message(FATAL_ERROR "The DATADIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - elseif(NOT(IS_ABSOLUTE "${LIBDIR}")) - message(FATAL_ERROR "The LIBDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - elseif(NOT(IS_ABSOLUTE "${DOCDIR}")) - message(FATAL_ERROR "The DOCDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - elseif(NOT(IS_ABSOLUTE "${CREDITSDIR}")) - message(FATAL_ERROR "The CREDITSDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - elseif(NOT(IS_ABSOLUTE "${LICENCEDIR}")) - message(FATAL_ERROR "The LICENCEDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") - endif() + foreach(path BINDIR DATADIR LIBDIR DOCDIR CREDITSDIR LICENCEDIR) + if(NOT (IS_ABSOLUTE "${${path}}")) + message (FATAL_ERROR "The ${path} path has to be absolute when using -DBUILD_BUNDLE=OFF") + endif() + endforeach() endif() # MyMutex: