2021-06-07 14:57:17 +00:00
|
|
|
if(NOT CMLIB_THEME_NAME)
|
2021-06-07 14:46:58 +00:00
|
|
|
set(CMLIB_THEME_NAME "default")
|
2021-06-01 10:36:24 +00:00
|
|
|
endif()
|
|
|
|
|
2021-06-07 14:46:58 +00:00
|
|
|
canonical_string(${CMLIB_ORGANIZATION_NAME} CMLIB_ORGANIZATION_NAME_CANONICAL)
|
2020-03-29 05:55:58 +00:00
|
|
|
canonical_string(${PROJECT_NAME} CMLIB_PROJECT_NAME_CANONICAL)
|
2021-06-07 14:46:58 +00:00
|
|
|
canonical_string(${CMLIB_THEME_NAME} CMLIB_THEME_NAME_CANONICAL)
|
2020-03-29 05:44:48 +00:00
|
|
|
|
|
|
|
string(TOLOWER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_LOWER)
|
|
|
|
string(TOLOWER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_LOWER)
|
2021-06-01 10:36:24 +00:00
|
|
|
string(TOLOWER ${CMLIB_THEME_NAME_CANONICAL} CMLIB_THEME_NAME_LOWER)
|
2019-02-13 09:55:42 +00:00
|
|
|
|
2020-04-09 19:20:55 +00:00
|
|
|
string(TOUPPER ${CMLIB_ORGANIZATION_NAME_CANONICAL} CMLIB_ORGANIZATION_NAME_UPPER)
|
|
|
|
string(TOUPPER ${CMLIB_PROJECT_NAME_CANONICAL} CMLIB_PROJECT_NAME_UPPER)
|
2021-06-01 10:36:24 +00:00
|
|
|
string(TOUPPER ${CMLIB_THEME_NAME_CANONICAL} CMLIB_THEME_NAME_UPPER)
|
2020-04-09 19:20:55 +00:00
|
|
|
|
2021-06-11 06:50:46 +00:00
|
|
|
option(CMLIB_ADD_THEME_PREFIX "Append theme name to install prefix" OFF)
|
|
|
|
if(CMLIB_ADD_THEME_PREFIX AND NOT CMLIB_THEME_PREFIX_APPENDED)
|
|
|
|
if(NOT CMLIB_THEME_NAME_LOWER STREQUAL "default")
|
|
|
|
set(CMLIB_THEME_PREFIX_APPENDED ON CACHE BOOL "" FORCE)
|
|
|
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${CMLIB_THEME_NAME}" CACHE PATH "" FORCE)
|
2021-06-01 10:55:12 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2020-04-09 19:20:55 +00:00
|
|
|
|
2019-02-13 18:34:20 +00:00
|
|
|
# CMLIB_MODULE_DIR
|
2021-06-12 09:59:31 +00:00
|
|
|
foreach(module ${CMAKE_MODULE_PATH})
|
|
|
|
if(EXISTS ${module}/CMLibCommon.cmake)
|
|
|
|
get_filename_component(CMLIB_MODULE_DIR ${module}/CMLibCommon.cmake DIRECTORY)
|
2019-02-13 18:34:20 +00:00
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2019-07-02 07:13:20 +00:00
|
|
|
if(IS_DIRECTORY "${CMLIB_MODULE_DIR}")
|
2019-02-19 09:31:14 +00:00
|
|
|
if(NOT DEFINED CMLIB_THIRDPARTY_DIR)
|
|
|
|
set(CMLIB_THIRDPARTY_DIR "${CMLIB_MODULE_DIR}/thirdparty")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMLIB_THIRDPARTY_DIR})
|
2019-02-19 09:06:30 +00:00
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "CMLib directory not found.")
|
|
|
|
endif()
|