Обновление подмодулей

This commit is contained in:
Andrei Astafev 2020-04-11 10:12:20 +03:00
parent d116e4db89
commit 026655f712
21 changed files with 112 additions and 206 deletions

View File

@ -6,12 +6,16 @@ if(CMAKE_CONFIGURATION_TYPES)
list(APPEND CMAKE_CONFIGURATION_TYPES Profile)
endif()
else()
set(_allowed_build_types None Debug Release Profile RelWithDebInfo MinSizeRel)
set(_allowed_build_types
None
Debug
Release
Profile
RelWithDebInfo
MinSizeRel)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_allowed_build_types})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
Debug
CACHE STRING "" FORCE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
elseif(NOT "${CMAKE_BUILD_TYPE}" IN_LIST _allowed_build_types)
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
endif()
@ -20,24 +24,12 @@ endif()
if(CMAKE_BUILD_TYPE STREQUAL Profile)
# Ключи компиляции для режима профилирования в зависимости от типа компилятора
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
set(CMAKE_C_FLAGS_PROFILE
"${CMAKE_C_FLAGS_RELEASE} -ggdb -pg"
CACHE STRING "")
set(CMAKE_CXX_FLAGS_PROFILE
"${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg"
CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_PROFILE
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg"
CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE
"${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg"
CACHE STRING "")
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE
"${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg"
CACHE STRING "")
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE
"${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -pg"
CACHE STRING "")
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
elseif(CMAKE_CXX_COMPILER_IS_Intel)
message("Set options for profiling with Intel C++")
elseif(CMAKE_CXX_COMPILER_IS_MSVC)
@ -50,27 +42,19 @@ elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
string(APPEND CMAKE_C_FLAGS_DEBUG " -ggdb")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -ggdb")
endif()
set(CMAKE_VERBOSE_MAKEFILE
ON
CACHE BOOL "Enable verbose build file generation." FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE BOOL "Enable output of compile commands during generation." FORCE)
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose build file generation." FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable output of compile commands during generation."
FORCE)
set(DEBUG 1)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
set(RELEASE 1)
elseif(CMAKE_BUILD_TYPE STREQUAL None)
# Режим None используется для статического анализа кода
set(ANALYSIS 1)
set(CMAKE_VERBOSE_MAKEFILE
ON
CACHE BOOL "Enable verbose build file generation." FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE BOOL "Enable output of compile commands during generation." FORCE)
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose build file generation." FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable output of compile commands during generation."
FORCE)
# set(USE_CLANG_TIDY ON CACHE BOOL "Use clang-tidy")
# set(USE_CPPCHECK ON CACHE BOOL "Use cppcheck")
set(USE_PVS_STUDIO
ON
CACHE BOOL "Use PVS-Studio")
set(USE_PVS_STUDIO ON CACHE BOOL "Use PVS-Studio")
endif()

View File

@ -12,7 +12,7 @@ set(CPACK_TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(CPACK_TARGET_ARCH "amd64")
endif()
set(CPACK_PACKAGE_FILE_NAME "${CMLIB_PROJECT_NAME_LOWER}_${CPACK_TARGET_ARCH}_${CPACK_PACKAGE_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CMLIB_PROJECT_NAME_LOWER}_${CPACK_TARGET_ARCH}_${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMLIB_PROJECT_NAME_LOWER}-${CPACK_PACKAGE_VERSION}")
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_LIST_DIR}/CMLibCPackProject.cmake)
@ -22,4 +22,3 @@ include(CMLibCPackDeb)
# Подключение модуля, выполняющего сборку архивов и пакетов
include(CPack)

View File

