myx-cmake/MyxCMake/modules/MyxCMakeGlobalVariables.cmake

30 lines
1.3 KiB
CMake

if(NOT MYX_CMAKE_THEME_NAME)
set(MYX_CMAKE_THEME_NAME "default")
endif()
# cmake-format: off
myx_cmake_canonical_string(${MYX_CMAKE_ORGANIZATION_NAME} MYX_CMAKE_ORGANIZATION_NAME_CANONICAL)
myx_cmake_canonical_string(${PROJECT_NAME} MYX_CMAKE_PROJECT_NAME_CANONICAL)
myx_cmake_canonical_string(${MYX_CMAKE_THEME_NAME} MYX_CMAKE_THEME_NAME_CANONICAL)
string(TOLOWER ${MYX_CMAKE_ORGANIZATION_NAME_CANONICAL} MYX_CMAKE_ORGANIZATION_NAME_LOWER)
string(TOLOWER ${MYX_CMAKE_PROJECT_NAME_CANONICAL} MYX_CMAKE_PROJECT_NAME_LOWER)
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)
endif()
endif()