CMakeLists.txt

Sun, 14 Feb 2021 11:30:47 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 14 Feb 2021 11:30:47 +0100
changeset 410
76b76f0f046b
parent 390
d345541018fa
child 420
8eb6faa2edba
permissions
-rw-r--r--

add test config and let the test binary return nonzero on test failures

universe@390 1 cmake_minimum_required(VERSION 3.14)
universe@390 2 project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions")
universe@372 3
universe@375 4 # Configuration
universe@375 5 set(CMAKE_C_STANDARD 11)
universe@375 6 set(CMAKE_C_STANDARD_REQUIRED 99)
universe@372 7
universe@375 8 # Library
universe@375 9 add_subdirectory(src)
universe@372 10
universe@375 11 # Tests
universe@375 12 enable_testing()
universe@375 13 add_subdirectory(test)
universe@372 14
universe@372 15 # Web Documentation
universe@372 16 add_subdirectory(docs/src)
universe@372 17
universe@372 18 # API Documentation
universe@372 19 find_package(Doxygen)
universe@372 20 option(BUILD_DOCUMENTATION "Create API documentation." ${DOXYGEN_FOUND})
universe@372 21
universe@372 22 if(BUILD_DOCUMENTATION)
universe@372 23 if(NOT DOXYGEN_FOUND)
universe@372 24 message(FATAL_ERROR "Doxygen is needed to build the documentation.")
universe@372 25 endif()
universe@372 26
universe@372 27 set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src)
universe@372 28 set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs)
universe@372 29 set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png)
universe@372 30
universe@372 31 configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile)
universe@372 32
universe@390 33 add_custom_target(docs-api-21
universe@390 34 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1
universe@390 35 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
universe@390 36 COMMENT "Copying UCX 2.1 API documentation.")
universe@390 37
universe@372 38 add_custom_target(docs-api
universe@372 39 COMMAND ${DOXYGEN_EXECUTABLE}
universe@372 40 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
universe@390 41 COMMENT "Generating API documentation with Doxygen.")
universe@390 42
universe@390 43 add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21)
universe@390 44 else()
universe@390 45 add_custom_target(docs-all DEPENDS docs-html)
universe@372 46 endif()
universe@372 47

mercurial