@ -19,14 +19,16 @@ list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL)
# Правило формирования имени пакета и файла для компонента MAIN
set(CPACK_DEBIAN_MAIN_PACKAGE_NAME "${CMLIB_PROJECT_NAME_LOWER}")
set(CPACK_DEBIAN_MAIN_FILE_NAME "${CMLIB_PROJECT_NAME_LOWER}_${CPACK_PACKAGE_VERSION}_${CPACK_TARGET_ARCH}.deb")
set(CPACK_DEBIAN_MAIN_FILE_NAME
"${CMLIB_PROJECT_NAME_LOWER}_${CPACK_PACKAGE_VERSION}_${CPACK_TARGET_ARCH}.deb")
# Правило формирования имени пакета и файла для остальных компонентов
foreach(C ${CPACK_COMPONENTS_ALL})
if(NOT "${C}" STREQUAL "MAIN")
string(TOLOWER "${C}" cl)
set(CPACK_DEBIAN_${C}_PACKAGE_NAME "${CMLIB_PROJECT_NAME_LOWER}-${cl}")
set(CPACK_DEBIAN_${C}_FILE_NAME "${CMLIB_PROJECT_NAME_LOWER}-${cl}_${CPACK_PACKAGE_VERSION}_${CPACK_TARGET_ARCH}.deb")
set(CPACK_DEBIAN_${C}_FILE_NAME
"${CMLIB_PROJECT_NAME_LOWER}-${cl}_${CPACK_PACKAGE_VERSION}_${CPACK_TARGET_ARCH}.deb")
endif()
endforeach()
@ -46,7 +48,5 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/cmake/deb/postrm")
endif()
if(UNIX AND NOT TARGET deb)
add_custom_target(deb
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND cpack -G DEB)
add_custom_target(deb WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND cpack -G DEB)
endif()

View File

@ -3,4 +3,3 @@ if(CPACK_GENERATOR MATCHES "DEB")
else()
set(CPACK_PACKAGING_INSTALL_PREFIX "${PROJECT_NAME}")
endif()

View File

@ -1,5 +1,12 @@
find_program(CLANG_CHECK_EXE NAMES clang-check-10 clang-check-9 clang-check-8 clang-check-7 clang-check-6.0
clang-check)
find_program(
CLANG_CHECK_EXE
NAMES
clang-check-10
clang-check-9
clang-check-8
clang-check-7
clang-check-6.0
clang-check)
if(CLANG_CHECK_EXE)
option(CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
endif()
@ -17,8 +24,7 @@ function(add_clang_analyze_check)
add_custom_target(clang-analyze-check)
endif()
add_custom_target(
clang-analyze-check-${_target}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clang-analyze-check-${_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CLANG_CHECK_EXE} -analyze -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR}
${_sources})
add_dependencies(clang-analyze-check-${_target} ${_target})

View File

@ -1,5 +1,12 @@
find_program(CLANG_TIDY_EXE NAMES clang-tidy-10 clang-tidy-9 clang-tidy-8 clang-tidy-7 clang-tidy-6.0
clang-tidy)
find_program(
CLANG_TIDY_EXE
NAMES
clang-tidy-10
clang-tidy-9
clang-tidy-8
clang-tidy-7
clang-tidy-6.0
clang-tidy)
if(CLANG_TIDY_EXE)
option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
if(CLANG_TIDY_FIX)
@ -17,8 +24,7 @@ function(add_clang_tidy_check)
add_custom_target(clang-tidy-check)
endif()
add_custom_target(
clang-tidy-check-${_target}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clang-tidy-check-${_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CLANG_TIDY_EXE} -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR} ${_sources})
add_dependencies(clang-tidy-check-${_target} ${_target})
add_dependencies(clang-tidy-check clang-tidy-check-${_target})

View File

@ -13,8 +13,7 @@ function(add_clazy_check)
add_custom_target(clazy-check)
endif()
add_custom_target(
clazy-check-${_target}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clazy-check-${_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CLAZY_EXE} -checks=level2,${clazy_checks} -extra-arg="-Wno-unknown-warning-option" -p
${CMAKE_BINARY_DIR} ${_sources})
add_dependencies(clazy-check-${_target} ${_target})

View File

@ -14,17 +14,14 @@ function(add_code_coverage)
if(LCOV_EXE)
add_custom_target(
coverage-${_target}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
coverage-${_target} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${LCOV_EXE} --test-name ${_target} --output "${_target}.lcov" --capture --directory
${CMAKE_BINARY_DIR})
add_dependencies(coverage-${_target} ${_target})
if(GENHTML_EXE)
add_custom_target(
coverage-report-${_target}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${GENHTML_EXE} --output-directory "report-${_target}" "${_target}.lcov")
add_custom_target(coverage-report-${_target} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${GENHTML_EXE} --output-directory "report-${_target}" "${_target}.lcov")
add_dependencies(coverage-report-${_target} coverage-${_target})
endif()
endif()

View File

@ -7,10 +7,7 @@ function(common_target_properties Name)
set(__interface 1)
set(__visibility INTERFACE)
endif()
target_compile_features(
${Name}
${__visibility}
${COMMON_CXX_FEATURES})
target_compile_features(${Name} ${__visibility} ${COMMON_CXX_FEATURES})
get_target_property(_targetType ${Name} TYPE)
if(_targetType STREQUAL "EXECUTABLE" AND CMAKE_CXX_COMPILE_OPTIONS_PIE)
target_compile_options(${Name} PUBLIC "${CMAKE_CXX_COMPILE_OPTIONS_PIE}")
@ -20,10 +17,7 @@ function(common_target_properties Name)
PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
if(APPLE)
target_compile_definitions(
${Name}
${__visibility}
Darwin)
target_compile_definitions(${Name} ${__visibility} Darwin)
endif()
if(NOT __interface)
if(TARGET Qt5::Core)
@ -53,22 +47,14 @@ function(common_target_properties Name)
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG)
if(CMAKE_CXX_COMPILER_IS_GCC AND CXX_HAS_LTO_FLAG)
find_program(CMAKE_GCC_AR NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_GCC_NM NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(
CMAKE_GCC_AR
NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar"
HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(
CMAKE_GCC_NM
NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm${_CMAKE_TOOLCHAIN_SUFFIX}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm"
HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(
CMAKE_GCC_RANLIB
NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib"
HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_AR
AND CMAKE_GCC_NM
AND CMAKE_GCC_RANLIB)
CMAKE_GCC_RANLIB NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
if(CXX_HAS_NO_FAT_LTO_FLAG)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-fat-lto-objects")
@ -86,25 +72,13 @@ function(common_target_properties Name)
endif()
if(CMAKE_BUILD_TYPE STREQUAL Profile)
target_compile_definitions(
${Name}
${__visibility}
PROFILE)
target_compile_definitions(${Name} ${__visibility} PROFILE)
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_definitions(
${Name}
${__visibility}
DEBUG)
target_compile_definitions(${Name} ${__visibility} DEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
target_compile_definitions(
${Name}
${__visibility}
RELEASE)
target_compile_definitions(${Name} ${__visibility} RELEASE)
elseif(CMAKE_BUILD_TYPE STREQUAL None)
target_compile_definitions(
${Name}
${__visibility}
ANALYSIS)
target_compile_definitions(${Name} ${__visibility} ANALYSIS)
endif()
target_compile_definitions(
${Name}

View File

@ -17,9 +17,8 @@ macro(CHECK_ENABLE_CXX_FLAG flag)
unset(CHECK_CXX_FLAG CACHE)
endmacro()
if(LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE"
AND LSB_CODENAME STREQUAL "smolensk"
AND LSB_RELEASE STREQUAL "1.5")
if(LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE" AND LSB_CODENAME STREQUAL "smolensk" AND LSB_RELEASE STREQUAL
"1.5")
set(_CMAKE_TOOLCHAIN_PREFIX "x86_64-linux-gnu-")
set(_CMAKE_TOOLCHAIN_SUFFIX "-4.7")
set(_CMAKE_TOOLCHAIN_LOCATION} "/usr/bin")
@ -31,9 +30,7 @@ else()
endif()
# Common configuration for GCC, clang and Intel.
if(CMAKE_CXX_COMPILER_IS_CLANG
OR CMAKE_CXX_COMPILER_IS_INTEL
OR CMAKE_CXX_COMPILER_IS_GCC)
if(CMAKE_CXX_COMPILER_IS_CLANG OR CMAKE_CXX_COMPILER_IS_INTEL OR CMAKE_CXX_COMPILER_IS_GCC)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS YES)

View File

@ -13,10 +13,7 @@ if(${_source_realpath} STREQUAL ${_binary_realpath})
endif()
# Очистка от сгенерированных файлов
file(
GLOB_RECURSE _cmakelists_files
RELATIVE ${_source_realpath}
CMakeLists.txt)
file(GLOB_RECURSE _cmakelists_files RELATIVE ${_source_realpath} CMakeLists.txt)
foreach(_it ${_cmakelists_files})
get_filename_component(_file ${_it} REALPATH)
get_filename_component(_dir ${_file} DIRECTORY)

View File

@ -4,9 +4,7 @@ if(DISTCC_EXECUTABLE)
foreach(LANG C CXX)
if(NOT DEFINED CMAKE_${LANG}_COMPILER_LAUNCHER AND NOT CMAKE_${LANG}_COMPILER MATCHES ".*/distcc$")
message(STATUS "Enabling distcc for ${LANG}")
set(CMAKE_${LANG}_COMPILER_LAUNCHER
${DISTCC_EXECUTABLE}
CACHE STRING "")
set(CMAKE_${LANG}_COMPILER_LAUNCHER ${DISTCC_EXECUTABLE} CACHE STRING "")
endif()
endforeach()
endif()

View File

@ -1,11 +1,9 @@
set(BREATHE_FOUND
AUTO
CACHE STRING "Enable Breathe documentation generator")
set(BREATHE_FOUND AUTO CACHE STRING "Enable Breathe documentation generator")
set_property(CACHE BREATHE_FOUND PROPERTY STRINGS ON OFF AUTO)
find_package(Doxygen)
find_package(Perl)
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2)
set(Python_ADDITIONAL_VERSIONS 3.8;3.7;3.6;3.5;3.4;3.3;3.2)
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
find_package(Sphinx)
@ -18,18 +16,12 @@ if(PYTHONINTERP_FOUND)
AND SPHINX_EXECUTABLE
AND breathe
AND recommonmark)
set(BREATHE_FOUND
ON
CACHE STRING "Breathe documentation generator enabled" FORCE)
set(BREATHE_FOUND ON CACHE STRING "Breathe documentation generator enabled" FORCE)
else()
set(BREATHE_FOUND
OFF
CACHE STRING "Breathe documentation generator disabled" FORCE)
set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE)
endif()
else()
set(BREATHE_FOUND
OFF
CACHE STRING "Breathe documentation generator disabled" FORCE)
set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE)
endif()
function(add_breathe_target)
@ -63,10 +55,8 @@ function(add_breathe_target)
configure_file(${INDEX_MD_FILE} ${WORK_DIR}/index.md @ONLY)
file(GLOB MD_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.md)
if(MD_FILES)
add_custom_command(
TARGET ${_BREATHE_TARGET_NAME}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MD_FILES} ${WORK_DIR})
add_custom_command(TARGET ${_BREATHE_TARGET_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MD_FILES} ${WORK_DIR})
endif()
endif()
@ -75,16 +65,12 @@ function(add_breathe_target)
configure_file(${INDEX_RST_FILE} ${WORK_DIR}/index.rst @ONLY)
file(GLOB RST_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.rst)
if(RST_FILES)
add_custom_command(
TARGET ${_BREATHE_TARGET_NAME}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RST_FILES} ${WORK_DIR})
add_custom_command(TARGET ${_BREATHE_TARGET_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RST_FILES} ${WORK_DIR})
endif()
endif()
else()
add_custom_target(
${_BREATHE_TARGET_NAME}
VERBATIM
COMMENT "Breathe is not found. Skipping target ${_BREATHE_TARGET_NAME} build")
add_custom_target(${_BREATHE_TARGET_NAME} VERBATIM
COMMENT "Breathe is not found. Skipping target ${_BREATHE_TARGET_NAME} build")
endif()
endfunction()

