cmake: allow turn off cmake summary

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2023-02-08 13:19:23 +08:00
parent c461a1cf51
commit 6048349e52
1 changed files with 50 additions and 43 deletions

View File

@ -42,6 +42,7 @@ option(FRAMELESSHELPER_ENABLE_VCLTL "MSVC only: link to the system MSVCRT/UCRT a
option(FRAMELESSHELPER_ENABLE_YYTHUNKS "MSVC only: dynamic load most Win32 APIs to give better compatibility for old Windows versions." OFF) option(FRAMELESSHELPER_ENABLE_YYTHUNKS "MSVC only: dynamic load most Win32 APIs to give better compatibility for old Windows versions." OFF)
option(FRAMELESSHELPER_NO_PERMISSIVE_CHECKS "MSVC only: disable the additional permissive checks." OFF) option(FRAMELESSHELPER_NO_PERMISSIVE_CHECKS "MSVC only: disable the additional permissive checks." OFF)
option(FRAMELESSHELPER_NO_INSTALL "Don't install any files." OFF) option(FRAMELESSHELPER_NO_INSTALL "Don't install any files." OFF)
option(FRAMELESSHELPER_NO_SUMMARY "Don't show CMake configure summary." OFF)
if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE) if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE)
message(WARNING "Nothing will be embeded into FramelessHelper, the chrome buttons will have no icon.") message(WARNING "Nothing will be embeded into FramelessHelper, the chrome buttons will have no icon.")
@ -109,47 +110,53 @@ if(FRAMELESSHELPER_BUILD_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
endif() endif()
message("#######################################") if(NOT FRAMELESSHELPER_NO_SUMMARY)
message("CMake version: ${CMAKE_VERSION}") message("#######################################")
message("Host system: ${CMAKE_HOST_SYSTEM}") message("CMake version: ${CMAKE_VERSION}")
message("Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}") message("Host system: ${CMAKE_HOST_SYSTEM}")
#message("C compiler: ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER})") # Currently we are not using any C compilers. message("Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
#message("C compiler version: ${CMAKE_C_COMPILER_VERSION}") #message("C compiler: ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER})") # Currently we are not using any C compilers.
message("C++ compiler: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER})") #message("C compiler version: ${CMAKE_C_COMPILER_VERSION}")
message("C++ compiler version: ${CMAKE_CXX_COMPILER_VERSION}") message("C++ compiler: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER})")
message("Linker: ${CMAKE_LINKER}") message("C++ compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
message("Make program: ${CMAKE_MAKE_PROGRAM}") message("Linker: ${CMAKE_LINKER}")
message("Build type: ${CMAKE_BUILD_TYPE}") message("Make program: ${CMAKE_MAKE_PROGRAM}")
message("Install prefix: ${CMAKE_INSTALL_PREFIX}") message("Build type: ${CMAKE_BUILD_TYPE}")
message("#######################################") message("Install prefix: ${CMAKE_INSTALL_PREFIX}")
set(__qt_inst_dir) message("#######################################")
if(DEFINED Qt6_DIR) set(__qt_inst_dir)
if(DEFINED Qt6_DIR)
set(__qt_inst_dir "${Qt6_DIR}") set(__qt_inst_dir "${Qt6_DIR}")
else() else()
set(__qt_inst_dir "${Qt5_DIR}") set(__qt_inst_dir "${Qt5_DIR}")
endif() endif()
# /whatever/Qt/6.4.0/gcc_64/lib/cmake/Qt6 # /whatever/Qt/6.4.0/gcc_64/lib/cmake/Qt6
set(__qt_inst_dir ${__qt_inst_dir}/../../..) set(__qt_inst_dir ${__qt_inst_dir}/../../..)
cmake_path(NORMAL_PATH __qt_inst_dir) cmake_path(NORMAL_PATH __qt_inst_dir)
message("Qt install dir: ${__qt_inst_dir}") message("Qt install dir: ${__qt_inst_dir}")
message("Qt version: ${QT_VERSION}") message("Qt version: ${QT_VERSION}")
get_target_property(__qt_type Qt${QT_VERSION_MAJOR}::Core TYPE) get_target_property(__qt_type Qt${QT_VERSION_MAJOR}::Core TYPE)
if(__qt_type STREQUAL "STATIC_LIBRARY") if(__qt_type STREQUAL "STATIC_LIBRARY")
set(__qt_type static) set(__qt_type static)
else() else()
set(__qt_type shared) set(__qt_type shared)
endif()
message("Qt library type: ${__qt_type}")
message("#######################################")
message("FramelessHelper version: ${PROJECT_VERSION}")
message("FramelessHelper commit hash: ${PROJECT_VERSION_COMMIT}")
message("FramelessHelper configure date and time: ${PROJECT_COMPILE_DATETIME} (UTC)")
message("Build the static version of FramelessHelper: ${FRAMELESSHELPER_BUILD_STATIC}")
message("Build the FramelessHelper::Widgets module: ${FRAMELESSHELPER_BUILD_WIDGETS}")
message("Build the FramelessHelper::Quick module: ${FRAMELESSHELPER_BUILD_QUICK}")
message("Build the FramelessHelper demo applications: ${FRAMELESSHELPER_BUILD_EXAMPLES}")
message("Deploy Qt libraries after compilation: ${FRAMELESSHELPER_EXAMPLES_DEPLOYQT}")
message("Suppress debug messages from FramelessHelper: ${FRAMELESSHELPER_NO_DEBUG_OUTPUT}")
message("Do not bundle any resources within FramelessHelper: ${FRAMELESSHELPER_NO_BUNDLE_RESOURCE}")
message("Do not use any private functionalities from Qt: ${FRAMELESSHELPER_NO_PRIVATE}")
message("[MSVC] Link to system C runtime library: ${FRAMELESSHELPER_ENABLE_VCLTL}")
message("[MSVC] Thunk system APIs for old system: ${FRAMELESSHELPER_ENABLE_YYTHUNKS}")
message("[MSVC] Disable permissive checks: ${FRAMELESSHELPER_NO_PERMISSIVE_CHECKS}")
message("Do not install anything for CMake install: ${FRAMELESSHELPER_NO_INSTALL}")
message("#######################################")
endif() endif()
message("Qt library type: ${__qt_type}")
message("#######################################")
message("FramelessHelper version: ${PROJECT_VERSION}")
message("FramelessHelper commit hash: ${PROJECT_VERSION_COMMIT}")
message("FramelessHelper configure date and time: ${PROJECT_COMPILE_DATETIME} (UTC)")
message("Build the static version of FramelessHelper: ${FRAMELESSHELPER_BUILD_STATIC}")
message("Build the FramelessHelper::Widgets module: ${FRAMELESSHELPER_BUILD_WIDGETS}")
message("Build the FramelessHelper::Quick module: ${FRAMELESSHELPER_BUILD_QUICK}")
message("Build the FramelessHelper demo applications: ${FRAMELESSHELPER_BUILD_EXAMPLES}")
message("Deploy Qt libraries after compilation: ${FRAMELESSHELPER_EXAMPLES_DEPLOYQT}")
message("Suppress debug messages from FramelessHelper: ${FRAMELESSHELPER_NO_DEBUG_OUTPUT}")
message("Do not bundle any resources within FramelessHelper: ${FRAMELESSHELPER_NO_BUNDLE_RESOURCE}")
message("Do not use any private functionalities from Qt: ${FRAMELESSHELPER_NO_PRIVATE}")
message("#######################################")