2019-12-13 19:44:34 -05:00
|
|
|
# 3.8.2 required because template/c requires it
|
|
|
|
cmake_minimum_required(VERSION 3.8.2 FATAL_ERROR)
|
|
|
|
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
|
|
|
|
# set build type to release if none is specified
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
|
|
|
"Choose the type of build." FORCE)
|
|
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
|
|
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# options
|
|
|
|
option(LINE_LIMIT "Check files with line_limit." OFF)
|
|
|
|
option(REGEX_CHECK "Check files with regex_check." OFF)
|
|
|
|
option(WERROR "Make all warnings into errors." OFF)
|
|
|
|
if(NOT DEFINED DOC)
|
|
|
|
set(DOC html CACHE STRING
|
|
|
|
"The documentation type to generate." FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# disable base languages
|
|
|
|
unset(PROJECT_LANGUAGES)
|
|
|
|
|
|
|
|
project(shione
|
|
|
|
VERSION 0.0.0
|
|
|
|
DESCRIPTION "shione"
|
|
|
|
LANGUAGES ${PROJECT_LANGUAGES})
|
|
|
|
set(PROJECT_VERSION_SUFFIX "") # alpha/beta/rc, e.g. "-rc0"
|
|
|
|
set(PROJECT_VERSION "${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}")
|
|
|
|
set(PROJECT_AUTHOR "renken")
|
2021-02-25 08:21:05 -05:00
|
|
|
set(PROJECT_COPYRIGHT "2021, renken")
|
2019-12-13 19:44:34 -05:00
|
|
|
set(PROJECT_MAIL "renken@verm.im")
|
|
|
|
# only set CMAKE variant when local name matches CMAKE name
|
|
|
|
# this avoids clashing when being used as a subproject
|
|
|
|
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
|
|
set(CMAKE_PROJECT_VERSION "${PROJECT_VERSION}")
|
|
|
|
set(CMAKE_PROJECT_VERSION_SUFFIX "${PROJECT_VERSION_SUFFIX}")
|
|
|
|
set(CMAKE_PROJECT_AUTHOR "${PROJECT_AUTHOR}")
|
|
|
|
set(CMAKE_PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
|
|
|
set(CMAKE_PROJECT_MAIL "${PROJECT_MAIL}")
|
|
|
|
endif()
|
|
|
|
include(version)
|
|
|
|
|
|
|
|
if(NOT DOC STREQUAL "OFF")
|
|
|
|
add_subdirectory(doc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${LINE_LIMIT})
|
|
|
|
include(line_limit)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${REGEX_CHECK})
|
|
|
|
include(regex_check)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${LINE_LIMIT} OR ${REGEX_CHECK})
|
|
|
|
include(check)
|
|
|
|
endif()
|