CMakeLists.txt

Sun, 01 May 2022 10:39:13 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 01 May 2022 10:39:13 +0200
changeset 540
47e0f2237a94
parent 463
92721c8f9db3
child 641
d402fead3386
permissions
-rw-r--r--

fix regression: nitems adjusted at the wrong location

cmake_minimum_required(VERSION 3.14)
project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions")

# Configuration
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED  99)

option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF)
if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC)
    add_compile_options(-Wall -Wextra -pedantic)
endif()

# Library
add_subdirectory(src)

# Tests
enable_testing()
add_subdirectory(test)

# Web Documentation
add_subdirectory(docs/src)

# API Documentation
message(CHECK_START "Seaching for Doxygen")
find_package(Doxygen)
if(DOXYGEN_FOUND)
    message(CHECK_PASS "found.")
else()
    message(CHECK_FAIL "not found - documentation will not be generated.")
endif()
option(BUILD_API_DOC "Create API documentation." ON)

if(BUILD_API_DOC AND DOXYGEN_FOUND)
    set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src/cx)
    set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs)
    set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png)

    configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile)

    add_custom_target(docs-api-21
            COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1
            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
            COMMENT "Copying UCX 2.1 API documentation.")

    add_custom_target(docs-api
            COMMAND ${DOXYGEN_EXECUTABLE}
            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
            COMMENT "Generating API documentation with Doxygen.")

    add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21)
else()
    add_custom_target(docs-all DEPENDS docs-html)
endif()

mercurial