View File

@ -1,17 +1,11 @@
set(DOXYGEN_FOUND
AUTO
CACHE STRING "Enable Doxygen documentation generator")
set(DOXYGEN_FOUND AUTO CACHE STRING "Enable Doxygen documentation generator")
set_property(CACHE DOXYGEN_FOUND PROPERTY STRINGS ON OFF AUTO)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(DOXYGEN_FOUND
ON
CACHE STRING "Doxygen documentation generator enabled" FORCE)
set(DOXYGEN_FOUND ON CACHE STRING "Doxygen documentation generator enabled" FORCE)
else()
set(DOXYGEN_FOUND
OFF
CACHE STRING "Doxygen documentation generator disabled" FORCE)
set(DOXYGEN_FOUND OFF CACHE STRING "Doxygen documentation generator disabled" FORCE)
endif()
function(add_doxygen_target)
@ -46,9 +40,7 @@ function(add_doxygen_target)
WORKING_DIRECTORY ${WORK_DIR}
COMMENT "Generating API documentation with Doxygen")
else()
add_custom_target(
${_DOXYGEN_TARGET_NAME}
VERBATIM
COMMENT "Doxygen is not found. Skipping target ${_DOXYGEN_TARGET_NAME} build")
add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM
COMMENT "Doxygen is not found. Skipping target ${_DOXYGEN_TARGET_NAME} build")
endif()
endfunction()

