Версия 0.4.8

This commit is contained in:
Andrei Astafev 2022-01-25 13:21:05 +03:00
parent 2a12f0250f
commit f163819116
7 changed files with 25 additions and 46 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(myx-cmake VERSION 0.4.7 LANGUAGES)
project(myx-cmake VERSION 0.4.8 LANGUAGES)
include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake

View File

@ -1,8 +1,8 @@
# C compiler name
if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set(CMAKE_C_COMPILER_IS_INTEL ON)
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL
"AppleClang")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_C_COMPILER_IS_CLANG ON)
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_COMPILER_IS_GCC ON)
@ -13,8 +13,8 @@ endif()
# C++ compiler name
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_COMPILER_IS_INTEL ON)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_CXX_COMPILER_IS_CLANG ON)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_COMPILER_IS_GCC ON)
@ -25,13 +25,12 @@ endif()
# Предпочтительные пути к утилитам для компоновки
if(CMAKE_CXX_COMPILER_IS_GCC)
# Astra Linux Smolensk 1.5
if(MYX_CMAKE_LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE"
AND MYX_CMAKE_LSB_CODENAME STREQUAL "smolensk"
AND MYX_CMAKE_LSB_RELEASE STREQUAL "1.5")
if(MYX_CMAKE_LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE" AND
MYX_CMAKE_LSB_CODENAME STREQUAL "smolensk" AND
MYX_CMAKE_LSB_RELEASE STREQUAL "1.5")
find_program(CMAKE_GCC_AR NAMES "/usr/bin/x86_64-linux-gnu-gcc-ar-4.7")
find_program(CMAKE_GCC_NM NAMES "/usr/bin/x86_64-linux-gnu-gcc-nm-4.7")
find_program(CMAKE_GCC_RANLIB
NAMES "/usr/bin/x86_64-linux-gnu-gcc-ranlib-4.7")
find_program(CMAKE_GCC_RANLIB NAMES "/usr/bin/x86_64-linux-gnu-gcc-ranlib-4.7")
# Elbrus E2K
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k")
find_program(CMAKE_GCC_AR
@ -47,18 +46,12 @@ if(CMAKE_CXX_COMPILER_IS_GCC)
endif()
if(CMAKE_GCC_AR)
set(CMAKE_AR
${CMAKE_GCC_AR}
CACHE STRING "" FORCE)
set(CMAKE_AR ${CMAKE_GCC_AR} CACHE STRING "" FORCE)
endif()
if(CMAKE_GCC_NM)
set(CMAKE_NM
${CMAKE_GCC_NM}
CACHE STRING "" FORCE)
set(CMAKE_NM ${CMAKE_GCC_NM} CACHE STRING "" FORCE)
endif()
if(CMAKE_GCC_RANLIB)
set(CMAKE_RANLIB
${CMAKE_GCC_RANLIB}
CACHE STRING "" FORCE)
set(CMAKE_RANLIB ${CMAKE_GCC_RANLIB} CACHE STRING "" FORCE)
endif()
endif()

View File

@ -6,13 +6,7 @@ option(MYX_CMAKE_WARNING_OUTPUT "Enable warning output" OFF)
# Если сборка производится в режиме для отладки, то включаются флаги для
# разрешения отладочной печати
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(MYX_CMAKE_DEBUG_OUTPUT
ON
CACHE BOOL "" FORCE)
set(MYX_CMAKE_INFO_OUTPUT
ON
CACHE BOOL "" FORCE)
set(MYX_CMAKE_WARNING_OUTPUT
ON
CACHE BOOL "" FORCE)
set(MYX_CMAKE_DEBUG_OUTPUT ON CACHE BOOL "" FORCE)
set(MYX_CMAKE_INFO_OUTPUT ON CACHE BOOL "" FORCE)
set(MYX_CMAKE_WARNING_OUTPUT ON CACHE BOOL "" FORCE)
endif()

View File

@ -2,9 +2,7 @@
function(myx_cmake_canonical_string in_string out_string)
string(TOUPPER ${in_string} _arg_uppercase)
string(REGEX REPLACE "[ -]" "_" _arg_fixed ${_arg_uppercase})
set(${out_string}
${_arg_fixed}
PARENT_SCOPE)
set(${out_string} ${_arg_fixed} PARENT_SCOPE)
endfunction()
# Добавление общего префикса ко всем переменным в списке
@ -13,7 +11,5 @@ function(myx_cmake_list_transform_prepend var prefix)
foreach(filename ${${var}})
list(APPEND temp "${prefix}${filename}")
endforeach()
set(${var}
"${temp}"
PARENT_SCOPE)
set(${var} ${temp} PARENT_SCOPE)
endfunction()

View File

@ -14,16 +14,12 @@ string(TOLOWER ${MYX_CMAKE_THEME_NAME_CANONICAL} MYX_CMAKE_THEME_NAME_LOWER)
string(TOUPPER ${MYX_CMAKE_ORGANIZATION_NAME_CANONICAL} MYX_CMAKE_ORGANIZATION_NAME_UPPER)
string(TOUPPER ${MYX_CMAKE_PROJECT_NAME_CANONICAL} MYX_CMAKE_PROJECT_NAME_UPPER)
string(TOUPPER ${MYX_CMAKE_THEME_NAME_CANONICAL} MYX_CMAKE_THEME_NAME_UPPER)
# cmake-format: on
option(MYX_CMAKE_ADD_THEME_PREFIX "Append theme name to install prefix" OFF)
if(MYX_CMAKE_ADD_THEME_PREFIX AND NOT MYX_CMAKE_THEME_PREFIX_APPENDED)
if(NOT MYX_CMAKE_THEME_NAME_LOWER STREQUAL "default")
set(MYX_CMAKE_THEME_PREFIX_APPENDED
ON
CACHE BOOL "" FORCE)
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}/${MYX_CMAKE_THEME_NAME}"
CACHE PATH "" FORCE)
set(MYX_CMAKE_THEME_PREFIX_APPENDED ON CACHE BOOL "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${MYX_CMAKE_THEME_NAME}" CACHE PATH "" FORCE)
endif()
endif()
# cmake-format: on

View File

@ -24,6 +24,6 @@ else()
execute_process(COMMAND ${_lsb_release_executable} -si OUTPUT_VARIABLE MYX_CMAKE_LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_lsb_release_executable} -sc OUTPUT_VARIABLE MYX_CMAKE_LSB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_lsb_release_executable} -sr OUTPUT_VARIABLE MYX_CMAKE_LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
# cmake-format: on
endif()
# cmake-format: on
endif()

View File

@ -1,10 +1,10 @@
# cmake-format: off
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
include(cotire OPTIONAL)
if(COMMAND cotire)
option(MYX_CMAKE_PRECOMPILED_HEADERS "MyxCMake: enable precompiled headers"
OFF)
option(MYX_CMAKE_PRECOMPILED_HEADERS "MyxCMake: enable precompiled headers" OFF)
endif()
else()
option(MYX_CMAKE_PRECOMPILED_HEADERS "MyxCMake: enable precompiled headers"
OFF)
option(MYX_CMAKE_PRECOMPILED_HEADERS "MyxCMake: enable precompiled headers" OFF)
endif()
# cmake-format: on