From 62ee3c82919ff18b3062e847d7089fb86df1c62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 8 Jul 2011 20:53:59 +0000 Subject: [PATCH] cmake: create shell script with used options git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39260 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/modules/LyXMacros.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index 6df513654b..bb26e6687b 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -262,6 +262,12 @@ endmacro() macro(LYX_OPTION_LIST_ALL) + if(UNIX) + set(run_cmake ${CMAKE_BINARY_DIR}/run_cmake.sh) + file(WRITE ${run_cmake} "#!/bin/bash\n") + file(APPEND ${run_cmake} "cmake ${CMAKE_SOURCE_DIR} \\\n") + execute_process(COMMAND chmod 755 ${run_cmake}) + endif() foreach(_option ${LYX_OPTIONS}) if(${_option}_show_message OR ${ARGV0} STREQUAL "help") string(SUBSTRING "${_option} " 0 25 _var) @@ -273,7 +279,16 @@ macro(LYX_OPTION_LIST_ALL) string(SUBSTRING "${_isset} " 0 4 _val) message(STATUS "${_var}= ${_val} : ${${_option}_description}") endif() + if(UNIX) + file(APPEND ${run_cmake} " -D${_option}=${${_option}} \\\n") + endif() endforeach() + if(UNIX) + file(APPEND ${run_cmake} "\n") + message(STATUS) + message(STATUS "CMake command with options is available in shell script") + message(STATUS " '${run_cmake}'") + endif() endmacro() macro(lyx_add_info_files group)