View File

@ -35,9 +35,7 @@ macro(remove_flag_from_file _target _file _flag)
if(NOT _cached_${_target}_cxx_flags)
# Obtain and cache the target compiler options, then clear them.
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
set(_cached_${_target}_cxx_flags
"${_target_cxx_flags}"
CACHE INTERNAL "")
set(_cached_${_target}_cxx_flags "${_target_cxx_flags}" CACHE INTERNAL "")
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "")
# Apply the target compile flags to each source file.
foreach(_source_file ${_target_sources})
@ -61,9 +59,7 @@ macro(remove_flag_from_file _target _file _flag)
# This is the list that we'll be removing flags from.
get_source_file_property(_source_file_cxx_flags ${_file} COMPILE_FLAGS)
separate_arguments(_source_file_cxx_flags UNIX_COMMAND ${_source_file_cxx_flags})
set(_cached_${_target}_${_file}_cxx_flags
${_source_file_cxx_flags}
CACHE INTERNAL "")
set(_cached_${_target}_${_file}_cxx_flags ${_source_file_cxx_flags} CACHE INTERNAL "")
endif()
# Remove the specified flag, then re-apply the rest.
list(REMOVE_ITEM _cached_${_target}_${_file}_cxx_flags ${_flag})

View File

@ -9,7 +9,13 @@ function(add_format_sources)
find_program(UNCRUSTIFY_EXE NAMES uncrustify)
if(UNCRUSTIFY_EXE)
list(APPEND UNCRUSTIFY_OPTS -lCPP --replace --no-backup --mtime)
list(
APPEND
UNCRUSTIFY_OPTS
-lCPP
--replace
--no-backup
--mtime)
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
endif()

View File

@ -1,7 +1,5 @@
function(canonical_string INV OUTV)
string(TOUPPER ${INV} _arg_uppercase)
string(REGEX REPLACE "[ -]" "_" _arg_fixed ${_arg_uppercase})
set(${OUTV}
${_arg_fixed}
PARENT_SCOPE)
set(${OUTV} ${_arg_fixed} PARENT_SCOPE)
endfunction()

View File

