2018-03-26 18:19:39 +00:00
|
|
|
project(ki)
|
|
|
|
cmake_minimum_required(VERSION 3.1)
|
|
|
|
|
2018-10-20 18:02:11 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
|
2018-03-31 16:52:20 +00:00
|
|
|
set(RAPIDXML_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/third_party)
|
|
|
|
add_library(RapidXML INTERFACE)
|
|
|
|
target_include_directories(RapidXML INTERFACE ${RAPIDXML_INCLUDE_DIR})
|
|
|
|
|
2018-03-26 18:19:39 +00:00
|
|
|
add_library(${PROJECT_NAME})
|
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
CXX_STANDARD 11
|
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
2018-03-26 20:39:10 +00:00
|
|
|
PRIVATE
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
INTERFACE
|
2018-03-26 18:19:39 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
)
|
2018-03-31 16:52:20 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME} RapidXML)
|
2018-03-26 18:19:39 +00:00
|
|
|
|
2018-03-26 20:39:10 +00:00
|
|
|
add_subdirectory("src/dml")
|
2018-04-03 15:43:00 +00:00
|
|
|
add_subdirectory("src/protocol")
|
2018-03-26 20:39:10 +00:00
|
|
|
|
2018-11-18 17:19:18 +00:00
|
|
|
find_package(Doxygen)
|
|
|
|
option(KI_BUILD_DOCUMENTATION "Determines whether to build the HTML documentation. (via Doxygen)" ${DOXYGEN_FOUND})
|
|
|
|
if (KI_BUILD_DOCUMENTATION)
|
|
|
|
if(NOT DOXYGEN_FOUND)
|
|
|
|
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(DOXYFILE_IN ${PROJECT_SOURCE_DIR}/docs/Doxyfile.in)
|
|
|
|
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
|
|
|
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
|
|
|
|
|
|
|
|
add_custom_target(
|
|
|
|
doc ALL
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-10-20 18:02:11 +00:00
|
|
|
option(COVERALLS "Generate coveralls data" OFF)
|
|
|
|
if (COVERALLS)
|
|
|
|
include(Coveralls)
|
|
|
|
coveralls_turn_on_coverage()
|
|
|
|
|
|
|
|
get_target_property(COVERAGE_SRCS ${PROJECT_NAME} SOURCES)
|
|
|
|
coveralls_setup("${COVERAGE_SRCS}" ON)
|
|
|
|
endif()
|
|
|
|
|
2018-03-26 18:19:39 +00:00
|
|
|
option(KI_BUILD_EXAMPLES "Determines whether to build examples." ON)
|
|
|
|
if (KI_BUILD_EXAMPLES)
|
|
|
|
add_subdirectory("examples")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(KI_BUILD_TESTS "Determines whether to build tests." ON)
|
|
|
|
if (KI_BUILD_TESTS)
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory("test")
|
|
|
|
endif()
|