universe@390: cmake_minimum_required(VERSION 3.14) universe@390: project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions") universe@372: universe@375: # Configuration universe@375: set(CMAKE_C_STANDARD 11) universe@375: set(CMAKE_C_STANDARD_REQUIRED 99) universe@372: universe@433: option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF) universe@433: if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC) universe@433: add_compile_options(-Wall -Wextra -pedantic) universe@433: endif() universe@433: universe@375: # Library universe@375: add_subdirectory(src) universe@372: universe@375: # Tests universe@375: enable_testing() universe@375: add_subdirectory(test) universe@372: universe@372: # Web Documentation universe@372: add_subdirectory(docs/src) universe@372: universe@372: # API Documentation universe@420: message(CHECK_START "Seaching for Doxygen") universe@372: find_package(Doxygen) universe@420: if(DOXYGEN_FOUND) universe@420: message(CHECK_PASS "found.") universe@420: else() universe@420: message(CHECK_FAIL "not found - documentation will not be generated.") universe@420: endif() universe@420: option(BUILD_API_DOC "Create API documentation." ON) universe@372: universe@420: if(BUILD_API_DOC AND DOXYGEN_FOUND) universe@372: set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src) universe@372: set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs) universe@372: set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png) universe@372: universe@372: configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile) universe@372: universe@390: add_custom_target(docs-api-21 universe@390: COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1 universe@390: WORKING_DIRECTORY ${CMAKE_BINARY_DIR} universe@390: COMMENT "Copying UCX 2.1 API documentation.") universe@390: universe@372: add_custom_target(docs-api universe@372: COMMAND ${DOXYGEN_EXECUTABLE} universe@372: WORKING_DIRECTORY ${CMAKE_BINARY_DIR} universe@390: COMMENT "Generating API documentation with Doxygen.") universe@390: universe@390: add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21) universe@390: else() universe@390: add_custom_target(docs-all DEPENDS docs-html) universe@372: endif() universe@372: