myx-cmake/MyxCMake/modules/MyxCMakeGlobalVariables.cmake

28 lines
1.3 KiB
CMake
Raw Normal View History

2022-05-06 09:49:46 +00:00
include_guard(GLOBAL)
2021-12-08 11:32:04 +00:00
if(NOT MYX_CMAKE_THEME_NAME)
2022-05-06 09:49:46 +00:00
set(MYX_CMAKE_THEME_NAME "default" CACHE STRING "")
2021-12-08 11:32:04 +00:00
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)
2022-05-06 09:49:46 +00:00
option(MYX_CMAKE_ADD_THEME_TO_INSTALL_PREFIX "Append theme name to install prefix" OFF)
if(MYX_CMAKE_ADD_THEME_TO_INSTALL_PREFIX AND NOT MYX_CMAKE_THEME_INSTALL_PREFIX_APPENDED)
2021-12-08 11:32:04 +00:00
if(NOT MYX_CMAKE_THEME_NAME_LOWER STREQUAL "default")
2022-05-06 09:49:46 +00:00
set(MYX_CMAKE_THEME_INSTALL_PREFIX_APPENDED ON CACHE BOOL "" FORCE)
2022-01-25 10:21:05 +00:00
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${MYX_CMAKE_THEME_NAME}" CACHE PATH "" FORCE)
2021-12-08 11:32:04 +00:00
endif()
endif()
2022-01-25 10:21:05 +00:00
# cmake-format: on