[LyX/master] Cmake build: Extend build info in Help>About

Kornel Benko kornel at lyx.org
Wed Mar 25 12:33:15 UTC 2020


commit 3df9525a13de33b235d41a94cac9d2b1b8546c9b
Author: Kornel Benko <kornel at lyx.org>
Date:   Wed Mar 25 13:48:16 2020 +0100

    Cmake build: Extend build info in Help>About
    
    Added list of used cmake options and info about used compiler
---
 CMakeLists.txt |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76c4d57..202e341 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,8 +317,6 @@ else()
 endif()
 
 
-set(VERSION_INFO "CMake Build")
-
 # Try to get some informations from configure.ac
 
 include(LyXPaths)
@@ -1070,6 +1068,36 @@ endif()
 include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
 configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
 
+set(opts)
+foreach(_option ${LYX_OPTIONS})
+  if(${_option}_show_message)
+    string(SUBSTRING "${_option}                            " 0 31 _var)
+    get_property(_prop CACHE ${_option} PROPERTY STRINGS)
+    list(FIND LYX_OPTION_STRINGS ${_option} _index)
+    if (${_index} GREATER -1)
+      set(_isset ${${_option}})
+    elseif(${_option})
+      set(_isset ON)
+    else()
+      set(_isset OFF)
+    endif()
+    string(SUBSTRING "${_isset}           " 0 10 _val)
+    set(opts "${opts} ${_option}(${${_option}})")
+  endif()
+endforeach()
+set(VERSION_INFO "CMake Build")
+set(VERSION_INFO "${VERSION_INFO}\\n  Host name:               ${CMAKE_HOST_SYSTEM_NAME}")
+set(VERSION_INFO "${VERSION_INFO}\\n  Host processor:          ${CMAKE_HOST_SYSTEM_PROCESSOR}")
+set(VERSION_INFO "${VERSION_INFO}\\n  Build flags:             ${opts}")
+set(VERSION_INFO "${VERSION_INFO}\\n  C++ Compiler:            ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})")
+set(VERSION_INFO "${VERSION_INFO}\\n  C++ Compiler flags:      ${CMAKE_CXX_FLAGS}")
+if (LYX_DEBUG)
+set(VERSION_INFO "${VERSION_INFO}\\n  C++ Compiler user flags: ${CMAKE_CXX_FLAGS_DEBUG}")
+else()
+set(VERSION_INFO "${VERSION_INFO}\\n  C++ Compiler user flags: ${CMAKE_CXX_FLAGS_RELEASE}")
+endif()
+
+
 configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
 
 if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")


More information about the lyx-cvs mailing list