Compare commits
6 Commits
8fbf0a3b3d
...
5e600ab490
Author | SHA1 | Date | |
---|---|---|---|
5e600ab490 | |||
ca7cf2dbfe | |||
bef7660836 | |||
dbc0b76a76 | |||
ab6d9dab66 | |||
956a94800f |
@@ -175,7 +175,7 @@ with section("markup"):
|
||||
with section("lint"):
|
||||
|
||||
# a list of lint codes to disable
|
||||
disabled_codes = []
|
||||
disabled_codes = ['C0113']
|
||||
|
||||
# regular expression pattern describing valid function names
|
||||
function_pattern = '[0-9a-z_]+'
|
@@ -1,7 +1,7 @@
|
||||
# Общие настройки для пакета: организация, автор, версия
|
||||
set(CPACK_PACKAGE_VENDOR ${CMLIB_ORGANIZATION_NAME_LOWER})
|
||||
set(CPACK_PACKAGE_NAME ${CMLIB_PROJECT_NAME_LOWER})
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_VENDOR ${CMLIB_ORGANIZATION_NAME_LOWER} CACHE STRING "")
|
||||
set(CPACK_PACKAGE_NAME ${CMLIB_PROJECT_NAME_LOWER} CACHE STRING "")
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION} CACHE STRING "")
|
||||
|
||||
# Параметры для архива исходных текстов
|
||||
if(NOT CPACK_SOURCE_GENERATOR)
|
||||
|
@@ -5,6 +5,10 @@ if(CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR)
|
||||
message(FATAL_ERROR "Cannot install into build directory")
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX STREQUAL PROJECT_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Cannot install into source directory")
|
||||
endif()
|
||||
|
||||
include(CMLibDisableInSourceBuild)
|
||||
include(CMakeParseArguments)
|
||||
include(GNUInstallDirs)
|
||||
|
@@ -1,11 +1,27 @@
|
||||
if(NOT CMLIB_THEME_NAME)
|
||||
set(CMLIB_THEME_NAME "default")
|
||||
endif()
|
||||
|
||||
canonical_string(${CMLIB_ORGANIZATION_NAME} CMLIB_ORGANIZATION_NAME_CANONICAL)
|
||||
canonical_string(${PROJECT_NAME} CMLIB_PROJECT_NAME_CANONICAL)
|
||||
canonical_string(${ORGANIZATION_NAME} CMLIB_ORGANIZATION_NAME_CANONICAL)
|
||||
canonical_string(${CMLIB_THEME_NAME} CMLIB_THEME_NAME_CANONICAL)
|
||||
|
||||
string(TOLOWER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_LOWER)
|
||||
string(TOLOWER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_LOWER)
|
||||
string(TOLOWER ${CMLIB_THEME_NAME_CANONICAL} CMLIB_THEME_NAME_LOWER)
|
||||
|
||||
string(TOUPPER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_UPPER)
|
||||
string(TOUPPER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_UPPER)
|
||||
string(TOUPPER ${CMLIB_THEME_NAME_CANONICAL} CMLIB_THEME_NAME_UPPER)
|
||||
|
||||
option(CMLIB_USE_DEVELOPMENT_INSTALL_PREFIX "Auto-generated output prefix for development installation" OFF)
|
||||
if(CMLIB_USE_DEVELOPMENT_INSTALL_PREFIX)
|
||||
if(CMLIB_THEME_NAME_LOWER STREQUAL "default")
|
||||
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/_output" CACHE PATH "" FORCE)
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/_output/${CMLIB_THEME_NAME_LOWER}" CACHE PATH "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# CMLIB_MODULE_DIR
|
||||
foreach(_m ${CMAKE_MODULE_PATH})
|
||||
|
@@ -18,12 +18,12 @@ else()
|
||||
find_program(_lsb_release_executable lsb_release)
|
||||
if(_lsb_release_executable)
|
||||
execute_process(COMMAND ${_lsb_release_executable} -si OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND ${_lsb_release_executable} -sc OUTPUT_VARIABLE LSB_CODENAME
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND ${_lsb_release_executable} -sr OUTPUT_VARIABLE LSB_RELEASE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,19 +1,21 @@
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/etc/Variables.cmake")
|
||||
message(FATAL_ERROR "Required file cmake/etc/Variables.cmake does not exist")
|
||||
#
|
||||
# Обязательные переменные, значения которым необходимо присвоить в файле CMakeLists.txt
|
||||
# до подключения CMLib, либо передать из командной строки через ключ -D
|
||||
#
|
||||
if(NOT CMLIB_ORGANIZATION_NAME)
|
||||
message(FATAL_ERROR "Required variable CMLIB_ORGANIZATION_NAME is not defined")
|
||||
endif()
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/etc/Variables.cmake")
|
||||
|
||||
if(NOT ORGANIZATION_NAME)
|
||||
message(FATAL_ERROR "Required variable ORGANIZATION_NAME is not defined")
|
||||
if(NOT CMLIB_AUTHOR_NAME)
|
||||
message(FATAL_ERROR "Required variable CMLIB_AUTHOR_NAME is not defined")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_VENDOR ${ORGANIZATION_NAME})
|
||||
|
||||
if(NOT CPACK_PACKAGE_CONTACT)
|
||||
message(FATAL_ERROR "Required variable CPACK_PACKAGE_CONTACT is not defined")
|
||||
if(NOT CMLIB_AUTHOR_EMAIL)
|
||||
message(FATAL_ERROR "Required variable CMLIB_AUTHOR_EMAIL is not defined")
|
||||
endif()
|
||||
set(CPACK_PACKAGE_CONTACT "${CMLIB_AUTHOR_NAME} <${CMLIB_AUTHOR_EMAIL}>" CACHE STRING "")
|
||||
|
||||
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||
message(FATAL_ERROR "Required variable CPACK_PACKAGE_DESCRIPTION_SUMMARY is not defined")
|
||||
if(NOT CMLIB_DESCRIPTION)
|
||||
message(FATAL_ERROR "Required variable CMLIB_DESCRIPTION is not defined")
|
||||
endif()
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CMLIB_DESCRIPTION} CACHE STRING "")
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#if defined (CMLIB_ORGANIZATION_NAME)
|
||||
#error "Duplicate definition of macros CMLIB_ORGANIZATION_NAME"
|
||||
#else
|
||||
#define CMLIB_ORGANIZATION_NAME "@ORGANIZATION_NAME@"
|
||||
#define CMLIB_ORGANIZATION_NAME "@CMLIB_ORGANIZATION_NAME@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_ORGANIZATION_NAME_LOWER)
|
||||
@@ -42,6 +42,42 @@
|
||||
#define CMLIB_PROJECT_NAME_UPPER "@CMLIB_PROJECT_NAME_UPPER@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_THEME_NAME)
|
||||
#error "Duplicate definition of macros CMLIB_THEME_NAME"
|
||||
#else
|
||||
#define CMLIB_THEME_NAME "@CMLIB_THEME_NAME@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_THEME_NAME_LOWER)
|
||||
#error "Duplicate definition of macros CMLIB_THEME_NAME_LOWER"
|
||||
#else
|
||||
#define CMLIB_THEME_NAME_LOWER "@CMLIB_THEME_NAME_LOWER@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_THEME_NAME_UPPER)
|
||||
#error "Duplicate definition of macros CMLIB_THEME_NAME_UPPER"
|
||||
#else
|
||||
#define CMLIB_THEME_NAME_UPPER "@CMLIB_THEME_NAME_UPPER@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_AUTHOR_NAME)
|
||||
#error "Duplicate definition of macros CMLIB_AUTHOR_NAME"
|
||||
#else
|
||||
#define CMLIB_AUTHOR_NAME "@CMLIB_AUTHOR_NAME@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_AUTHOR_EMAIL)
|
||||
#error "Duplicate definition of macros CMLIB_AUTHOR_EMAIL"
|
||||
#else
|
||||
#define CMLIB_AUTHOR_EMAIL "@CMLIB_AUTHOR_EMAIL@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_DESCRIPTION)
|
||||
#error "Duplicate definition of macros CMLIB_DESCRIPTION"
|
||||
#else
|
||||
#define CMLIB_DESCRIPTION "@CMLIB_DESCRIPTION@"
|
||||
#endif
|
||||
|
||||
#if defined (CMLIB_BUILD_TYPE)
|
||||
#error "Duplicate definition of macros CMLIB_BUILD_TYPE"
|
||||
#else
|
||||
|
Reference in New Issue
Block a user