Переменная для названия работы (темы)

This commit is contained in:
Andrei Astafev 2021-06-01 13:36:24 +03:00
parent 956a94800f
commit ab6d9dab66
2 changed files with 26 additions and 1 deletions

View File

@ -1,11 +1,18 @@
canonical_string(${PROJECT_NAME} CMLIB_PROJECT_NAME_CANONICAL) if (NOT THEME_NAME)
set(THEME_NAME "default")
endif()
canonical_string(${ORGANIZATION_NAME} CMLIB_ORGANIZATION_NAME_CANONICAL) canonical_string(${ORGANIZATION_NAME} CMLIB_ORGANIZATION_NAME_CANONICAL)
canonical_string(${PROJECT_NAME} CMLIB_PROJECT_NAME_CANONICAL)
canonical_string(${THEME_NAME} CMLIB_THEME_NAME_CANONICAL)
string(TOLOWER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_LOWER) string(TOLOWER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_LOWER)
string(TOLOWER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_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_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_UPPER)
string(TOUPPER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_UPPER) string(TOUPPER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_UPPER)
string(TOUPPER ${CMLIB_THEME_NAME_CANONICAL} CMLIB_THEME_NAME_UPPER)
# CMLIB_MODULE_DIR # CMLIB_MODULE_DIR
foreach(_m ${CMAKE_MODULE_PATH}) foreach(_m ${CMAKE_MODULE_PATH})

View File

@ -42,6 +42,24 @@
#define CMLIB_PROJECT_NAME_UPPER "@CMLIB_PROJECT_NAME_UPPER@" #define CMLIB_PROJECT_NAME_UPPER "@CMLIB_PROJECT_NAME_UPPER@"
#endif #endif
#if defined (CMLIB_THEME_NAME)
#error "Duplicate definition of macros CMLIB_THEME_NAME"
#else
#define CMLIB_THEME_NAME "@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_BUILD_TYPE) #if defined (CMLIB_BUILD_TYPE)
#error "Duplicate definition of macros CMLIB_BUILD_TYPE" #error "Duplicate definition of macros CMLIB_BUILD_TYPE"
#else #else