CMakeLists.txt

Tue, 04 Oct 2022 19:25:07 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 04 Oct 2022 19:25:07 +0200
changeset 591
7df0bcaecffa
parent 463
92721c8f9db3
child 641
d402fead3386
permissions
-rw-r--r--

fix over-optimization of strstr

1. it's actually less performant to frequently read bytes
from an array instead of using the native word length
2. the SBO buffer should be local and not static to allow
multi-threading usage

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

mercurial