summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2013-08-19 22:34:47 -0700
committerChad Versace <chad.versace@linux.intel.com>2013-08-19 23:46:51 -0700
commitef15984dca3f67d78eb6026970537442d7450830 (patch)
tree66488fb9b7bfef8e9b725b508ac28c912bedb0e7 /CMakeLists.txt
parent4915962cb59ffa7c7c0eae799595fca5f4ca5ba7 (diff)
cmake: Refactor option validation
Move validation of options into a new module WaffleValidateOptions. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt51
1 files changed, 1 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4892d3..4d94054 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,62 +34,13 @@ cmake_minimum_required(VERSION 2.8)
include(Options.cmake)
include(WaffleDefineInternalOptions)
+include(WaffleValidateOptions)
include(WaffleDefineVersion)
include(WaffleDefineCompilerFlags)
include(GNUInstallDirs)
find_package(PkgConfig)
-# ----------------------------------------------
-# Emit errors for removed options
-# ----------------------------------------------
-
-if(DEFINED waffle_install_includedir)
- message(FATAL_ERROR "Option waffle_install_includedir has been "
- "replaced by CMAKE_INSTALL_INCLUDEDIR. You may need to edit the "
- "CMakeCache to delete the option. See /doc/building.txt for "
- "details.")
-endif()
-
-if(DEFINED waffle_install_libdir)
- message(FATAL_ERROR "Option waffle_install_libdir has been "
- "replaced by CMAKE_INSTALL_LIBDIR. You may need to edit the "
- "CMakeCache to delete the option. See /doc/building.txt for "
- "details.")
-endif()
-
-if(DEFINED waffle_install_docdir)
- message(FATAL_ERROR "Option waffle_install_docdir has been "
- "replaced by CMAKE_INSTALL_DOCDIR. You may need to edit the "
- "CMakeCache to delete the option. See /doc/building.txt for "
- "details.")
-endif()
-
-# ----------------------------------------------
-# Validate waffle options
-# ----------------------------------------------
-
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- if(NOT waffle_has_glx AND NOT waffle_has_wayland AND
- NOT waffle_has_x11_egl AND NOT waffle_has_gbm)
- message(FATAL_ERROR
- "Must enable at least one of: "
- "waffle_has_glx, waffle_has_wayland, "
- "waffle_has_x11_egl, waffle_has_gbm.")
- endif()
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- if(waffle_has_glx)
- message(FATAL_ERROR "Option is not supported on Darwin: waffle_has_glx.")
- endif()
- if(waffle_has_wayland)
- message(FATAL_ERROR "Option is not supported on Darwin: waffle_has_wayland.")
- endif()
- if(waffle_has_x11_egl)
- message(FATAL_ERROR "Option is not supported on Darwin: waffle_has_x11_egl.")
- endif()
-endif()
-
-
# ------------------------------------------------------------------------------
# Find Libraries
# ------------------------------------------------------------------------------