@ -13,10 +13,7 @@ set(LSB_RELEASE "unknown")
if(EXISTS /etc/mcst_version)
set(LSB_DISTRIBUTOR_ID "ElbrusD")
set(LSB_CODENAME "Jessie")
execute_process(
COMMAND cat /etc/mcst_version
OUTPUT_VARIABLE LSB_RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND cat /etc/mcst_version OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
find_program(_lsb_release_executable lsb_release)
if(_lsb_release_executable)

View File

@ -72,9 +72,7 @@ macro(cmlib_test_large_files VARIABLE)
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS
64
CACHE INTERNAL "64-bit off_t requires _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS 64 CACHE INTERNAL "64-bit off_t requires _FILE_OFFSET_BITS=64")
endif()
endif()
@ -84,9 +82,7 @@ macro(cmlib_test_large_files VARIABLE)
COMPILE_DEFINITIONS "-D_LARGE_FILES")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
set(_LARGE_FILES
1
CACHE INTERNAL "64-bit off_t requires _LARGE_FILES")
set(_LARGE_FILES 1 CACHE INTERNAL "64-bit off_t requires _LARGE_FILES")
endif()
endif()
@ -96,9 +92,7 @@ macro(cmlib_test_large_files VARIABLE)
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE
1
CACHE INTERNAL "64-bit off_t requires _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1 CACHE INTERNAL "64-bit off_t requires _LARGEFILE_SOURCE")
endif()
endif()
@ -127,9 +121,7 @@ macro(cmlib_test_large_files VARIABLE)
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE")
if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE
1
CACHE INTERNAL "64-bit fseeko requires _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1 CACHE INTERNAL "64-bit fseeko requires _LARGEFILE_SOURCE")
else()
set(FILE64_OK 0)
message(STATUS "64-bit off_t present but fseeko/ftello not found!")
@ -142,32 +134,20 @@ macro(cmlib_test_large_files VARIABLE)
try_compile(FILE64_OK "${CMAKE_BINARY_DIR}" "${CMLIB_MODULE_DIR}/tests/TestWindowsFSeek.c")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
set(HAVE__FSEEKI64
1
CACHE INTERNAL "64-bit off_t requires _fseeki64")
set(HAVE__FSEEKI64 1 CACHE INTERNAL "64-bit off_t requires _fseeki64")
endif()
endif()
if(FSEEKO_COMPILE_OK)
set(${VARIABLE}
1
CACHE INTERNAL "Result of test for large file support" FORCE)
set(HAVE_FSEEKO
1
CACHE INTERNAL "64bit fseeko is available" FORCE)
set(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE)
set(HAVE_FSEEKO 1 CACHE INTERNAL "64bit fseeko is available" FORCE)
elseif(HAVE__FSEEKI64)
set(${VARIABLE}
1
CACHE INTERNAL "Result of test for large file support" FORCE)
set(HAVE__FSEEKI64
1
CACHE INTERNAL "Windows 64-bit fseek" FORCE)
set(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE)
set(HAVE__FSEEKI64 1 CACHE INTERNAL "Windows 64-bit fseek" FORCE)
else()
check_type_size("long int" SIZEOF_LONG_INT)
if(SIZEOF_LONG_INT EQUAL 8) #standard fseek is OK for 64bit
set(${VARIABLE}
1
CACHE INTERNAL "Result of test for large file support" FORCE)
set(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE)
else()
message(FATAL_ERROR "Checking for 64bit file support failed.")
endif()

View File

@ -1,8 +1,5 @@
function(qt5_translation)
find_package(
Qt5
COMPONENTS LinguistTools
REQUIRED)
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
set(options)
set(oneValueArgs TARGET TS_DIR)
@ -25,9 +22,8 @@ function(qt5_translation)
string(APPEND L10N_QRC_BODY "<file alias=\"${_qm}\">${CMAKE_BINARY_DIR}/${_qm}</file>\n")
add_custom_target(
${_target}_l10n_${_lang}
COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${_sources} -ts ${_ts_dir}/${_ts} -target-language ${_lang}
DEPENDS ${_sources})
${_target}_l10n_${_lang} COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${_sources} -ts ${_ts_dir}/${_ts}
-target-language ${_lang} DEPENDS ${_sources})
if(NOT EXISTS "${_ts_dir}/${_ts}")
add_custom_target(${_ts} DEPENDS ${_target}_l10n_${_lang})
@ -36,9 +32,8 @@ function(qt5_translation)
endif()
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/${_qm}
COMMAND ${Qt5_LRELEASE_EXECUTABLE} ARGS ${_ts_dir}/${_ts} -qm ${CMAKE_BINARY_DIR}/${_qm}
DEPENDS ${_ts} ${_sources})
OUTPUT ${CMAKE_BINARY_DIR}/${_qm} COMMAND ${Qt5_LRELEASE_EXECUTABLE} ARGS ${_ts_dir}/${_ts} -qm
${CMAKE_BINARY_DIR}/${_qm} DEPENDS ${_ts} ${_sources})
endforeach()
configure_file(${CMLIB_MODULE_DIR}/qrc/l10n.qrc.in ${CMAKE_BINARY_DIR}/${_target}_l10n.qrc)

@ -1 +1 @@
Subproject commit dfa7faf459634501a7b76944ad264d5959f14615
Subproject commit f1abee33655e414e7a1fca09640f98a1cb4f8b3d