2019-02-13 09:55:42 +00:00
|
|
|
# CMLIB_PROJECT_NAME_CANONICAL
|
|
|
|
string(TOUPPER ${PROJECT_NAME} _project_name_uppercase)
|
|
|
|
string(REGEX REPLACE "[ -]" "_" _project_name_fixed ${_project_name_uppercase})
|
|
|
|
set(CMLIB_PROJECT_NAME_CANONICAL ${_project_name_fixed})
|
|
|
|
|
2019-02-13 18:34:20 +00:00
|
|
|
# CMLIB_MODULE_DIR
|
|
|
|
foreach(_m ${CMAKE_MODULE_PATH})
|
|
|
|
if(EXISTS ${_m}/CMLibCommon.cmake)
|
|
|
|
get_filename_component(CMLIB_MODULE_DIR ${_m}/CMLibCommon.cmake DIRECTORY)
|
|
|
|
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()
|
|
|
|
|