diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2013-08-18 10:21:48 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2013-08-19 23:04:47 -0700 |
commit | bc298fa384a0b928e6b9de1b9f2f0091bd2b90b5 (patch) | |
tree | 5ce590aaaa4a0d487c6da116c928076de6a3bdb9 | |
parent | eebc0fd464ebebc2dbfbd3db8f57c6ee8df28ce9 (diff) |
cmake,readme: Move Waffle's CMake options to new file Options.cmake
This makes it easy for users to find all the custom CMake options
defined by Waffle. Update the README accordingly.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | CMakeLists.txt | 30 | ||||
-rw-r--r-- | Options.cmake | 15 | ||||
-rw-r--r-- | README.txt | 8 |
3 files changed, 19 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cfbcdb0..2714b83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,7 @@ set(waffle_soversion "0") # Includes # ------------------------------------------------------------------------------ +include(Options.cmake) include(CheckThreadLocalStorage) # @@ -74,35 +75,6 @@ set(PROJECT_NAME "waffle") find_package(PkgConfig) - -# ------------------------------------------------------------------------------ -# Waffle Options -# ------------------------------------------------------------------------------ - -# All options here are prefixed with `waffle_`. Most options are cache -# variables set by the user. - -# ---------------------------------------------- -# Set waffle options -# ---------------------------------------------- - -option(waffle_build_tests "Build tests" ON) - -# Most users don't have the necessary tools installed to build from -# Docbook sources, so require users to explicitly enable building them. -option(waffle_build_manpages "Build manpages" OFF) -option(waffle_build_htmldoc "Build html documentation" OFF) - -option(waffle_build_examples "Build examples" ON) - -option(waffle_has_glx "Build support for GLX" OFF) -option(waffle_has_wayland "Build support for Wayland" OFF) -option(waffle_has_x11_egl "Build support for X11/EGL" OFF) -option(waffle_has_gbm "Build support for GBM" OFF) - -set(waffle_xsltproc "xsltproc" - CACHE STRING "Tool used to process XSLT stylesheets") - # ---------------------------------------------- # Emit errors for removed options # ---------------------------------------------- diff --git a/Options.cmake b/Options.cmake new file mode 100644 index 0000000..cc50dc5 --- /dev/null +++ b/Options.cmake @@ -0,0 +1,15 @@ +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + # On Linux, you must enable at least one of the below options. + option(waffle_has_glx "Build support for GLX" OFF) + option(waffle_has_wayland "Build support for Wayland" OFF) + option(waffle_has_x11_egl "Build support for X11/EGL" OFF) + option(waffle_has_gbm "Build support for GBM" OFF) +endif() + +option(waffle_build_tests "Build tests" ON) +option(waffle_build_manpages "Build manpages" OFF) +option(waffle_build_htmldoc "Build html documentation" OFF) +option(waffle_build_examples "Build example programs" ON) + +set(waffle_xsltproc "xsltproc" + CACHE STRING "Program for processing XSLT stylesheets. Used for building docs.") @@ -121,9 +121,8 @@ a dependeny into /usr/local, then: export PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/local/$libdir/pkgconfig:$PKG_CONFIG_PATH -2. Configure Waffle with CMake -------------------------------- - +2. Configure CMake +------------------ On Linux, you likely want to call cmake with the following arguments. It configures Waffle in debug mode and with support for only GLX. @@ -136,8 +135,7 @@ If in addition to GLX you want support for X11/EGL, then add -Dwaffle_has_x11_egl=1 to the cmake arguments. Likewise for Wayland, add -Dwaffle_has_wayland=1; and for GBM, add -Dwaffle_has_gbm=1. -To build the manpages, add -Dwaffle_build_manpages=1. To build the html -documentation, add -Dwaffle_build_htmldocs=1. +For the full list of Waffle's custom CMake options, see file `Options.cmake`. To install into a custom location, autoconf-esque variables such as CMAKE_INSTALL_LIBDIR are supported. See |