From 842f0d3d44f31d05f7200199945fa44fa031097b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Tue, 10 May 2011 20:25:31 +0000 Subject: [PATCH] cmake: -Dhelp=1 lists all options git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38696 a592a061-630c-0410-9148-cb99ea01b6c8 --- CMakeLists.txt | 22 ++++++++++++++++++---- INSTALL.cmake | 6 +++--- development/cmake/modules/LyXMacros.cmake | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61a727affa..d51b5de721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ cmake_minimum_required(VERSION 2.6.4) set(LYX_PROJECT lyx) -project(${LYX_PROJECT}) set(LYX_CMAKE_DIR "development/cmake") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/${LYX_CMAKE_DIR}/modules") @@ -17,13 +16,13 @@ get_filename_component(TOP_SRC_DIR ${lyx_dir_readme} PATH) set(CMAKE_PROJECT_NAME ${LYX_PROJECT}) +message(STATUS) if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(STATUS "Building in-source") set(TOP_BINARY_DIR "${CMAKE_BINARY_DIR}/build") else() message(STATUS "Building out-of-source") set(TOP_BINARY_DIR "${CMAKE_BINARY_DIR}") - #cmake_policy(SET CMP0013 OLD) endif() @@ -82,7 +81,21 @@ LYX_OPTION(WALL "Enable all warnings" OFF MSVC) LYX_OPTION(CONFIGURE_CHECKS "Also run configure checks for MSVC" OFF MSVC) LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC) + +if(help OR HELP) + message(STATUS) + message(STATUS "Available options: (dis/enable with -D=0/1)") + message(STATUS) + LYX_OPTION_LIST_ALL(help) + message(STATUS) +else() + +# 'project' triggers the searching for a compiler +project(${LYX_PROJECT}) + + # Check option dependencies + if(LYX_CPACK) set(LYX_INSTALL ON) endif() @@ -151,7 +164,7 @@ set(VERSION_INFO "CMake Build") # Try to get some informations from configure.ac -include(LyXPaths) #called here to define the needed TOP_SRC_DIR-variable +include(LyXPaths) file(STRINGS "${TOP_SRC_DIR}/configure.ac" _config_lines) if(WIN32) @@ -518,7 +531,7 @@ endif() message(STATUS) message(STATUS "Build options, switch LYX_* variables by -DLYX_*=1 or 0:") message(STATUS) -LYX_OPTION_LIST_ALL() +LYX_OPTION_LIST_ALL(used) set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}") @@ -604,4 +617,5 @@ endif() # message(STATUS) +endif() #help diff --git a/INSTALL.cmake b/INSTALL.cmake index 69dafe829f..980eb8556a 100644 --- a/INSTALL.cmake +++ b/INSTALL.cmake @@ -132,17 +132,17 @@ Build options Options could be passed by the -D prefix when running cmake. Available options will be listed on each cmake run. - Here the options with their default value: + -Dhelp=1 lists all available options: # Available on all systems/compilers -- LYX_CPACK = OFF : Use the CPack management (Implies LYX_INSTALL option) -- LYX_INSTALL = OFF : Build install projects/rules (implies a bunch of other options) - -- LYX_NLS = OFF : Use nls + -- LYX_NLS = ON : Use nls -- LYX_ASPELL = OFF : Require aspell -- LYX_ENCHANT = OFF : Require Enchant -- LYX_HUNSPELL = OFF : Require Hunspell -- LYX_DEVEL_VERSION = OFF : Build developer version - -- LYX_RELEASE = ON : Build release version, build debug when disabled + -- LYX_RELEASE = OFF : Build release version, build debug when disabled -- LYX_PACKAGE_SUFFIX = ON : Use version suffix for packaging -- LYX_PCH = OFF : Use precompiled headers -- LYX_MERGE_FILES = OFF : Merge source files into one compilation unit diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index d67a38280a..57c7e7a69d 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -261,7 +261,7 @@ endmacro() macro(LYX_OPTION_LIST_ALL) foreach(_option ${LYX_OPTIONS}) - if(${_option}_show_message) + if(${_option}_show_message OR ${ARGV0} STREQUAL "help") string(SUBSTRING "${_option} " 0 25 _var) if(${_option}) set(_isset ON)