CMakeLists.txt

Sun, 21 May 2023 16:22:09 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 21 May 2023 16:22:09 +0200
changeset 710
2dd409ed056f
parent 701
72a440c437e9
child 752
aaad6674a1a3
permissions
-rw-r--r--

fix const-ness of non-mutating iterator creation for maps

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@701 5 cmake_policy(SET CMP0077 NEW)
universe@375 6 set(CMAKE_C_STANDARD 11)
universe@641 7 set(CMAKE_C_STANDARD_REQUIRED 11)
universe@372 8
universe@433 9 option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF)
universe@433 10 if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC)
universe@433 11 add_compile_options(-Wall -Wextra -pedantic)
universe@433 12 endif()
universe@433 13
universe@375 14 # Library
universe@375 15 add_subdirectory(src)
universe@372 16
universe@375 17 # Tests
universe@375 18 enable_testing()
universe@653 19 add_subdirectory(tests)
universe@372 20
universe@372 21 # Web Documentation
universe@372 22 add_subdirectory(docs/src)
universe@372 23
universe@372 24 # API Documentation
universe@420 25 message(CHECK_START "Seaching for Doxygen")
universe@372 26 find_package(Doxygen)
universe@420 27 if(DOXYGEN_FOUND)
universe@420 28 message(CHECK_PASS "found.")
universe@420 29 else()
universe@420 30 message(CHECK_FAIL "not found - documentation will not be generated.")
universe@420 31 endif()
universe@420 32 option(BUILD_API_DOC "Create API documentation." ON)
universe@372 33
universe@420 34 if(BUILD_API_DOC AND DOXYGEN_FOUND)
universe@463 35 set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src/cx)
universe@372 36 set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs)
universe@372 37 set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png)
universe@372 38
universe@372 39 configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile)
universe@372 40
universe@390 41 add_custom_target(docs-api-21
universe@390 42 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1
universe@390 43 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
universe@390 44 COMMENT "Copying UCX 2.1 API documentation.")
universe@390 45
universe@372 46 add_custom_target(docs-api
universe@372 47 COMMAND ${DOXYGEN_EXECUTABLE}
universe@372 48 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
universe@390 49 COMMENT "Generating API documentation with Doxygen.")
universe@390 50
universe@390 51 add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21)
universe@390 52 else()
universe@390 53 add_custom_target(docs-all DEPENDS docs-html)
universe@372 54 endif()
universe@372 55

mercurial