diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c69342e7..bba81e8b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) include(AutoVersioning) include(ConfigOptions) +include(BuildFeatureCheck) include(FindOptionalPackage) include(CheckCCompilerFlag) include(GNUInstallDirsWrapper) diff --git a/cmake/BuildFeatureCheck.cmake b/cmake/BuildFeatureCheck.cmake new file mode 100644 index 000000000..82bf556f6 --- /dev/null +++ b/cmake/BuildFeatureCheck.cmake @@ -0,0 +1,24 @@ +# Central location to check for cmake (version) requirements +# +#============================================================================= +# Copyright 2012 Bernhard Miklautz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# If WITH_MONOLITHIC_BUILD is used with cmake < 2.8.8 build fails +if (WITH_MONOLITHIC_BUILD) + if(${CMAKE_VERSION} VERSION_LESS 2.8.8) + message(FATAL_ERROR "CMAKE version >= 2.8.8 required for WITH_MONOLITHIC_BUILD") + endif() +endif(WITH_MONOLITHIC_BUILD)