CMake - Cleaner absolute path checking, #3678.

This commit is contained in:
Morgan Hardwood
2017-04-09 16:10:29 +02:00
parent 5de2ff4b60
commit 7f71c611cb

View File

@@ -217,19 +217,11 @@ endif()
# Enforce absolute paths for non-bundle builds: # Enforce absolute paths for non-bundle builds:
if(NOT BUILD_BUNDLE) if(NOT BUILD_BUNDLE)
if(NOT(IS_ABSOLUTE "${BINDIR}")) foreach(path BINDIR DATADIR LIBDIR DOCDIR CREDITSDIR LICENCEDIR)
message(FATAL_ERROR "The BINDIR path has to be absolute, or use -DBUILD_BUNDLE=ON") if(NOT (IS_ABSOLUTE "${${path}}"))
elseif(NOT(IS_ABSOLUTE "${DATADIR}")) message (FATAL_ERROR "The ${path} path has to be absolute when using -DBUILD_BUNDLE=OFF")
message(FATAL_ERROR "The DATADIR path has to be absolute, or use -DBUILD_BUNDLE=ON") endif()
elseif(NOT(IS_ABSOLUTE "${LIBDIR}")) endforeach()
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()
endif() endif()
# MyMutex: # MyMutex: