From d349796363163419026d7ced0f46f3702ba4a2df Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 26 Sep 2023 17:11:57 -0400 Subject: [PATCH 01/96] initial commit --- .gitignore | 1 + CMakeLists.txt | 17 +++++++++++++++++ README.md | 21 +++++++++++++++++++++ cmake/xo_cxx.cmake | 23 +++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 cmake/xo_cxx.cmake diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..b1480c47 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) + +project(xo_macros VERSION 1.0) + +# if any are useful for this project.. +#include (cmake/foo.cmake) + +# ---------------------------------------------------------------- +# cmake export + +set(XO_PROJECT_NAME xo_macros) + +install( + FILES + "cmake/xo_cxx.cmake" + DESTINATION share/cmake/${XO_PROJECT_NAME} +) diff --git a/README.md b/README.md new file mode 100644 index 00000000..a06e0291 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# XO cmake modules + +Collects cmake macros to be shared across XO projects (e.g. indentlog, reflect, kalman, ..) + +## Features + +- support for both manyrepo and monorepo projects +- support for generating cmake `xxxConfig.cmake` files, so cmake `find_package()` works reliably + +## Example + +In some XO project `foo`: +``` +$ cd build +$ cmake -DCMAKE_MODULE_PATH=/usr/local/share/cmake .. +``` + +then in `foo/CMakeLists.txt`: +``` +include(xo_macros/xo_cxx) +``` diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake new file mode 100644 index 00000000..6daf88f9 --- /dev/null +++ b/cmake/xo_cxx.cmake @@ -0,0 +1,23 @@ +set(XO_STANDARD_COMPILE_OPTIONS -Werror -Wall -Wextra) +set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) + +macro(xo_copmile_options target) + target_copmile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) +endmacro() + +# dependency on an xo library (including header-only libraries) +# e.g. indentlog +# +# An xo package foo works with cmake +# find_package(foo) +# by providing plugin .cmake files in +# ${PREFIX}/lib/cmake/foo/fooConfig.cmake +# ${PREFIX}/lib/cmake/foo/fooConfigVersion.cmake +# ${PREFIX}/lib/cmake/foo/fooTargets.cmake +# +# dep: name of required dependency, e.g. indentlog +# +macro(xo_internal_dependency target dep) + find_pacakge(${dep} CONFIG REQUIRED) + target_link_libraries(${target} PUBLIC ${dep}) +endmacro() From bd3f39693349aa7e6159a5f7384dc2ae667009b1 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 12:01:27 -0400 Subject: [PATCH 02/96] xo-cmake: + xo_include_options2() --- cmake/xo_cxx.cmake | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 6daf88f9..160a1833 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -1,10 +1,49 @@ + set(XO_STANDARD_COMPILE_OPTIONS -Werror -Wall -Wextra) set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) -macro(xo_copmile_options target) +# ---------------------------------------------------------------- +# use this in subdirs that compile c++ code +# +macro(xo_include_options2 target) + # ---------------------------------------------------------------- + # PROJECT_SOURCE_DIR: + # so we can for example write + # #include "ordinaltree/foo.hpp" + # from anywhere in the project + # PROJECT_BINARY_DIR: + # since generated version file will be in build directory, + # need that build directory to also appear in + # compiler's include path + # + target_include_directories( + ${target} PUBLIC + $ # e.g. for #include "indentlog/scope.hpp" + $ + $ # e.g. for #include "Refcounted.hpp" in refcnt/src + $ + $ # e.g. for generated .hpp files + ) + + # ---------------------------------------------------------------- + # make standard directories for std:: includes explicit + # so that + # (1) they appear in compile_commands.json. + # (2) clangd (run from emacs lsp-mode) can find them + # + if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) + endif() +endmacro() + +# ---------------------------------------------------------------- +# +macro(xo_compile_options target) target_copmile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) endmacro() +# ---------------------------------------------------------------- +# # dependency on an xo library (including header-only libraries) # e.g. indentlog # @@ -18,6 +57,6 @@ endmacro() # dep: name of required dependency, e.g. indentlog # macro(xo_internal_dependency target dep) - find_pacakge(${dep} CONFIG REQUIRED) + find_package(${dep} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${dep}) endmacro() From 3da73f5d3c9beba836ca29c3ed9c6ab22aa6ee2c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 13:18:40 -0400 Subject: [PATCH 03/96] xo-cmake: + xo_install_include_tree() --- cmake/xo_cxx.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 160a1833..d2f95936 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -42,6 +42,13 @@ macro(xo_compile_options target) target_copmile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) endmacro() +# ---------------------------------------------------------------- +# use this to install typical include file subtree +# +macro(xo_install_include_tree) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) +endmacro() + # ---------------------------------------------------------------- # # dependency on an xo library (including header-only libraries) From 795d5ddb69ff38ccdb9ffcbe5226af7b194d5ec7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 13:18:59 -0400 Subject: [PATCH 04/96] xo-cmake: + xo_install_library2() --- cmake/xo_cxx.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index d2f95936..6728db82 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -49,6 +49,22 @@ macro(xo_install_include_tree) install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) endmacro() +# ---------------------------------------------------------------- +# use this for a subdir that builds a library +# and supports find_package() +# +macro(xo_install_library2 target) + install( + TARGETS ${target} + EXPORT ${target}Targets + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) +endmacro() + # ---------------------------------------------------------------- # # dependency on an xo library (including header-only libraries) From 8884d7f9aa55f6a77530f7487a5bec0f24860544 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 13:19:11 -0400 Subject: [PATCH 05/96] xo-cmake: + xo_export_cmake_config() --- cmake/xo_cxx.cmake | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 6728db82..8f70a590 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -65,6 +65,40 @@ macro(xo_install_library2 target) ) endmacro() +# ---------------------------------------------------------------- + +# for projectname=foo, require: +# cmake/fooConfig.cmake.in +# +# prepares +# ${PREFIX}/lib/cmake/foo/fooConfig.cmake +# ${PREFIX}/lib/cmake/foo/fooConfigVersion.cmake +# ${PREFIX}/lib/cmake/foo/fooTargets.cmake +# +macro(xo_export_cmake_config projectname projectversion projecttargets) + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" + VERSION ${projectversion} + COMPATIBILITY AnyNewerVersion + ) + configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/${projectname}Config.cmake.in" + "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" + INSTALL_DESTINATION lib/cmake/${projectname} + ) + install( + EXPORT ${projecttargets} + DESTINATION lib/cmake/${projectname} + ) + install( + FILES + "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" + "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" + DESTINATION lib/cmake/${projectname} + ) +endmacro() + # ---------------------------------------------------------------- # # dependency on an xo library (including header-only libraries) From dbb9f38e8d2a6ceb9bfdd3bc4909f1390d77088c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 16:06:18 -0400 Subject: [PATCH 06/96] xo-cmake: + xo_toplevel_compile_options() --- cmake/xo_cxx.cmake | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 160a1833..dac88151 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -1,6 +1,32 @@ -set(XO_STANDARD_COMPILE_OPTIONS -Werror -Wall -Wextra) -set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) +macro(xo_toplevel_compile_options) + # ---------------------------------------------------------------- + # variable + # XO_ADDRESS_SANITIZE + # determines whether to enable address sanitizer for the XO project + # (see toplevel CMakeLists.txt) + # ---------------------------------------------------------------- + if(XO_ADDRESS_SANITIZE) + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) + endif() + + set(XO_STANDARD_COMPILE_OPTIONS -Werror -Wall -Wextra) + # XO_ADDRESS_SANITIZE_COMPILE_OPTIONS: use when XO_ADDRESS_SANITIZE=ON + # + # address sanitizer build complains about _FORTIFY_SOURCE redefines + # In file included from :460: + # :1:9: error: '_FORTIFY_SOURCE' macro redefined [-Werror,-Wmacro-redefined] + # #define _FORTIFY_SOURCE 2 + # + set(XO_ADDRESS_SANITIZE_COMPILE_OPTIONS -Werror -Wall -Wextra -Wno-macro-redefined) + + if(XO_ADDRESS_SANITIZE) + set(XO_COMPILE_OPTIONS ${XO_ADDRESS_SANITIZE_COMPILE_OPTIONS}) + else() + set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) + endif() +endif() # ---------------------------------------------------------------- # use this in subdirs that compile c++ code @@ -38,6 +64,9 @@ endmacro() # ---------------------------------------------------------------- # +# Require: +# needs to be preceded by call to xo_toplevel_compile_options() +# macro(xo_compile_options target) target_copmile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) endmacro() From 6d9eb677433a470f7141c41a09a8d64a25281f92 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 16:14:12 -0400 Subject: [PATCH 07/96] xo-cmake: bugfix: typos! --- cmake/xo_cxx.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index e435de55..1d1736fe 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -26,7 +26,7 @@ macro(xo_toplevel_compile_options) else() set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) endif() -endif() +endmacro() # ---------------------------------------------------------------- # use this in subdirs that compile c++ code @@ -68,7 +68,7 @@ endmacro() # needs to be preceded by call to xo_toplevel_compile_options() # macro(xo_compile_options target) - target_copmile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) + target_compile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) endmacro() # ---------------------------------------------------------------- From fc1963424ce5d69e5e6f1887ee96979e8438db4a Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 16:28:43 -0400 Subject: [PATCH 08/96] xo-cmake: + code-coverage.cmake --- cmake/code-coverage.cmake | 678 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 678 insertions(+) create mode 100644 cmake/code-coverage.cmake diff --git a/cmake/code-coverage.cmake b/cmake/code-coverage.cmake new file mode 100644 index 00000000..b6b36064 --- /dev/null +++ b/cmake/code-coverage.cmake @@ -0,0 +1,678 @@ +# +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# USAGE: To enable any code coverage instrumentation/targets, the single CMake +# option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or +# on the command line. +# +# From this point, there are two primary methods for adding instrumentation to +# targets: +# +# 1 - A blanket instrumentation by calling `add_code_coverage()`, where +# all targets in that directory and all subdirectories are automatically +# instrumented. +# +# 2 - Per-target instrumentation by calling +# `target_code_coverage()`, where the target is given and thus only +# that target is instrumented. This applies to both libraries and executables. +# +# To add coverage targets, such as calling `make ccov` to generate the actual +# coverage information for perusal or consumption, call +# `target_code_coverage()` on an *executable* target. +# +# Example 1: All targets instrumented +# +# In this case, the coverage information reported will will be that of the +# `theLib` library target and `theExe` executable. +# +# 1a: Via global command +# +# ~~~ +# add_code_coverage() # Adds instrumentation to all targets +# +# add_library(theLib lib.cpp) +# +# add_executable(theExe main.cpp) +# target_link_libraries(theExe PRIVATE theLib) +# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target +# # (instrumentation already added via global anyways) +# # for generating code coverage reports. +# ~~~ +# +# 1b: Via target commands +# +# ~~~ +# add_library(theLib lib.cpp) +# target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets. +# +# add_executable(theExe main.cpp) +# target_link_libraries(theExe PRIVATE theLib) +# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports. +# ~~~ +# +# Example 2: Target instrumented, but with regex pattern of files to be excluded +# from report +# +# ~~~ +# add_executable(theExe main.cpp non_covered.cpp) +# target_code_coverage(theExe EXCLUDE non_covered.cpp test/*) # As an executable target, the reports will exclude the non-covered.cpp file, and any files in a test/ folder. +# ~~~ +# +# Example 3: Target added to the 'ccov' and 'ccov-all' targets +# +# ~~~ +# add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders. +# +# add_executable(theExe main.cpp non_covered.cpp) +# target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder. +# ~~~ + +# Options +option( + CODE_COVERAGE + "Builds targets with code coverage instrumentation. (Requires GCC or Clang)" + OFF) + +# Programs +find_program(LLVM_COV_PATH llvm-cov) +find_program(LLVM_PROFDATA_PATH llvm-profdata) +find_program(LCOV_PATH lcov) +find_program(GENHTML_PATH genhtml) +# Hide behind the 'advanced' mode flag for GUI/ccmake +mark_as_advanced(FORCE LLVM_COV_PATH LLVM_PROFDATA_PATH LCOV_PATH GENHTML_PATH) + +# Variables +set(CMAKE_COVERAGE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ccov) +set_property(GLOBAL PROPERTY JOB_POOLS ccov_serial_pool=1) + +# Common initialization/checks +if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED) + set(CODE_COVERAGE_ADDED ON) + + # Common Targets + add_custom_target( + ccov-preprocessing + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY} + DEPENDS ccov-clean) + + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + # Messages + message(STATUS "Building with llvm Code Coverage Tools") + + if(NOT LLVM_COV_PATH) + message(FATAL_ERROR "llvm-cov not found! Aborting.") + else() + # Version number checking for 'EXCLUDE' compatibility + execute_process(COMMAND ${LLVM_COV_PATH} --version + OUTPUT_VARIABLE LLVM_COV_VERSION_CALL_OUTPUT) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LLVM_COV_VERSION + ${LLVM_COV_VERSION_CALL_OUTPUT}) + + if(LLVM_COV_VERSION VERSION_LESS "7.0.0") + message( + WARNING + "target_code_coverage()/add_code_coverage_all_targets() 'EXCLUDE' option only available on llvm-cov >= 7.0.0" + ) + endif() + endif() + + # Targets + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-clean + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list) + else() + add_custom_target( + ccov-clean + COMMAND ${CMAKE_COMMAND} -E rm -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND ${CMAKE_COMMAND} -E rm -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list) + endif() + + # Used to get the shared object file list before doing the main all- + # processing + add_custom_target( + ccov-libs + COMMAND ; + COMMENT "libs ready for coverage report.") + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + # Messages + message(STATUS "Building with lcov Code Coverage Tools") + + if(CMAKE_BUILD_TYPE) + string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type) + if(NOT ${upper_build_type} STREQUAL "DEBUG") + message( + WARNING + "Code coverage results with an optimized (non-Debug) build may be misleading" + ) + endif() + else() + message( + WARNING + "Code coverage results with an optimized (non-Debug) build may be misleading" + ) + endif() + if(NOT LCOV_PATH) + message(FATAL_ERROR "lcov not found! Aborting...") + endif() + if(NOT GENHTML_PATH) + message(FATAL_ERROR "genhtml not found! Aborting...") + endif() + + # Targets + add_custom_target(ccov-clean COMMAND ${LCOV_PATH} --directory + ${CMAKE_BINARY_DIR} --zerocounters) + + else() + message(FATAL_ERROR "Code coverage requires Clang or GCC. Aborting.") + endif() +endif() + +# Adds code coverage instrumentation to a library, or instrumentation/targets +# for an executable target. +# ~~~ +# EXECUTABLE ADDED TARGETS: +# GCOV/LCOV: +# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-${TARGET_NAME} : Generates HTML code coverage report for the associated named target. +# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report. +# +# LLVM-COV: +# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-${TARGET_NAME} : Generates HTML code coverage report. +# ccov-report-${TARGET_NAME} : Prints to command line summary per-file coverage information. +# ccov-export-${TARGET_NAME} : Exports the coverage report to a JSON file. +# ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information. +# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report. +# ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line. +# ccov-all-export : Exports the coverage report to a JSON file. +# +# Required: +# TARGET_NAME - Name of the target to generate code coverage for. +# Optional: +# PUBLIC - Sets the visibility for added compile options to targets to PUBLIC instead of the default of PRIVATE. +# INTERFACE - Sets the visibility for added compile options to targets to INTERFACE instead of the default of PRIVATE. +# PLAIN - Do not set any target visibility (backward compatibility with old cmake projects) +# AUTO - Adds the target to the 'ccov' target so that it can be run in a batch with others easily. Effective on executable targets. +# ALL - Adds the target to the 'ccov-all' and 'ccov-all-report' targets, which merge several executable targets coverage data to a single report. Effective on executable targets. +# EXTERNAL - For GCC's lcov, allows the profiling of 'external' files from the processing directory +# COVERAGE_TARGET_NAME - For executables ONLY, changes the outgoing target name so instead of `ccov-${TARGET_NAME}` it becomes `ccov-${COVERAGE_TARGET_NAME}`. +# EXCLUDE - Excludes files of the patterns provided from coverage. Note that GCC/lcov excludes by glob pattern, and clang/LLVM excludes via regex! **These do not copy to the 'all' targets.** +# OBJECTS - For executables ONLY, if the provided targets are shared libraries, adds coverage information to the output +# ARGS - For executables ONLY, appends the given arguments to the associated ccov-* executable call +# ~~~ +function(target_code_coverage TARGET_NAME) + # Argument parsing + set(options AUTO ALL EXTERNAL PUBLIC INTERFACE PLAIN) + set(single_value_keywords COVERAGE_TARGET_NAME) + set(multi_value_keywords EXCLUDE OBJECTS ARGS) + cmake_parse_arguments( + target_code_coverage "${options}" "${single_value_keywords}" + "${multi_value_keywords}" ${ARGN}) + + # Set the visibility of target functions to PUBLIC, INTERFACE or default to + # PRIVATE. + if(target_code_coverage_PUBLIC) + set(TARGET_VISIBILITY PUBLIC) + set(TARGET_LINK_VISIBILITY PUBLIC) + elseif(target_code_coverage_INTERFACE) + set(TARGET_VISIBILITY INTERFACE) + set(TARGET_LINK_VISIBILITY INTERFACE) + elseif(target_code_coverage_PLAIN) + set(TARGET_VISIBILITY PUBLIC) + set(TARGET_LINK_VISIBILITY) + else() + set(TARGET_VISIBILITY PRIVATE) + set(TARGET_LINK_VISIBILITY PRIVATE) + endif() + + if(NOT target_code_coverage_COVERAGE_TARGET_NAME) + # If a specific name was given, use that instead. + set(target_code_coverage_COVERAGE_TARGET_NAME ${TARGET_NAME}) + endif() + + if(CODE_COVERAGE) + + # Add code coverage instrumentation to the target's linker command + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} + -fprofile-instr-generate -fcoverage-mapping) + target_link_options(${TARGET_NAME} ${TARGET_VISIBILITY} + -fprofile-instr-generate -fcoverage-mapping) + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} -fprofile-arcs + -ftest-coverage) + target_link_libraries(${TARGET_NAME} ${TARGET_LINK_VISIBILITY} gcov) + endif() + + # Targets + get_target_property(target_type ${TARGET_NAME} TYPE) + + # Add shared library to processing for 'all' targets + if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${CMAKE_COMMAND} -E echo "-object=$" >> + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + DEPENDS ccov-preprocessing ${TARGET_NAME}) + + if(NOT TARGET ccov-libs) + message( + FATAL_ERROR + "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'." + ) + endif() + + add_dependencies(ccov-libs + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + + # For executables add targets to run and produce output + if(target_type STREQUAL "EXECUTABLE") + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + + # If there are shared objects to also work with, generate the string to + # add them here + foreach(SO_TARGET ${target_code_coverage_OBJECTS}) + # Check to see if the target is a shared object + if(TARGET ${SO_TARGET}) + get_target_property(SO_TARGET_TYPE ${SO_TARGET} TYPE) + if(${SO_TARGET_TYPE} STREQUAL "SHARED_LIBRARY") + set(SO_OBJECTS ${SO_OBJECTS} -object=$) + endif() + endif() + endforeach() + + # Run the executable, generating raw profile data Make the run data + # available for further processing. Separated to allow Windows to run + # this target serially. + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${CMAKE_COMMAND} -E env + LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw + $ ${target_code_coverage_ARGS} + COMMAND + ${CMAKE_COMMAND} -E echo "-object=$" + ${SO_OBJECTS} >> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND + ${CMAKE_COMMAND} -E echo + "${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw" + >> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list + JOB_POOL ccov_serial_pool + DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME}) + + # Merge the generated profile data so llvm-cov can process it + add_custom_target( + ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_PROFDATA_PATH} merge -sparse + ${target_code_coverage_COVERAGE_TARGET_NAME}.profraw -o + ${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Ignore regex only works on LLVM >= 7 + if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0") + foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} + -ignore-filename-regex='${EXCLUDE_ITEM}') + endforeach() + endif() + + # Print out details of the coverage information to the command line + add_custom_target( + ccov-show-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} show $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -show-line-counts-or-regions ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Print out a summary of the coverage information to the command line + add_custom_target( + ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} report $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Export coverage information so continuous integration tools (e.g. + # Jenkins) can consume it + add_custom_target( + ccov-export-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} export $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -format="text" ${EXCLUDE_REGEX} > + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.json + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Generates HTML output of the coverage information for perusal + add_custom_target( + ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} show $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME} + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + set(COVERAGE_INFO + "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.info" + ) + + # Run the executable, generating coverage information + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND $ ${target_code_coverage_ARGS} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + + # Generate exclusion string for use + foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO} + '${EXCLUDE_ITEM}') + endforeach() + + if(EXCLUDE_REGEX) + set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file + ${COVERAGE_INFO}) + else() + set(EXCLUDE_COMMAND ;) + endif() + + if(NOT ${target_code_coverage_EXTERNAL}) + set(EXTERNAL_OPTION --no-external) + endif() + + # Capture coverage data + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters + COMMAND $ ${target_code_coverage_ARGS} + COMMAND + ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory + ${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file + ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + else() + add_custom_target( + ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters + COMMAND $ ${target_code_coverage_ARGS} + COMMAND + ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory + ${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file + ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + endif() + + # Generates HTML output of the coverage information for perusal + add_custom_target( + ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${GENHTML_PATH} -o + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME} + ${COVERAGE_INFO} + DEPENDS ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + + add_custom_command( + TARGET ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + POST_BUILD + COMMAND ; + COMMENT + "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}/index.html in your browser to view the coverage report." + ) + + # AUTO + if(target_code_coverage_AUTO) + if(NOT TARGET ccov) + add_custom_target(ccov) + endif() + add_dependencies(ccov ccov-${target_code_coverage_COVERAGE_TARGET_NAME}) + + if(NOT CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_ID + MATCHES "GNU") + if(NOT TARGET ccov-report) + add_custom_target(ccov-report) + endif() + add_dependencies( + ccov-report + ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + + # ALL + if(target_code_coverage_ALL) + if(NOT TARGET ccov-all-processing) + message( + FATAL_ERROR + "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'." + ) + endif() + + add_dependencies(ccov-all-processing + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + endif() +endfunction() + +# Adds code coverage instrumentation to all targets in the current directory and +# any subdirectories. To add coverage instrumentation to only specific targets, +# use `target_code_coverage`. +function(add_code_coverage) + if(CODE_COVERAGE) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + add_compile_options(-fprofile-instr-generate -fcoverage-mapping) + add_link_options(-fprofile-instr-generate -fcoverage-mapping) + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + add_compile_options(-fprofile-arcs -ftest-coverage) + link_libraries(gcov) + endif() + endif() +endfunction() + +# Adds the 'ccov-all' type targets that calls all targets added via +# `target_code_coverage` with the `ALL` parameter, but merges all the coverage +# data from them into a single large report instead of the numerous smaller +# reports. Also adds the ccov-all-capture Generates an all-merged.info file, for +# use with coverage dashboards (e.g. codecov.io, coveralls). +# ~~~ +# Optional: +# EXCLUDE - Excludes files of the patterns provided from coverage. Note that GCC/lcov excludes by glob pattern, and clang/LLVM excludes via regex! +# ~~~ +function(add_code_coverage_all_targets) + # Argument parsing + set(multi_value_keywords EXCLUDE) + cmake_parse_arguments(add_code_coverage_all_targets "" "" + "${multi_value_keywords}" ${ARGN}) + + if(CODE_COVERAGE) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + + # Merge the profile data for all of the run executables + if(WIN32) + add_custom_target( + ccov-all-processing + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list\; llvm-profdata.exe + merge -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -sparse $$FILELIST) + else() + add_custom_target( + ccov-all-processing + COMMAND + ${LLVM_PROFDATA_PATH} merge -o + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata -sparse `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list`) + endif() + + # Regex exclude only available for LLVM >= 7 + if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0") + foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} + -ignore-filename-regex='${EXCLUDE_ITEM}') + endforeach() + endif() + + # Print summary of the code coverage information to the command line + if(WIN32) + add_custom_target( + ccov-all-report + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list\; llvm-cov.exe + report $$FILELIST + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + else() + add_custom_target( + ccov-all-report + COMMAND + ${LLVM_COV_PATH} report `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + endif() + + # Export coverage information so continuous integration tools (e.g. + # Jenkins) can consume it + add_custom_target( + ccov-all-export + COMMAND + ${LLVM_COV_PATH} export `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -format="text" ${EXCLUDE_REGEX} > + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/coverage.json + DEPENDS ccov-all-processing) + + # Generate HTML output of all added targets for perusal + if(WIN32) + add_custom_target( + ccov-all + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list\; llvm-cov.exe show + $$FILELIST + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + else() + add_custom_target( + ccov-all + COMMAND + ${LLVM_COV_PATH} show `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + endif() + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + set(COVERAGE_INFO "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.info") + + # Nothing required for gcov + add_custom_target(ccov-all-processing COMMAND ;) + + # Exclusion regex string creation + set(EXCLUDE_REGEX) + foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO} + '${EXCLUDE_ITEM}') + endforeach() + + if(EXCLUDE_REGEX) + set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file + ${COVERAGE_INFO}) + else() + set(EXCLUDE_COMMAND ;) + endif() + + # Capture coverage data + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-all-capture + COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture + --output-file ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ccov-all-processing) + else() + add_custom_target( + ccov-all-capture + COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture + --output-file ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ccov-all-processing) + endif() + + # Generates HTML output of all targets for perusal + add_custom_target( + ccov-all + COMMAND ${GENHTML_PATH} -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + ${COVERAGE_INFO} -p ${CMAKE_SOURCE_DIR} + DEPENDS ccov-all-capture) + + endif() + + add_custom_command( + TARGET ccov-all + POST_BUILD + COMMAND ; + COMMENT + "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report." + ) + endif() +endfunction() From 6ab05249030dcf074c67e8bb86144d7bfd5c5143 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 16:31:52 -0400 Subject: [PATCH 09/96] xo-cmake: bugfix: must install code-coverage.cmake --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1480c47..c018ef2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,5 +13,6 @@ set(XO_PROJECT_NAME xo_macros) install( FILES "cmake/xo_cxx.cmake" + "cmake/code-coverage.cmake" DESTINATION share/cmake/${XO_PROJECT_NAME} ) From 0c9d13b7eb0a915604a44ea417552f243e27f5f0 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 16:54:26 -0400 Subject: [PATCH 10/96] xo-cmake: + xo_self_dependency() --- cmake/xo_cxx.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 1d1736fe..018f75fe 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -146,3 +146,14 @@ macro(xo_internal_dependency target dep) find_package(${dep} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${dep}) endmacro() + +# dependency on target provided from this codebase. +# +# 1. don't need find_package() in this case, since details of dep targets +# must be known to cmake for it to build them. +# 2. in any case, can't use find_package() when cmake runs, +# because supporting .cmake files haven't been generated yet +# +macro(xo_self_dependency target dep) + target_link_libraries(${target} PUBLIC ${dep}) +endmacro() From 31d8ce44def547b27e8a9c0eec52442899a30a06 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 17:20:26 -0400 Subject: [PATCH 11/96] xo-cmake: + xo_include_headeronly_options2() --- cmake/xo_cxx.cmake | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 018f75fe..1e5d8897 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -29,7 +29,8 @@ macro(xo_toplevel_compile_options) endmacro() # ---------------------------------------------------------------- -# use this in subdirs that compile c++ code +# use this in subdirs that compile c++ code. +# do not use for header-only subsystems; see xo_include_headeronly_options2() # macro(xo_include_options2 target) # ---------------------------------------------------------------- @@ -62,6 +63,37 @@ macro(xo_include_options2 target) endif() endmacro() +macro(xo_include_headeronly_options2 target) + # ---------------------------------------------------------------- + # PROJECT_SOURCE_DIR: + # so we can for example write + # #include "ordinaltree/foo.hpp" + # from anywhere in the project + # PROJECT_BINARY_DIR: + # since generated version file will be in build directory, + # need that build directory to also appear in + # compiler's include path + # + target_include_directories( + ${target} INTERFACE + $ # e.g. for #include "indentlog/scope.hpp" + $ + $ # e.g. for #include "Refcounted.hpp" in refcnt/src + $ + $ # e.g. for generated .hpp files + ) + + # ---------------------------------------------------------------- + # make standard directories for std:: includes explicit + # so that + # (1) they appear in compile_commands.json. + # (2) clangd (run from emacs lsp-mode) can find them + # + if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) + endif() +endmacro() + # ---------------------------------------------------------------- # # Require: From f4442c07a7b3ce23e1e883ddde011be8e28b5cac Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 17:54:02 -0400 Subject: [PATCH 12/96] xo-cmake: xo_toplevel_compile_options ++ set CMAKE_INSTALL_RPATH --- cmake/xo_cxx.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index e435de55..2307b06f 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -26,6 +26,11 @@ macro(xo_toplevel_compile_options) else() set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) endif() + + if(NOT CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING + "runpath in installed libraries/executables") + endif() endif() # ---------------------------------------------------------------- From 3d9d49f617de3aea350e7383ad1075a4cab14870 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 18:10:31 -0400 Subject: [PATCH 13/96] xo-cmake: consolidate CMAKE_CXX_STANDARD setting --- cmake/xo_cxx.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index c7f163d2..b02ad99a 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -1,5 +1,12 @@ macro(xo_toplevel_compile_options) + if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) + endif() + if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED True) + endif() + # ---------------------------------------------------------------- # variable # XO_ADDRESS_SANITIZE From 401fc257e88ff2178b9f129f476e50836095ea98 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 18:21:27 -0400 Subject: [PATCH 14/96] xo-cmake: consolidate CMAKE_EXPORT_COMPILE_COMMANDS --- cmake/xo_cxx.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index b02ad99a..53cccb58 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -34,6 +34,13 @@ macro(xo_toplevel_compile_options) set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) endif() + # writes ${PROJECT_BINARY_DIR}/compile_commands.json; + # (symlink from toplevel git dir to tell LSP how to build) + # + if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") + endif() + if(NOT CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING "runpath in installed libraries/executables") From f38f48943762a2bc72efd27ef1ee7dbab7ce6ee2 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 19:40:39 -0400 Subject: [PATCH 15/96] xo-cmake: + xo_add_shared_library() + misc --- cmake/xo_cxx.cmake | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 53cccb58..7fe1c65d 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -47,11 +47,7 @@ macro(xo_toplevel_compile_options) endif() endmacro() -# ---------------------------------------------------------------- -# use this in subdirs that compile c++ code. -# do not use for header-only subsystems; see xo_include_headeronly_options2() -# -macro(xo_include_options2 target) +macro(xo_include_headeronly_options2 target) # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -63,7 +59,7 @@ macro(xo_include_options2 target) # compiler's include path # target_include_directories( - ${target} PUBLIC + ${target} INTERFACE $ # e.g. for #include "indentlog/scope.hpp" $ $ # e.g. for #include "Refcounted.hpp" in refcnt/src @@ -82,7 +78,37 @@ macro(xo_include_options2 target) endif() endmacro() -macro(xo_include_headeronly_options2 target) +# ---------------------------------------------------------------- +# use this for a shared library. +# +macro(xo_add_shared_library target targetversion soversion sources) + add_library(${target} SHARED ${sources}) + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library2(${target}) +endmacro() + +# ---------------------------------------------------------------- +# use this in subdirs that compile c++ code. +# do not use for header-only subsystems; see xo_include_headeronly_options2() +# +macro(xo_include_options2 target) # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -94,7 +120,7 @@ macro(xo_include_headeronly_options2 target) # compiler's include path # target_include_directories( - ${target} INTERFACE + ${target} PUBLIC $ # e.g. for #include "indentlog/scope.hpp" $ $ # e.g. for #include "Refcounted.hpp" in refcnt/src From 2b10fec175580c033a60efb042fb9a8903843ba9 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 3 Oct 2023 17:22:42 -0400 Subject: [PATCH 16/96] + xo_external_target_dependency --- cmake/xo_cxx.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 7fe1c65d..66ac7962 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -224,6 +224,20 @@ macro(xo_internal_dependency target dep) target_link_libraries(${target} PUBLIC ${dep}) endmacro() +# dependency on namespaced target +# e.g. +# add_library(foo ..) or add_executable(foo ...) +# then +# xo_external_namespaced_dependency(foo Catch2 Catch2::Catch2) +# equivalent to +# find_package(Catch2 CONFIG REQUIRED) +# target_link_libraries(foo PUBLIC Catch2::Catch2) +# +macro(xo_external_target_dependency target pkg pkgtarget) + find_package(${pkg} CONFIG REQUIRED) + target_link_libraries(${target} PUBLIC ${pkgtarget}) +endmacro() + # dependency on target provided from this codebase. # # 1. don't need find_package() in this case, since details of dep targets @@ -234,3 +248,6 @@ endmacro() macro(xo_self_dependency target dep) target_link_libraries(${target} PUBLIC ${dep}) endmacro() + +# ---------------------------------------------------------------- +# From 8c1bbb09356ce896c103cc4da02186da2528d9bf Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 4 Oct 2023 13:32:58 -0400 Subject: [PATCH 17/96] xo-cmake: + xo_dependency_headeronly + xo_dependency --- cmake/xo_cxx.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 66ac7962..84ca488e 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -219,11 +219,22 @@ endmacro() # # dep: name of required dependency, e.g. indentlog # -macro(xo_internal_dependency target dep) +macro(xo_dependency target dep) find_package(${dep} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${dep}) endmacro() +macro(xo_internal_dependency target dep) + xo_dependency(target dep) +endmacro() + +# dependency on a header-only library +# +macro(xo_dependency_headeronly target dep) + find_package(${dep} CONFIG REQUIRED) + target_link_libraries(${target} INTERFACE ${dep}) +endmacro() + # dependency on namespaced target # e.g. # add_library(foo ..) or add_executable(foo ...) From ad7ea74f482b26ff4d272761ae4acfcfb0898c01 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 4 Oct 2023 13:35:15 -0400 Subject: [PATCH 18/96] bugfix: macro variables in xo_internal_dependency! --- cmake/xo_cxx.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 84ca488e..afdbc443 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -225,7 +225,7 @@ macro(xo_dependency target dep) endmacro() macro(xo_internal_dependency target dep) - xo_dependency(target dep) + xo_dependency(${target} ${dep}) endmacro() # dependency on a header-only library From 08d4ceeb329ffacffba13b8fb19b95b7d3b1f090 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 16:54:25 -0400 Subject: [PATCH 19/96] provide for xo/ subdir in include path --- cmake/xo_cxx.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index afdbc443..e540bc75 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -62,7 +62,8 @@ macro(xo_include_headeronly_options2 target) ${target} INTERFACE $ # e.g. for #include "indentlog/scope.hpp" $ - $ # e.g. for #include "Refcounted.hpp" in refcnt/src + $ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect $ $ # e.g. for generated .hpp files ) @@ -123,7 +124,8 @@ macro(xo_include_options2 target) ${target} PUBLIC $ # e.g. for #include "indentlog/scope.hpp" $ - $ # e.g. for #include "Refcounted.hpp" in refcnt/src + $ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect $ $ # e.g. for generated .hpp files ) From 035c187cd1503ce004b795a9d54af4568485dfc4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 16:59:19 -0400 Subject: [PATCH 20/96] cmake: remove not-working guards on CMAKE_EXPORT_COMPILE_COMMANDS --- cmake/xo_cxx.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index e540bc75..7eaaaff9 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -37,9 +37,9 @@ macro(xo_toplevel_compile_options) # writes ${PROJECT_BINARY_DIR}/compile_commands.json; # (symlink from toplevel git dir to tell LSP how to build) # - if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS) - set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") - endif() + # note: trying to protect this with if(NOT DEFINED ..) is /not/ effective + # + set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") if(NOT CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING From aaba8f05080816839bc322d8ff32629a306dd78c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 18:33:48 -0400 Subject: [PATCH 21/96] drop include path --- cmake/xo_cxx.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 7eaaaff9..da93eccb 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -64,7 +64,7 @@ macro(xo_include_headeronly_options2 target) $ $ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - $ +# $ $ # e.g. for generated .hpp files ) @@ -126,7 +126,7 @@ macro(xo_include_options2 target) $ $ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - $ +# $ $ # e.g. for generated .hpp files ) From e6e659bc0563ed08726216ac13929aa164488d67 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 20:14:06 -0400 Subject: [PATCH 22/96] + xo_pybind11_link_flags() + xo_pybind11_library() --- cmake/xo_cxx.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index da93eccb..37867d59 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -263,4 +263,46 @@ macro(xo_self_dependency target dep) endmacro() # ---------------------------------------------------------------- +# need this when linking pybind11-generated libraries # +macro(xo_pybind11_link_flags) + # see: + # 1. FAQ Build Issues Q2 + # 2. CMAKE_SHARED_LINKER_FLAGS in src/CMakeLists.txt + # 3. pybind11 cmake support, somewhere like + # [path/to/pybind11-2.9.2/ + # lib/python3.9-pybind11-2.9.2/ + # lib/python3.9/site-packages/ + # pybind11/share/cmake/ + # pybind11/pybind11Common.cmake] + # + set_property( + TARGET pybind11::python_link_helper + APPEND + PROPERTY INTERFACE_LINK_OPTIONS "$<$:LINKER:-flat_namespace>" + ) +endmacro() + +# ---------------------------------------------------------------- +# use this for a subdir that builds a python library using pybind11 +# +# expecting the following +# 1. a directory pyfoo/ -> library pyfoo +# 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp +# +macro(xo_pybind11_library target source_files) + configure_file(${target}.hpp.in ${target}.hpp) + + # find_package(Python..) finds python in + # /Library/Frameworks/Python.framework/... + # but we want to use python from nix + # + #find_package(Python COMPONENTS Interpreter Development REQUIRED) + # + + find_package(pybind11) + pybind11_add_module(${target} MODULE ${source_files}) + xo_pybind11_link_flags() + # use xo_install_library2() instead + #install(TARGETS ${target} DESTINATION lib) +endmacro() From cd6bd92e3f6393fdb9512d9af4a370e58cabe507 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 23:52:45 -0400 Subject: [PATCH 23/96] xo-cmake: tweak exported header dirs --- cmake/xo_cxx.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 37867d59..9b14025f 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -60,11 +60,11 @@ macro(xo_include_headeronly_options2 target) # target_include_directories( ${target} INTERFACE - $ # e.g. for #include "indentlog/scope.hpp" $ + $ + $ # e.g. for #include "indentlog/scope.hpp" $ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect -# $ $ # e.g. for generated .hpp files ) From bfc7828b0ab53fe8342992980699f5cff435b903 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 23:53:04 -0400 Subject: [PATCH 24/96] xo-cmake: bugfix: PUBLIC not INTERFACE in xo_dependency_headeronly() --- cmake/xo_cxx.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 9b14025f..5c4c3d6a 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -234,7 +234,12 @@ endmacro() # macro(xo_dependency_headeronly target dep) find_package(${dep} CONFIG REQUIRED) - target_link_libraries(${target} INTERFACE ${dep}) + # PUBLIC here is important -- it's needed so that include directories that are required by ${dep}, + # will be included in compilation of ${target}. + # + # INTERFACE doesn't make this happen; for a header-only library, it should be supplied to the add_library() macro + # + target_link_libraries(${target} PUBLIC ${dep}) endmacro() # dependency on namespaced target From 8247f9b56f77ee4519d54dab6934d2195d8d2b00 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 23:53:28 -0400 Subject: [PATCH 25/96] pybind11: hack to set library directory (won't work with nix) --- cmake/xo_cxx.cmake | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 5c4c3d6a..3ee07ddb 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -284,8 +284,24 @@ macro(xo_pybind11_link_flags) set_property( TARGET pybind11::python_link_helper APPEND - PROPERTY INTERFACE_LINK_OPTIONS "$<$:LINKER:-flat_namespace>" - ) + PROPERTY + INTERFACE_LINK_OPTIONS "$<$:LINKER:-flat_namespace>") + + # looks like pybind11_add_module() tries to link transitive deps + # of libs mentioned in xo_dependency() -- perhaps for link-time optimization? + # + # For example when linking libpyreflect, get link line with -lrefcnt + # (presumably since cmake knows that libreflect.so depends on librefcnt.so); + # this triggers error, since link doesn't know where to find librefcnt.so + # + # To workaround, add ${CMAKE_INSTALL_PREFIX}/lib to the link line. + # + # WARNING: expect this not to work in a hermetic nix build! + # + set_property(TARGET pybind11::python_link_helper + APPEND + PROPERTY + INTERFACE_LINK_OPTIONS "-L${CMAKE_INSTALL_PREFIX}/lib") endmacro() # ---------------------------------------------------------------- From cb74a35334240b31d48afd29cf85afdb4191668b Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 6 Oct 2023 23:53:56 -0400 Subject: [PATCH 26/96] xo-cmake: pybind11 install tweaks --- cmake/xo_cxx.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 3ee07ddb..1c323823 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -322,8 +322,13 @@ macro(xo_pybind11_library target source_files) # find_package(pybind11) + + # this only works if one source file, right? pybind11_add_module(${target} MODULE ${source_files}) + xo_pybind11_link_flags() + xo_include_options2(${target}) # use xo_install_library2() instead #install(TARGETS ${target} DESTINATION lib) + xo_install_library2(${target}) endmacro() From 863f87db7df9802516ff550f3d5c3d29c15dfd16 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 7 Oct 2023 00:16:07 -0400 Subject: [PATCH 27/96] xo-cmake: unwind mistake, revert to INTERFACE for headeronly dep --- cmake/xo_cxx.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 1c323823..150c665f 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -234,12 +234,17 @@ endmacro() # macro(xo_dependency_headeronly target dep) find_package(${dep} CONFIG REQUIRED) - # PUBLIC here is important -- it's needed so that include directories that are required by ${dep}, - # will be included in compilation of ${target}. + # Conflict here between PUBLIC and INTERFACE # - # INTERFACE doesn't make this happen; for a header-only library, it should be supplied to the add_library() macro + # PUBLIC ensures that include directories required by ${dep} will also be included in compilation of ${target}; + # we generally want this # - target_link_libraries(${target} PUBLIC ${dep}) + # INTERFACE mandatory when depending on a header-only library (created with add_library(foo INTERFACE)). + # otherwise get error: + # INTERFACE library can only be used with the INTERFACE keyword of + # target_link_libraries + # + target_link_libraries(${target} INTERFACE ${dep}) endmacro() # dependency on namespaced target From 0bc65c87271d91a83781599e20283355ff005b37 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 7 Oct 2023 00:31:35 -0400 Subject: [PATCH 28/96] experiment: try attaching dirs with PUBLIC keyword --- cmake/xo_cxx.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 150c665f..740e0833 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -59,7 +59,7 @@ macro(xo_include_headeronly_options2 target) # compiler's include path # target_include_directories( - ${target} INTERFACE + ${target} PUBLIC $ $ $ # e.g. for #include "indentlog/scope.hpp" From 7e80de41aa4f766fd3e2b0f6694f6fb1d9740f80 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 7 Oct 2023 00:34:56 -0400 Subject: [PATCH 29/96] revert failed experiment --- cmake/xo_cxx.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 740e0833..e82d21d1 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -58,8 +58,11 @@ macro(xo_include_headeronly_options2 target) # need that build directory to also appear in # compiler's include path # + # NOTE: using INTERFACE here is mandatory. Otherwise get error: + # target_include_directories may only set INTERFACE properties on INTERFACE targets + # target_include_directories( - ${target} PUBLIC + ${target} INTERFACE $ $ $ # e.g. for #include "indentlog/scope.hpp" From 5ad75dec28c6b6bedbbd9ddb9be953a3688271a4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 7 Oct 2023 00:45:02 -0400 Subject: [PATCH 30/96] bugfix: workaround apparent cmake bug --- cmake/xo_cxx.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index e82d21d1..7be27f62 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -240,14 +240,23 @@ macro(xo_dependency_headeronly target dep) # Conflict here between PUBLIC and INTERFACE # # PUBLIC ensures that include directories required by ${dep} will also be included in compilation of ${target}; - # we generally want this + # i.e. will appear in property ${target}.INCLUDE_DIRECTORIES # # INTERFACE mandatory when depending on a header-only library (created with add_library(foo INTERFACE)). # otherwise get error: # INTERFACE library can only be used with the INTERFACE keyword of # target_link_libraries + # Unfortunately target_link_libraries() does not copy dependent's INTERFACE_INCLUDE_DIRECTORIES property + # (at least asof cmake 3.25.3). Dependent's INCLUDE_DIRECTORIES property will be empty, since it's header-only. + # + # Workaround by copying property explicity, which we do below # target_link_libraries(${target} INTERFACE ${dep}) + + get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + set_property( + TARGET ${target} + APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) endmacro() # dependency on namespaced target From 2ccb974fbfec85b28e4efe423db77b9bd935170f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 7 Oct 2023 16:07:06 -0400 Subject: [PATCH 31/96] xo-cmake: + xo_pybind11_dependency() --- cmake/xo_cxx.cmake | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 7be27f62..09a2fb22 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -341,11 +341,60 @@ macro(xo_pybind11_library target source_files) find_package(pybind11) # this only works if one source file, right? + # + # 6oct2023 + # Having trouble at link time with this. + # Getting broken link for nix, because link line lists short library nicknames + # (e.g. -lfoo) for transitive deps. nix link needs to be given the directory + # in which libfoo.so resides, so we need to ensure full path + # + # - source files: + # -fPIC -fvisibility=hidden -flto -fno-fat-lto-objects + # - library: + # -fPIC -flto + # (transitive closure of library deps for lto?) + # pybind11_add_module(${target} MODULE ${source_files}) xo_pybind11_link_flags() xo_include_options2(${target}) - # use xo_install_library2() instead - #install(TARGETS ${target} DESTINATION lib) xo_install_library2(${target}) endmacro() + +# ---------------------------------------------------------------- +# use this for a dependency of a pybind11 library, +# e.g. that was introduced by xo_pybind11_library() +# +# Working around the following problem (cmake 3.25.3, pybind11 2.10.4).N +# if: +# 1. we have pybind11 library pyfoo, depending on c++ native library foo. +# 2. foo depends on other libraries foodep1, foodep2; +# assume also that foodep2 is header-only +# +# if we write: +# # CMakeLists.txt +# pybind11_add_module(pyfoo MODULE pyfoo.cpp) +# find_package(foo CONFIG_REQUIRED) +# target_link_libraries(pyfoo PUBLIC foo) +# +# get compile instructions like: +# g++ -o pyfoo.cpython-311-x86_64-linux-gnu.so path/to/pyfoo.cpp.o path/to/libfoo.so.x.y -lfoodep1 -lfoodep2 +# +# 1. This is broken for foodep2, since there no libfoodep2.so exists +# 2. Also broken for nix build, because directory containing libfoodep1.so doesn't appear on the compile line. +# (It's likely possible to extract this from the .cmake package in lib/cmake/foo/fooTargets.cmake, +# but I don't know how to do that yet) +# +# workaround here is to suppress these secondary dependencies. +# This assumes: +# 1. secondary dependencies are all in shared libraries (not needed on link line) +# 2. (maybe?) primary dependency libfoo.so is sufficient to satisfy g++ +# -- conceivably true if libfoo.so has RUNPATH etc. +# +macro(xo_pybind11_dependency target dep) + find_package(${dep} CONFIG REQUIRED) + # clobber secondary dependencies, as discussed above + set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + # now that secondary deps are gone, attach to target pybind11 library + xo_dependency(${target} ${dep}) +endmacro() From 46ff8f0b41d45d92a49d3f69abb5dba8cc27c008 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 8 Oct 2023 13:50:08 -0400 Subject: [PATCH 32/96] cmake: + xo_hreaderonly_dependency() to fix confusion --- cmake/xo_cxx.cmake | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 09a2fb22..f0e2e29b 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -229,13 +229,9 @@ macro(xo_dependency target dep) target_link_libraries(${target} PUBLIC ${dep}) endmacro() -macro(xo_internal_dependency target dep) - xo_dependency(${target} ${dep}) -endmacro() - -# dependency on a header-only library +# dependency of a header-only library on another header-only library # -macro(xo_dependency_headeronly target dep) +macro(xo_headeronly_dependency target dep) find_package(${dep} CONFIG REQUIRED) # Conflict here between PUBLIC and INTERFACE # @@ -253,10 +249,10 @@ macro(xo_dependency_headeronly target dep) # target_link_libraries(${target} INTERFACE ${dep}) - get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) - set_property( - TARGET ${target} - APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) +# get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) +# set_property( +# TARGET ${target} +# APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) endmacro() # dependency on namespaced target @@ -396,5 +392,6 @@ macro(xo_pybind11_dependency target dep) # clobber secondary dependencies, as discussed above set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") # now that secondary deps are gone, attach to target pybind11 library - xo_dependency(${target} ${dep}) + # skip xo_dependency() here, that would repeat the find_package() expansion + target_link_libraries(${target} PUBLIC ${dep}) endmacro() From 4c825252ed85c8ebeeb980e540ef3a6bdfb718d8 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 11 Oct 2023 18:03:20 -0400 Subject: [PATCH 33/96] xo-cmake: + xo_add_headeronly_library() --- cmake/xo_cxx.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index f0e2e29b..13ee6b9a 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -108,6 +108,14 @@ macro(xo_add_shared_library target targetversion soversion sources) xo_install_library2(${target}) endmacro() +# ---------------------------------------------------------------- +# use this for a header-only library +# +macro(xo_add_headeronly_library target) + add_library(${target} INTERFACE) + xo_include_headeronly_options2(${target}) +endmacro() + # ---------------------------------------------------------------- # use this in subdirs that compile c++ code. # do not use for header-only subsystems; see xo_include_headeronly_options2() From 1c648d70c3c3a226f193abaa521149899a2a1c6f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 11 Oct 2023 18:03:40 -0400 Subject: [PATCH 34/96] xo-cmake: + xo_install_library3() --- cmake/xo_cxx.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 13ee6b9a..64ec2822 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -184,6 +184,20 @@ macro(xo_install_library2 target) ) endmacro() +macro(xo_install_library3 target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) + + xo_install_include_tree() +endmacro() + # ---------------------------------------------------------------- # for projectname=foo, require: From d99acc979d3c018e0d21e023f4b586c7747a4192 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 16 Oct 2023 23:12:14 -0400 Subject: [PATCH 35/96] xo-cmake: additions to README --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a06e0291..c5c6353d 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,17 @@ Collects cmake macros to be shared across XO projects (e.g. indentlog, reflect, In some XO project `foo`: ``` $ cd build -$ cmake -DCMAKE_MODULE_PATH=/usr/local/share/cmake .. +$ PREFIX=/usr/local # or wherever you prefer +$ cmake -DCMAKE_MODULE_PATH=${PREFIX}/share/cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. +$ make install ``` then in `foo/CMakeLists.txt`: ``` include(xo_macros/xo_cxx) ``` + +when configuring `foo`: +``` +$ cmake -DCMAKE_MODULE_PATH=${PREFIX}/share/cmake path/to/foo +``` From 4c78144b472029bafcddc144641e073387dae9f3 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 16 Oct 2023 23:17:24 -0400 Subject: [PATCH 36/96] xo-cmake: need CMAKE_INSTALL_PREFIX at least for OSX --- cmake/xo_cxx.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 64ec2822..2246fd5d 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -165,7 +165,9 @@ endmacro() # use this to install typical include file subtree # macro(xo_install_include_tree) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include) endmacro() # ---------------------------------------------------------------- @@ -222,13 +224,10 @@ macro(xo_export_cmake_config projectname projectversion projecttargets) ) install( EXPORT ${projecttargets} - DESTINATION lib/cmake/${projectname} - ) - install( FILES "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" - DESTINATION lib/cmake/${projectname} + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${projectname} ) endmacro() From 9a1e33dfd6fea415976caed215c0a5f1993efb94 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 17 Oct 2023 00:17:02 -0400 Subject: [PATCH 37/96] cmake: set readonly permissions on install --- CMakeLists.txt | 1 + cmake/xo_cxx.cmake | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c018ef2d..9c9aa85f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,5 +14,6 @@ install( FILES "cmake/xo_cxx.cmake" "cmake/code-coverage.cmake" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION share/cmake/${XO_PROJECT_NAME} ) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 2246fd5d..c2d64247 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -167,6 +167,7 @@ endmacro() macro(xo_install_include_tree) install( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION ${CMAKE_INSTALL_PREFIX}/include) endmacro() @@ -224,9 +225,13 @@ macro(xo_export_cmake_config projectname projectversion projecttargets) ) install( EXPORT ${projecttargets} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${projectname}) + install( FILES "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${projectname} ) endmacro() From 54413efce4bc26b9c98f6807e77efa8d812129f9 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 17 Oct 2023 14:33:52 -0400 Subject: [PATCH 38/96] + xo_add_shared_library3() --- cmake/xo_cxx.cmake | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 64ec2822..f55a851e 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -85,6 +85,32 @@ endmacro() # ---------------------------------------------------------------- # use this for a shared library. # +macro(xo_add_shared_library3 target projectTargets targetversion soversion sources) + add_library(${target} SHARED ${sources}) + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library3(${target} ${projectTargets}) +endmacro() + +# ---------------------------------------------------------------- +# OBSOLETE. prefer xo_add_shared_library3() +# macro(xo_add_shared_library target targetversion soversion sources) add_library(${target} SHARED ${sources}) foreach(arg IN ITEMS ${ARGN}) @@ -133,11 +159,11 @@ macro(xo_include_options2 target) # target_include_directories( ${target} PUBLIC - $ # e.g. for #include "indentlog/scope.hpp" $ + $ + $ # e.g. for #include "indentlog/scope.hpp" $ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect -# $ $ # e.g. for generated .hpp files ) @@ -346,8 +372,9 @@ endmacro() # 1. a directory pyfoo/ -> library pyfoo # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # -macro(xo_pybind11_library target source_files) - configure_file(${target}.hpp.in ${target}.hpp) +macro(xo_pybind11_library target projectTargets source_files) + configure_file(${target}.hpp.in + ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) # find_package(Python..) finds python in # /Library/Frameworks/Python.framework/... @@ -376,7 +403,7 @@ macro(xo_pybind11_library target source_files) xo_pybind11_link_flags() xo_include_options2(${target}) - xo_install_library2(${target}) + xo_install_library3(${target} ${projectTargets}) endmacro() # ---------------------------------------------------------------- From 70c76bd4a85e4b7bd6dd49c12ce759a68d6ffc13 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 18 Oct 2023 13:29:42 -0400 Subject: [PATCH 39/96] xo-cmake: generate .hpp in build directory (src not writable w/ nix) --- cmake/xo_cxx.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 6a402cca..478cb80b 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -377,8 +377,15 @@ endmacro() # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # macro(xo_pybind11_library target projectTargets source_files) - configure_file(${target}.hpp.in - ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) + configure_file( + ${target}.hpp.in + ${PROJECT_BINARY_DIR}/${target}.hpp) + # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) + + install( + FILES ${PROJECT_BINARY_DIR}/${target}.hpp + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) # find_package(Python..) finds python in # /Library/Frameworks/Python.framework/... From 450b17807ab191611014b04954ed7a90e8d5768e Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 15:25:52 -0400 Subject: [PATCH 40/96] + XO_SYMLINK_INSTALL + symlink-only install variations --- cmake/xo_cxx.cmake | 95 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 4 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 478cb80b..bcb6f7b7 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -187,14 +187,85 @@ macro(xo_compile_options target) target_compile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) endmacro() +# ---------------------------------------------------------------- +# +# establish default value for XO_SYMLINK_INSTALL. +# +# may want to use this for a nested build, +# where we want to run cmake for nested codebase using externalproject_add(). +# +# in this case: +# 1. will need to build+install nested project foo to temporary location in build tree, +# so that build artifacts (such as fooConfig.cmake) are available to depending +# projects +# 2. bona fide install with (for example) copied .hpp files interferes with +# cross-codebase development. +# 2a. want changes to original .hpp files to trigger rebuild of depending codebases. +# This won't happen if depending project relies on a copy +# 2b. want IDE that observes compiler commands (i.e. LSP) to visit .hpp files +# in their original codebase, since that's the correct place to make any edits. +# +# see +# - xo_install_include_tree() +# +macro(xo_establish_symlink_install) + if(NOT DEFINED XO_SYMLINK_INSTALL) + set(XO_SYMLINK_INSTALL False) + endif() +endmacro() + # ---------------------------------------------------------------- # use this to install typical include file subtree # macro(xo_install_include_tree) - install( - DIRECTORY ${PROJECT_SOURCE_DIR}/include/ - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX}/include) + xo_establish_symlink_install() + + if(XO_SYMLINK_INSTALL) + message(FATAL_ERROR "symlink install not implemented for ${PROJECT_SOURCE_DIR}/include -- use xo_install_include_tree3()") + else() + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include) + endif() +endmacro() + +# create symlink from ${symlink_path} -> ${dest_path}, +# from +# make install +# +macro(xo_install_make_symlink dest_path symlink_dir symlink_name) + install(CODE "message(\"make_directory: ${symlink_dir}\")") + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${symlink_dir})") + + install(CODE "message(\"symlink: ${symlink_dir}/${symlink_name} -> ${dest_path}/${symlink_name}\")") + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${dest_path}/${symlink_name} ${symlink_dir}/${symlink_name})") +endmacro() + +# e.g. path = include/xo/foo to install xo-foo/include/xo/foo +# +macro(xo_install_include_tree3 subdir_path) + xo_establish_symlink_install() + + if(XO_SYMLINK_INSTALL) + # ugh. cmake doesn't allow input path argument to cmake_path() + # to be a macro variable. + set(_xo_install_include_tree3_subdir_path ${subdir_path}) + set(_xo_install_include_tree3_dirname "") + set(_xo_install_include_tree3_basename "") + cmake_path(GET _xo_install_include_tree3_subdir_path PARENT_PATH _xo_install_include_tree3_dirname) + cmake_path(GET _xo_install_include_tree3_subdir_path FILENAME _xo_install_include_tree3_basename) + + xo_install_make_symlink( + ${PROJECT_SOURCE_DIR}/${_xo_install_include_tree3_dirname} + ${CMAKE_INSTALL_PREFIX}/${_xo_install_include_tree3_dirname} + ${_xo_install_include_tree3_basename}) + else() + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/${subdir_path} + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/${subdir_path}) + endif() endmacro() # ---------------------------------------------------------------- @@ -227,6 +298,22 @@ macro(xo_install_library3 target projectTargets) xo_install_include_tree() endmacro() +macro(xo_install_library4 target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) + + xo_install_include_tree3(include/xo/${target}) + + #xo_install_include_tree() -- use xo_install_include_tree3() separately +endmacro() + # ---------------------------------------------------------------- # for projectname=foo, require: From 9dfe2477298c0d77f5d13ece5bc82a7f0557dfc7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 15:41:29 -0400 Subject: [PATCH 41/96] xo-cmake: + xo_add_shared_library4() (symlink-hpp-enabled) --- cmake/xo_cxx.cmake | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index bcb6f7b7..51268ea3 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -83,9 +83,38 @@ macro(xo_include_headeronly_options2 target) endmacro() # ---------------------------------------------------------------- -# use this for a shared library. +# use this to introduce a shared library. +# - has symlink-enabled .hpp install +# +macro(xo_add_shared_library4 target projectTargets targetversion soversion sources) + add_library(${target} SHARED ${sources}) + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library4(${target} ${projectTargets}) +endmacro() + +# ---------------------------------------------------------------- +# OBSOLETE. prefer xo_add_shared_library4() # macro(xo_add_shared_library3 target projectTargets targetversion soversion sources) + message(WARNING "obsolete call to xo_add_shared_library3(); prefer xo_add_shared_library4()") + add_library(${target} SHARED ${sources}) foreach(arg IN ITEMS ${ARGN}) #message("target=${target}; arg=${arg}") @@ -112,6 +141,8 @@ endmacro() # OBSOLETE. prefer xo_add_shared_library3() # macro(xo_add_shared_library target targetversion soversion sources) + message(WARNING "obsolete call to xo_add_shared_library(); prefer xo_add_shared_library4()") + add_library(${target} SHARED ${sources}) foreach(arg IN ITEMS ${ARGN}) #message("target=${target}; arg=${arg}") From 49844da0e674d3f25f50d154d3ae7566cc1ea700 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 15:46:05 -0400 Subject: [PATCH 42/96] minor: +warning on deprecated xo_install_include_tree() --- cmake/xo_cxx.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 51268ea3..380ef28b 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -249,6 +249,8 @@ endmacro() # use this to install typical include file subtree # macro(xo_install_include_tree) + message(WARNING "deprecated xo_install_include_tree(); prefer xo_install_include_tree3()") + xo_establish_symlink_install() if(XO_SYMLINK_INSTALL) From f48208072a9d186441989603d03a8a609f69716d Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 16:52:08 -0400 Subject: [PATCH 43/96] xo-cmake: + xo_install_library5() --- cmake/xo_cxx.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 380ef28b..68ed519c 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -347,6 +347,22 @@ macro(xo_install_library4 target projectTargets) #xo_install_include_tree() -- use xo_install_include_tree3() separately endmacro() +macro(xo_install_library5 target nxo_target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) + + xo_install_include_tree3(include/xo/${nxo_target}) + + #xo_install_include_tree() -- use xo_install_include_tree3() separately +endmacro() + # ---------------------------------------------------------------- # for projectname=foo, require: From 20fbb27afc0c8be1fbd119772883018af7fe8687 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 17:29:24 -0400 Subject: [PATCH 44/96] build: symlink-aware install variation for pyxxx libraries --- cmake/xo_cxx.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 68ed519c..2c169b77 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -518,10 +518,19 @@ macro(xo_pybind11_library target projectTargets source_files) ${PROJECT_BINARY_DIR}/${target}.hpp) # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) - install( - FILES ${PROJECT_BINARY_DIR}/${target}.hpp - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) + xo_establish_symlink_install() + + if(XO_SYMLINK_INSTALL) + xo_install_make_symlink( + ${PROJECT_BINARY_DIR} + ${CMAKE_INSTALL_PREFIX}/include/xo/${target} + ${target}.hpp) + else() + install( + FILES ${PROJECT_BINARY_DIR}/${target}.hpp + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) + endif() # find_package(Python..) finds python in # /Library/Frameworks/Python.framework/... From 0119cdfe1c2a884455bc54343128196f56f9c903 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 17:35:05 -0400 Subject: [PATCH 45/96] symlink policy for pybind11 libs --- cmake/xo_cxx.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 2c169b77..0b054171 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -559,7 +559,7 @@ macro(xo_pybind11_library target projectTargets source_files) xo_pybind11_link_flags() xo_include_options2(${target}) - xo_install_library3(${target} ${projectTargets}) + xo_install_library4(${target} ${projectTargets}) endmacro() # ---------------------------------------------------------------- From 71416fcd259b60bd72f0f338859484461c1100e8 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 17:42:09 -0400 Subject: [PATCH 46/96] xo-cmake: provide canoncial include dir for generated pyfoo.hpp --- cmake/xo_cxx.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 0b054171..6932c3e8 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -513,21 +513,23 @@ endmacro() # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # macro(xo_pybind11_library target projectTargets source_files) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${target}) + configure_file( ${target}.hpp.in - ${PROJECT_BINARY_DIR}/${target}.hpp) + ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp) # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) xo_establish_symlink_install() if(XO_SYMLINK_INSTALL) xo_install_make_symlink( - ${PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/include/xo/${target} ${CMAKE_INSTALL_PREFIX}/include/xo/${target} ${target}.hpp) else() install( - FILES ${PROJECT_BINARY_DIR}/${target}.hpp + FILES ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) endif() From 2dbda84ef1ff5004418bac8c379e58cb0d6b4a38 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 20 Oct 2023 12:25:10 -0400 Subject: [PATCH 47/96] fix include symlink handling for pybind11 libraries --- cmake/xo_cxx.cmake | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 6932c3e8..eb9fad7f 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -305,6 +305,8 @@ endmacro() # use this for a subdir that builds a library # and supports find_package() # +# note: used deliberately in xo_pybind11_library() below +# macro(xo_install_library2 target) install( TARGETS ${target} @@ -347,6 +349,18 @@ macro(xo_install_library4 target projectTargets) #xo_install_include_tree() -- use xo_install_include_tree3() separately endmacro() +macro(xo_install_library4_noincludes target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) +endmacro() + macro(xo_install_library5 target nxo_target projectTargets) install( TARGETS ${target} @@ -524,9 +538,9 @@ macro(xo_pybind11_library target projectTargets source_files) if(XO_SYMLINK_INSTALL) xo_install_make_symlink( - ${PROJECT_BINARY_DIR}/include/xo/${target} - ${CMAKE_INSTALL_PREFIX}/include/xo/${target} - ${target}.hpp) + ${PROJECT_BINARY_DIR}/include/xo + ${CMAKE_INSTALL_PREFIX}/include/xo + ${target}) else() install( FILES ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp @@ -561,7 +575,9 @@ macro(xo_pybind11_library target projectTargets source_files) xo_pybind11_link_flags() xo_include_options2(${target}) - xo_install_library4(${target} ${projectTargets}) + # don't want to symlink include tree, because lives in build dir. + # see install for generated .hpp above + xo_install_library4_noincludes(${target} ${projectTargets}) endmacro() # ---------------------------------------------------------------- From a480e40afe636fa94ce4150f555b0c2014bf9faa Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 20 Oct 2023 12:39:29 -0400 Subject: [PATCH 48/96] build: adopt builddir/include/xo/target in include path --- cmake/xo_cxx.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index eb9fad7f..54072862 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -65,10 +65,11 @@ macro(xo_include_headeronly_options2 target) ${target} INTERFACE $ $ - $ # e.g. for #include "indentlog/scope.hpp" - $ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] + $ # e.g. for #include "indentlog/scope.hpp" + #$ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - $ # e.g. for generated .hpp files + #$ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -192,10 +193,11 @@ macro(xo_include_options2 target) ${target} PUBLIC $ $ - $ # e.g. for #include "indentlog/scope.hpp" - $ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] + $ # e.g. for #include "indentlog/scope.hpp" + #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - $ # e.g. for generated .hpp files + #$ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- From 35820ef0dadbe75f70617b7c0ee5108f499a1ea7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 14:29:03 -0400 Subject: [PATCH 49/96] xo-cmake: sub-module build w/out relying on cmake external-project --- CMakeLists.txt | 6 +- cmake/{ => xo_macros}/code-coverage.cmake | 0 cmake/{ => xo_macros}/xo_cxx.cmake | 322 +++++++++++++++++++--- 3 files changed, 293 insertions(+), 35 deletions(-) rename cmake/{ => xo_macros}/code-coverage.cmake (100%) rename cmake/{ => xo_macros}/xo_cxx.cmake (64%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c9aa85f..197416e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,8 @@ set(XO_PROJECT_NAME xo_macros) install( FILES - "cmake/xo_cxx.cmake" - "cmake/code-coverage.cmake" + "cmake/xo_macros/xo_cxx.cmake" + "cmake/xo_macros/code-coverage.cmake" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION share/cmake/${XO_PROJECT_NAME} + DESTINATION share/cmake/xo_macros ) diff --git a/cmake/code-coverage.cmake b/cmake/xo_macros/code-coverage.cmake similarity index 100% rename from cmake/code-coverage.cmake rename to cmake/xo_macros/code-coverage.cmake diff --git a/cmake/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake similarity index 64% rename from cmake/xo_cxx.cmake rename to cmake/xo_macros/xo_cxx.cmake index 54072862..2ab628be 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -1,5 +1,21 @@ macro(xo_toplevel_compile_options) + define_property( + TARGET + PROPERTY xo_deps + BRIEF_DOCS "transitive completion of xo-dependencies for a target. Used with XO_SUBMODULE_BUILD" + ) + define_property( + TARGET + PROPERTY xo_srcdir + BRIEF_DOCS "snapshot of PROJECT_SOURCE_DIR asof when this target introduced" + ) + define_property( + TARGET + PROPERTY xo_bindir + BRIEF_DOCS "snapshot of PROJECT_BINARY_DIR asof when this target introduced" + ) + if(NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 20) endif() @@ -47,7 +63,11 @@ macro(xo_toplevel_compile_options) endif() endmacro() -macro(xo_include_headeronly_options2 target) +# e.g. +# - xo_target = xo_pyutil +# - nxo_target = pyutil +# +macro(xo_include_headeronly_options5 target nxo_target) # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -64,12 +84,12 @@ macro(xo_include_headeronly_options2 target) target_include_directories( ${target} INTERFACE $ - $ + $ $ # e.g. for #include "indentlog/scope.hpp" #$ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] - $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect #$ # e.g. for generated .hpp files - $ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -83,12 +103,26 @@ macro(xo_include_headeronly_options2 target) endif() endmacro() +macro(xo_include_headeronly_options2 target) + xo_include_headeronly_options5(${target} ${target}) +endmacro() + # ---------------------------------------------------------------- # use this to introduce a shared library. # - has symlink-enabled .hpp install # macro(xo_add_shared_library4 target projectTargets targetversion soversion sources) add_library(${target} SHARED ${sources}) + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + foreach(arg IN ITEMS ${ARGN}) #message("target=${target}; arg=${arg}") @@ -114,7 +148,7 @@ endmacro() # OBSOLETE. prefer xo_add_shared_library4() # macro(xo_add_shared_library3 target projectTargets targetversion soversion sources) - message(WARNING "obsolete call to xo_add_shared_library3(); prefer xo_add_shared_library4()") + message(WARNING "${target}: obsolete call to xo_add_shared_library3(); prefer xo_add_shared_library4()") add_library(${target} SHARED ${sources}) foreach(arg IN ITEMS ${ARGN}) @@ -142,7 +176,7 @@ endmacro() # OBSOLETE. prefer xo_add_shared_library3() # macro(xo_add_shared_library target targetversion soversion sources) - message(WARNING "obsolete call to xo_add_shared_library(); prefer xo_add_shared_library4()") + message(WARNING "${target}: obsolete call to xo_add_shared_library(); prefer xo_add_shared_library4()") add_library(${target} SHARED ${sources}) foreach(arg IN ITEMS ${ARGN}) @@ -169,9 +203,41 @@ endmacro() # ---------------------------------------------------------------- # use this for a header-only library # -macro(xo_add_headeronly_library target) +# e.g. +# - target=xo_pyutil cmake target name for this library +# - nxo_target=pyutil directory for this target under include/xo +# +macro(xo_add_headeronly_library5 target nxo_target) add_library(${target} INTERFACE) - xo_include_headeronly_options2(${target}) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + xo_include_headeronly_options5(${target} ${nxo_target}) +endmacro() + +macro(xo_add_headeronly_library target) + xo_add_headeronly_library5(${target} ${target}) +endmacro() + +# ---------------------------------------------------------------- +# +# in submodule build each xo codebases cmake files are incorporated +# directly (via add_subdirectory()) into a single umbrella build. +# +# In such case we don't use find_package for xo dependencies +# +macro(xo_establish_submodule_build) + if(NOT DEFINED XO_SUBMODULE_BUILD) + set(XO_SUBMODULE_BUILD False) + endif() endmacro() # ---------------------------------------------------------------- @@ -179,6 +245,10 @@ endmacro() # do not use for header-only subsystems; see xo_include_headeronly_options2() # macro(xo_include_options2 target) + xo_establish_submodule_build() + + #message("xo_include_options2: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") + # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -414,6 +484,134 @@ macro(xo_export_cmake_config projectname projectversion projecttargets) ) endmacro() +# ---------------------------------------------------------------- +# helper macro for xo_dependency_helper() see below +# +macro(xo_dependency_helper1 target visibility dep_include_subdir) + target_include_directories(${target} ${visibility} + $) + target_include_directories(${target} ${visibility} + $) + + # note: header directories owned by dep get added to target. + # however, header directories _used_ by dep don't get automatically added to target, + # (for example if referred to from a dep-owned .hpp file) + # +endmacro() + +# ---------------------------------------------------------------- +# dependency helper when depending on an xo codebase +# +# Two flavors: +# - depended-on codebase separately built+installed. +# In this case behaves like any other best-practice cmake dep: +# use find_package() to rely on install .cmake config files +# in PREFIX/lib/cmake +# - depended-on codebase in same umbrella source tree as codebase +# invoking this helper. +# 1. XO_UMBRELLA_SOURCE_DIR gives top of umbrella source tree +# 2. depended-on codebase foo in one of +# XO_UMBRELLA_SOURCE_DIR/repo/{foo, xo-foo} +# +# target: cmake target for which to supply a dependency +# visibility: INTERFACE|PUBLIC +# - INTERFACE must be used when supplying a dependency to a header-only target +# dep: cmake target on which to depend (e.g. xo_pyutil) +# nxo_dep: cmake target without any xo_ prefix. (e.g. pyutil) +# +macro(xo_dependency_helper target visibility dep) + string(REGEX REPLACE "^xo_" "" _nxo_dep ${dep}) + string(REGEX REPLACE "^xo-" "" _nxo_dep ${_nxo_dep}) + + xo_establish_submodule_build() + + if(XO_SUBMODULE_BUILD) + if(EXISTS ${XO_UMBRELLA_SOURCE_DIR}/repo/xo-${_nxo_dep}) + xo_dependency_helper1(${target} ${visibility} repo/xo-${_nxo_dep}/include) + endif() + + if(EXISTS ${XO_UMBRELLA_SOURCE_DIR}/repo/${_nxo_dep}) + xo_dependency_helper1(${target} ${visibility} repo/${_nxo_dep}/include) + endif() + else() + find_package(${dep} CONFIG REQUIRED) + endif() + + if (XO_SUBMODULE_BUILD) + get_target_property(_tmp ${target} LINK_LIBRARIES) + message("xo_dependency_helper: ${target} -> ${dep}: ${target}.LINK_LIBRARIES=${_tmp}") + get_target_property(_tmp ${dep} LINK_LIBRARIES) + message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.LINK_LIBRARIES=${_tmp}") + + get_target_property(_tmp ${target} INTERFACE_LINK_LIBRARIES) + message("xo_dependency_helper: ${target} -> ${dep}: ${target}.INTERFACE_LINK_LIBRARIES=${_tmp}") + get_target_property(_tmp ${dep} INTERFACE_LINK_LIBRARIES) + message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.INTERFACE_LINK_LIBRARIES=${_tmp}") + + # add INCLUDE_DIRECTORIES from ${dep} to ${target}. + # + # 1. we only need this for a submodule build + # 1a. cmake automatically adds ${dep}'s directly-set include directories + # (i.e. attached via target_include_directories(${dep} ..) etc. + # 1b. furthermore, cmake adds transitive deps when we use generated + # cmake support + # 1c. cmake doesn't seem automatically to arrange transitive include directories + # when we have a chain of target_link_libraries() calls. + # (NOTE: it does incorporate include paths from direct dependencies) + # 2. because of 1a, need to exclude ${dep}'s own dirs here (to avoid too-long include path) + # + get_target_property(_depsrcdir ${dep} xo_srcdir) + get_target_property(_depbindir ${dep} xo_bindir) + get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + if(_tmp) + message("xo_dependency_helper: ${target}: + ${dep}.INCLUDE_DIRECTORIES: ${_tmp}") + foreach(dir ${_tmp}) + # want to add these to compile line for $target}. + # this will happen automatically for ${dep}'s own directories; + # those will have been added by + # xo_include_options2() / xo_include_headeronly_options2() + # however we also need directories for ${dep}'s transitive dependencies + # + if(${dir} MATCHES "BUILD_INTERFACE") + message("xo_dependency_helper: ${target} -> ${dep}: consider dir=${dir}") + if(${dir} MATCHES ${_depsrcdir}) + #message(" skip ${dir}") + elseif(${dir} MATCHES ${_depbindir}) + #message(" skip ${dir}") + else() + message(" KEEP ${dir}") + target_include_directories(${target} ${visibility} ${dir}) + endif() + endif() + +# set_property( +# TARGET ${target} +# APPEND +# PROPERTY INCLUDE_DIRECTORIES ${dir}) + endforeach() + get_target_property(_tmp ${target} INTERFACE_INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES _tmp) + set_property( + TARGET ${target} + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_tmp}) + #message("xo_dependency_helper: ${target}.INCLUDE_DIRECTORIES: ${_tmp}") + endif() + endif() + + # want ${target}.xo_deps to contain union of previous value, and ${dep}.xo_deps + set_property( + TARGET ${target} + APPEND + PROPERTY xo_deps ${dep}) + get_target_property(_tmp ${target} xo_deps) + list(REMOVE_DUPLICATES _tmp) + set_property( + TARGET ${target} + PROPERTY xo_deps ${_tmp}) + + #list(REMOVE_DUPLICATES _xo_dependency_tmp1) +endmacro() + # ---------------------------------------------------------------- # # dependency on an xo library (including header-only libraries) @@ -429,37 +627,64 @@ endmacro() # dep: name of required dependency, e.g. indentlog # macro(xo_dependency target dep) - find_package(${dep} CONFIG REQUIRED) + xo_establish_submodule_build() + + #message("xo_dependency: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") + #message("xo_dependency: XO_UMBRELLA_SOURCE_DIR=${XO_UMBRELLA_SOURCE_DIR}") + #message("xo_dependency: PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}") + + xo_dependency_helper(${target} PUBLIC ${dep}) + + message("----------------------------------------------------------------") + #message("xo_dependency: ${target}.xo_deps.pre=${_xo_dependency_tmp0}") + #message("xo_dependency: ${dep}.xo_deps=${_xo_dependency_tmp2}") + get_target_property(_tmp ${target} xo_deps) + message("xo_dependency: ${target}.xo_deps=${_tmp}") + #get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) + #message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} before target_link_libraries with ${dep}") + target_link_libraries(${target} PUBLIC ${dep}) + #target_link_libraries(${target} ${dep}) + + #get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) + #message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} after target_link_libraries with ${dep}") + #get_target_property(_tmp ${dep} INCLUDE_DIRECTORIES) + #message("xo_dependency: ${dep}.INCLUDE_DIRECTORIES=${_tmp}") + #get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + #message("xo_dependency: ${dep}.INTERFACE_INCLUDE_DIRECTORIES=${_tmp}") + message("----------------------------------------------------------------") endmacro() # dependency of a header-only library on another header-only library # macro(xo_headeronly_dependency target dep) - find_package(${dep} CONFIG REQUIRED) - # Conflict here between PUBLIC and INTERFACE - # - # PUBLIC ensures that include directories required by ${dep} will also be included in compilation of ${target}; - # i.e. will appear in property ${target}.INCLUDE_DIRECTORIES - # - # INTERFACE mandatory when depending on a header-only library (created with add_library(foo INTERFACE)). - # otherwise get error: - # INTERFACE library can only be used with the INTERFACE keyword of - # target_link_libraries - # Unfortunately target_link_libraries() does not copy dependent's INTERFACE_INCLUDE_DIRECTORIES property - # (at least asof cmake 3.25.3). Dependent's INCLUDE_DIRECTORIES property will be empty, since it's header-only. - # - # Workaround by copying property explicity, which we do below - # - target_link_libraries(${target} INTERFACE ${dep}) + xo_establish_submodule_build() -# get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) -# set_property( -# TARGET ${target} -# APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) + xo_dependency_helper(${target} INTERFACE ${dep}) + + # Conflict here between PUBLIC and INTERFACE + # + # PUBLIC ensures that include directories required by ${dep} will also be included in compilation of ${target}; + # i.e. will appear in property ${target}.INCLUDE_DIRECTORIES + # + # INTERFACE mandatory when depending on a header-only library (created with add_library(foo INTERFACE)). + # otherwise get error: + # INTERFACE library can only be used with the INTERFACE keyword of + # target_link_libraries + # Unfortunately target_link_libraries() does not copy dependent's INTERFACE_INCLUDE_DIRECTORIES property + # (at least asof cmake 3.25.3). Dependent's INCLUDE_DIRECTORIES property will be empty, since it's header-only. + # + # Workaround by copying property explicity, which we do below + # + target_link_libraries(${target} INTERFACE ${dep}) + + # get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + # set_property( + # TARGET ${target} + # APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) endmacro() -# dependency on namespaced target +# dependency on external (non-xo) namespaced target # e.g. # add_library(foo ..) or add_executable(foo ...) # then @@ -471,6 +696,13 @@ endmacro() macro(xo_external_target_dependency target pkg pkgtarget) find_package(${pkg} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${pkgtarget}) + #target_link_libraries(${target} ${pkgtarget}) +endmacro() + +# dependency on external (non-xo) target +# +macro(xo_external_dependency target pkg) + xo_external_target_dependency(${target} ${pkg} ${target}) endmacro() # dependency on target provided from this codebase. @@ -575,6 +807,16 @@ macro(xo_pybind11_library target projectTargets source_files) # pybind11_add_module(${target} MODULE ${source_files}) + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + xo_pybind11_link_flags() xo_include_options2(${target}) # don't want to symlink include tree, because lives in build dir. @@ -613,10 +855,26 @@ endmacro() # -- conceivably true if libfoo.so has RUNPATH etc. # macro(xo_pybind11_dependency target dep) - find_package(${dep} CONFIG REQUIRED) + xo_establish_submodule_build() + + xo_dependency_helper(${target} PUBLIC ${dep}) # clobber secondary dependencies, as discussed above - set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + if(XO_SUBMODULE_BUILD) + # ok to keep dep libraries on link line in submodule build + message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") + else() + message("xo_pybind11_dependency: ${target}: clobbering ${dep}.INTERFACE_LINK_LIBRARIES") + set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + endif() # now that secondary deps are gone, attach to target pybind11 library # skip xo_dependency() here, that would repeat the find_package() expansion target_link_libraries(${target} PUBLIC ${dep}) endmacro() + +# use when one xo pybind library imports another. +# for example +# pyprintjson -> pyreflect +# +macro(xo_pybind11_header_dependency target dep) + xo_dependency_helper(${target} PUBLIC ${dep}) +endmacro() From 8ad546083132b44f362bc97011d873ab31610a5c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 15:50:42 -0400 Subject: [PATCH 50/96] build: patch xo- or xo_ prefixes --- cmake/xo_macros/xo_cxx.cmake | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 2ab628be..94a9cb27 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -247,6 +247,9 @@ endmacro() macro(xo_include_options2 target) xo_establish_submodule_build() + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + #message("xo_include_options2: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") # ---------------------------------------------------------------- @@ -262,12 +265,12 @@ macro(xo_include_options2 target) target_include_directories( ${target} PUBLIC $ - $ - $ # e.g. for #include "indentlog/scope.hpp" - #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] - $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - #$ # e.g. for generated .hpp files - $ # e.g. for generated .hpp files + $ + $ # e.g. for #include "indentlog/scope.hpp" + #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + #$ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -761,11 +764,14 @@ endmacro() # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # macro(xo_pybind11_library target projectTargets source_files) - file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${target}) + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}) configure_file( - ${target}.hpp.in - ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp) + ${_nxo_target}.hpp.in + ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}/${_nxo_target}.hpp) # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) xo_establish_symlink_install() @@ -774,12 +780,12 @@ macro(xo_pybind11_library target projectTargets source_files) xo_install_make_symlink( ${PROJECT_BINARY_DIR}/include/xo ${CMAKE_INSTALL_PREFIX}/include/xo - ${target}) + ${_nxo_target}) else() install( - FILES ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp + FILES ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}/${_nxo_target}.hpp PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${_nxo_target}) endif() # find_package(Python..) finds python in From 16306684d3c9c2b9433f23863f5bc851df4ce83d Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:05:05 -0400 Subject: [PATCH 51/96] cosmetic: comments --- cmake/xo_macros/xo_cxx.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 94a9cb27..27e3d02c 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -834,7 +834,7 @@ endmacro() # use this for a dependency of a pybind11 library, # e.g. that was introduced by xo_pybind11_library() # -# Working around the following problem (cmake 3.25.3, pybind11 2.10.4).N +# Working around the following problem (cmake 3.25.3, pybind11 2.10.4) # if: # 1. we have pybind11 library pyfoo, depending on c++ native library foo. # 2. foo depends on other libraries foodep1, foodep2; @@ -849,7 +849,7 @@ endmacro() # get compile instructions like: # g++ -o pyfoo.cpython-311-x86_64-linux-gnu.so path/to/pyfoo.cpp.o path/to/libfoo.so.x.y -lfoodep1 -lfoodep2 # -# 1. This is broken for foodep2, since there no libfoodep2.so exists +# 1. This is broken for foodep2, since in this case no libfoodep2.so exists # 2. Also broken for nix build, because directory containing libfoodep1.so doesn't appear on the compile line. # (It's likely possible to extract this from the .cmake package in lib/cmake/foo/fooTargets.cmake, # but I don't know how to do that yet) @@ -871,6 +871,8 @@ macro(xo_pybind11_dependency target dep) else() message("xo_pybind11_dependency: ${target}: clobbering ${dep}.INTERFACE_LINK_LIBRARIES") set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + + # also have to clobber libraries for endif() # now that secondary deps are gone, attach to target pybind11 library # skip xo_dependency() here, that would repeat the find_package() expansion From 4ccb726cca80ebaee41056a87fb24191aa47e66f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:26:00 -0400 Subject: [PATCH 52/96] xo-cmake: simplify api -- drop nxo_ args --- cmake/xo_macros/xo_cxx.cmake | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 27e3d02c..80429258 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -65,9 +65,11 @@ endmacro() # e.g. # - xo_target = xo_pyutil -# - nxo_target = pyutil # -macro(xo_include_headeronly_options5 target nxo_target) +macro(xo_include_headeronly_options target) + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -84,12 +86,10 @@ macro(xo_include_headeronly_options5 target nxo_target) target_include_directories( ${target} INTERFACE $ - $ - $ # e.g. for #include "indentlog/scope.hpp" - #$ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] - $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - #$ # e.g. for generated .hpp files - $ # e.g. for generated .hpp files + $ + $ # e.g. for #include "indentlog/scope.hpp" + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -104,7 +104,7 @@ macro(xo_include_headeronly_options5 target nxo_target) endmacro() macro(xo_include_headeronly_options2 target) - xo_include_headeronly_options5(${target} ${target}) + xo_include_headeronly_options(${target}) endmacro() # ---------------------------------------------------------------- @@ -205,9 +205,8 @@ endmacro() # # e.g. # - target=xo_pyutil cmake target name for this library -# - nxo_target=pyutil directory for this target under include/xo # -macro(xo_add_headeronly_library5 target nxo_target) +macro(xo_add_headeronly_library target) add_library(${target} INTERFACE) set_property( @@ -220,11 +219,7 @@ macro(xo_add_headeronly_library5 target nxo_target) TARGET ${target} PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) - xo_include_headeronly_options5(${target} ${nxo_target}) -endmacro() - -macro(xo_add_headeronly_library target) - xo_add_headeronly_library5(${target} ${target}) + xo_include_headeronly_options(${target}) endmacro() # ---------------------------------------------------------------- From b2d7a04a09f9224618d96c3faf2da638a11ddeee Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:36:21 -0400 Subject: [PATCH 53/96] build: extend xo_install_library4 + retire xo_install_library5P --- cmake/xo_macros/xo_cxx.cmake | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 80429258..a90820f7 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -404,6 +404,9 @@ macro(xo_install_library3 target projectTargets) endmacro() macro(xo_install_library4 target projectTargets) + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + install( TARGETS ${target} EXPORT ${projectTargets} @@ -414,7 +417,7 @@ macro(xo_install_library4 target projectTargets) BUNDLE DESTINATION bin COMPONENT Runtime ) - xo_install_include_tree3(include/xo/${target}) + xo_install_include_tree3(include/xo/${_nxo_target}) #xo_install_include_tree() -- use xo_install_include_tree3() separately endmacro() @@ -431,22 +434,6 @@ macro(xo_install_library4_noincludes target projectTargets) ) endmacro() -macro(xo_install_library5 target nxo_target projectTargets) - install( - TARGETS ${target} - EXPORT ${projectTargets} - LIBRARY DESTINATION lib COMPONENT Runtime - ARCHIVE DESTINATION lib COMPONENT Development - RUNTIME DESTINATION bin COMPONENT Runtime - PUBLIC_HEADER DESTINATION include COMPONENT Development - BUNDLE DESTINATION bin COMPONENT Runtime - ) - - xo_install_include_tree3(include/xo/${nxo_target}) - - #xo_install_include_tree() -- use xo_install_include_tree3() separately -endmacro() - # ---------------------------------------------------------------- # for projectname=foo, require: From 6360cd7297d726534a9b1402343804360ccb85a4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:45:52 -0400 Subject: [PATCH 54/96] build: + xo_strip_xo_prefix() + use to consolidate --- cmake/xo_macros/xo_cxx.cmake | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index a90820f7..cba39ed2 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -63,12 +63,20 @@ macro(xo_toplevel_compile_options) endif() endmacro() +# xo_strip_xo_prefix(xo_foo tmp) --> tmp=foo +# xo_strip_xo_prefix(xo-foo tmp) --> tmp=foo +# xo_strip_xo_prefix(foo tmp) --> tmp=foo +# +macro(xo_strip_xo_prefix str outputvar) + string(REGEX REPLACE "^xo_" "" _tmp ${str}) + string(REGEX REPLACE "^xo-" "" ${outputvar} ${_tmp}) +endmacro() + # e.g. # - xo_target = xo_pyutil # macro(xo_include_headeronly_options target) - string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) - string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + xo_strip_xo_prefix(${target} _nxo_target) # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: @@ -242,8 +250,7 @@ endmacro() macro(xo_include_options2 target) xo_establish_submodule_build() - string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) - string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + xo_strip_xo_prefix(${target} _nxo_target) #message("xo_include_options2: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") @@ -404,8 +411,7 @@ macro(xo_install_library3 target projectTargets) endmacro() macro(xo_install_library4 target projectTargets) - string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) - string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + xo_strip_xo_prefix(${target} _nxo_target) install( TARGETS ${target} @@ -505,8 +511,7 @@ endmacro() # nxo_dep: cmake target without any xo_ prefix. (e.g. pyutil) # macro(xo_dependency_helper target visibility dep) - string(REGEX REPLACE "^xo_" "" _nxo_dep ${dep}) - string(REGEX REPLACE "^xo-" "" _nxo_dep ${_nxo_dep}) + xo_strip_xo_prefix(${dep} _nxo_dep) xo_establish_submodule_build() @@ -746,8 +751,7 @@ endmacro() # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # macro(xo_pybind11_library target projectTargets source_files) - string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) - string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + xo_strip_xo_prefix(${target} _nxo_target) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}) From cd969000466a7b6a91c7fab806f0db70635032ee Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:52:50 -0400 Subject: [PATCH 55/96] build: drop debug log messages --- cmake/xo_macros/xo_cxx.cmake | 45 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index cba39ed2..2f9560db 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -528,15 +528,15 @@ macro(xo_dependency_helper target visibility dep) endif() if (XO_SUBMODULE_BUILD) - get_target_property(_tmp ${target} LINK_LIBRARIES) - message("xo_dependency_helper: ${target} -> ${dep}: ${target}.LINK_LIBRARIES=${_tmp}") - get_target_property(_tmp ${dep} LINK_LIBRARIES) - message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${target} LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${target}.LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${dep} LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.LINK_LIBRARIES=${_tmp}") - get_target_property(_tmp ${target} INTERFACE_LINK_LIBRARIES) - message("xo_dependency_helper: ${target} -> ${dep}: ${target}.INTERFACE_LINK_LIBRARIES=${_tmp}") - get_target_property(_tmp ${dep} INTERFACE_LINK_LIBRARIES) - message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.INTERFACE_LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${target} INTERFACE_LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${target}.INTERFACE_LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${dep} INTERFACE_LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.INTERFACE_LINK_LIBRARIES=${_tmp}") # add INCLUDE_DIRECTORIES from ${dep} to ${target}. # @@ -554,7 +554,7 @@ macro(xo_dependency_helper target visibility dep) get_target_property(_depbindir ${dep} xo_bindir) get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) if(_tmp) - message("xo_dependency_helper: ${target}: + ${dep}.INCLUDE_DIRECTORIES: ${_tmp}") + #message("xo_dependency_helper: ${target}: + ${dep}.INCLUDE_DIRECTORIES: ${_tmp}") foreach(dir ${_tmp}) # want to add these to compile line for $target}. # this will happen automatically for ${dep}'s own directories; @@ -563,21 +563,16 @@ macro(xo_dependency_helper target visibility dep) # however we also need directories for ${dep}'s transitive dependencies # if(${dir} MATCHES "BUILD_INTERFACE") - message("xo_dependency_helper: ${target} -> ${dep}: consider dir=${dir}") + #message("xo_dependency_helper: ${target} -> ${dep}: consider dir=${dir}") if(${dir} MATCHES ${_depsrcdir}) #message(" skip ${dir}") elseif(${dir} MATCHES ${_depbindir}) #message(" skip ${dir}") else() - message(" KEEP ${dir}") + #message(" KEEP ${dir}") target_include_directories(${target} ${visibility} ${dir}) endif() endif() - -# set_property( -# TARGET ${target} -# APPEND -# PROPERTY INCLUDE_DIRECTORIES ${dir}) endforeach() get_target_property(_tmp ${target} INTERFACE_INCLUDE_DIRECTORIES) list(REMOVE_DUPLICATES _tmp) @@ -625,13 +620,13 @@ macro(xo_dependency target dep) xo_dependency_helper(${target} PUBLIC ${dep}) - message("----------------------------------------------------------------") - #message("xo_dependency: ${target}.xo_deps.pre=${_xo_dependency_tmp0}") - #message("xo_dependency: ${dep}.xo_deps=${_xo_dependency_tmp2}") - get_target_property(_tmp ${target} xo_deps) - message("xo_dependency: ${target}.xo_deps=${_tmp}") - #get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) - #message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} before target_link_libraries with ${dep}") + #message("----------------------------------------------------------------") + ##message("xo_dependency: ${target}.xo_deps.pre=${_xo_dependency_tmp0}") + ##message("xo_dependency: ${dep}.xo_deps=${_xo_dependency_tmp2}") + #get_target_property(_tmp ${target} xo_deps) + #message("xo_dependency: ${target}.xo_deps=${_tmp}") + ##get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) + ##message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} before target_link_libraries with ${dep}") target_link_libraries(${target} PUBLIC ${dep}) #target_link_libraries(${target} ${dep}) @@ -642,7 +637,7 @@ macro(xo_dependency target dep) #message("xo_dependency: ${dep}.INCLUDE_DIRECTORIES=${_tmp}") #get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) #message("xo_dependency: ${dep}.INTERFACE_INCLUDE_DIRECTORIES=${_tmp}") - message("----------------------------------------------------------------") + #message("----------------------------------------------------------------") endmacro() # dependency of a header-only library on another header-only library @@ -853,7 +848,7 @@ macro(xo_pybind11_dependency target dep) # clobber secondary dependencies, as discussed above if(XO_SUBMODULE_BUILD) # ok to keep dep libraries on link line in submodule build - message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") + #message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") else() message("xo_pybind11_dependency: ${target}: clobbering ${dep}.INTERFACE_LINK_LIBRARIES") set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") From 5ae6f41e63bae9abd468bcc787e314ca0542f3f3 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 23 Oct 2023 13:34:53 -0400 Subject: [PATCH 56/96] + xo_cxx_toplevel_options() to consolidate boilerplate --- cmake/xo_macros/xo-project-macros.cmake | 2 ++ cmake/xo_macros/xo_cxx.cmake | 30 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 cmake/xo_macros/xo-project-macros.cmake diff --git a/cmake/xo_macros/xo-project-macros.cmake b/cmake/xo_macros/xo-project-macros.cmake new file mode 100644 index 00000000..a18c9b8d --- /dev/null +++ b/cmake/xo_macros/xo-project-macros.cmake @@ -0,0 +1,2 @@ +include(xo_macros/xo_cxx) +include(xo_macros/code-coverage) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 2f9560db..1e308aa0 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -1,4 +1,16 @@ +macro(xo_cxx_toplevel_options) + enable_language(CXX) + xo_toplevel_compile_options() + xo_toplevel_testing_options() +endmacro() + +macro(xo_toplevel_testing_options) + enable_testing() + add_code_coverage() + add_code_coverage_all_targets(EXCLUDE /nix/store* utest/*) +endmacro() + macro(xo_toplevel_compile_options) define_property( TARGET @@ -214,6 +226,24 @@ endmacro() # e.g. # - target=xo_pyutil cmake target name for this library # +macro(xo_add_headeronly_library4 target projectTargets) + add_library(${target} INTERFACE) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + xo_include_headeronly_options(${target}) + + xo_install_library4(${target} ${projectTargets}) +endmacro() + macro(xo_add_headeronly_library target) add_library(${target} INTERFACE) From 64842065a39588695f4aba6eed712b3a4c55c3b4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 23 Oct 2023 13:36:51 -0400 Subject: [PATCH 57/96] bugfix: + install for xo-project-macros.cmake --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 197416e8..e7e30b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(XO_PROJECT_NAME xo_macros) install( FILES + "cmake/xo_macros/xo-project-macros.cmake" "cmake/xo_macros/xo_cxx.cmake" "cmake/xo_macros/code-coverage.cmake" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ From 7d599854fbc9f6052f5b353af1be5d56b7c8dc4c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 23 Oct 2023 15:55:55 -0400 Subject: [PATCH 58/96] bugfix: bad include install in vanilla build --- cmake/xo_macros/xo_cxx.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 1e308aa0..06a28990 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -349,6 +349,8 @@ endmacro() macro(xo_establish_symlink_install) if(NOT DEFINED XO_SYMLINK_INSTALL) set(XO_SYMLINK_INSTALL False) + + message(XO_SYMLINK_INSTALL=${XO_SYMLINK_INSTALL}) endif() endmacro() @@ -387,14 +389,15 @@ endmacro() macro(xo_install_include_tree3 subdir_path) xo_establish_symlink_install() + # ugh. cmake doesn't allow input path argument to cmake_path() + # to be a macro variable. + set(_xo_install_include_tree3_subdir_path ${subdir_path}) + set(_xo_install_include_tree3_dirname "") + set(_xo_install_include_tree3_basename "") + cmake_path(GET _xo_install_include_tree3_subdir_path PARENT_PATH _xo_install_include_tree3_dirname) + cmake_path(GET _xo_install_include_tree3_subdir_path FILENAME _xo_install_include_tree3_basename) + if(XO_SYMLINK_INSTALL) - # ugh. cmake doesn't allow input path argument to cmake_path() - # to be a macro variable. - set(_xo_install_include_tree3_subdir_path ${subdir_path}) - set(_xo_install_include_tree3_dirname "") - set(_xo_install_include_tree3_basename "") - cmake_path(GET _xo_install_include_tree3_subdir_path PARENT_PATH _xo_install_include_tree3_dirname) - cmake_path(GET _xo_install_include_tree3_subdir_path FILENAME _xo_install_include_tree3_basename) xo_install_make_symlink( ${PROJECT_SOURCE_DIR}/${_xo_install_include_tree3_dirname} @@ -404,7 +407,7 @@ macro(xo_install_include_tree3 subdir_path) install( DIRECTORY ${PROJECT_SOURCE_DIR}/${subdir_path} FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX}/${subdir_path}) + DESTINATION ${CMAKE_INSTALL_PREFIX}/${_xo_install_include_tree3_dirname}) endif() endmacro() @@ -554,6 +557,7 @@ macro(xo_dependency_helper target visibility dep) xo_dependency_helper1(${target} ${visibility} repo/${_nxo_dep}/include) endif() else() + message("xo_dependency_helper: find_package() on ${dep} for ${target}") find_package(${dep} CONFIG REQUIRED) endif() From 38c95a554238825e314a46ffdbedf985592f5aab Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 24 Oct 2023 12:26:21 -0400 Subject: [PATCH 59/96] build: drop XO_SYMLINK_INSTALL console message --- cmake/xo_macros/xo_cxx.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 06a28990..08d0b942 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -350,7 +350,7 @@ macro(xo_establish_symlink_install) if(NOT DEFINED XO_SYMLINK_INSTALL) set(XO_SYMLINK_INSTALL False) - message(XO_SYMLINK_INSTALL=${XO_SYMLINK_INSTALL}) + #message(XO_SYMLINK_INSTALL=${XO_SYMLINK_INSTALL}) endif() endmacro() From e4169def1ca0b6ab541b2b126e7758bfc3392674 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 24 Oct 2023 22:18:06 -0400 Subject: [PATCH 60/96] tweak message on INTERFACE_LINK_LIBRARIES --- cmake/xo_macros/xo_cxx.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 06a28990..eb389ad7 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -884,7 +884,7 @@ macro(xo_pybind11_dependency target dep) # ok to keep dep libraries on link line in submodule build #message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") else() - message("xo_pybind11_dependency: ${target}: clobbering ${dep}.INTERFACE_LINK_LIBRARIES") + message("xo_pybind11_dependency: ${target}: remove ${dep}.INTERFACE_LINK_LIBRARIES to avoid problems with transitive deps") set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") # also have to clobber libraries for From 93910f901300825e6348bed1806e6b534b7d15b2 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 13 Mar 2024 16:34:07 -0400 Subject: [PATCH 61/96] pybind11 python-fetching deprecated, drop it --- cmake/xo_macros/xo_cxx.cmake | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 1f392ad7..f0b62c86 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -803,13 +803,7 @@ macro(xo_pybind11_library target projectTargets source_files) DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${_nxo_target}) endif() - # find_package(Python..) finds python in - # /Library/Frameworks/Python.framework/... - # but we want to use python from nix - # - #find_package(Python COMPONENTS Interpreter Development REQUIRED) - # - + find_package(Python COMPONENTS Interpreter Development REQUIRED) find_package(pybind11) # this only works if one source file, right? From ca721658e9d4f2b892c86b47cf48cafd8bc3bd92 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 15 Mar 2024 19:20:18 -0400 Subject: [PATCH 62/96] stremaline xo-cmake info messages --- .gitignore | 2 +- cmake/xo_macros/xo_cxx.cmake | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 378eac25..24e5b0a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -build +.build diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index f0b62c86..e63762f8 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -557,7 +557,7 @@ macro(xo_dependency_helper target visibility dep) xo_dependency_helper1(${target} ${visibility} repo/${_nxo_dep}/include) endif() else() - message("xo_dependency_helper: find_package() on ${dep} for ${target}") + message("-- [${target}] find_package(${dep}) (xo_dependency_helper)") find_package(${dep} CONFIG REQUIRED) endif() @@ -713,6 +713,7 @@ endmacro() # target_link_libraries(foo PUBLIC Catch2::Catch2) # macro(xo_external_target_dependency target pkg pkgtarget) + message("-- [${target}] find_package(${pkg}) (xo_external_target_dependency)") find_package(${pkg} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${pkgtarget}) #target_link_libraries(${target} ${pkgtarget}) @@ -803,7 +804,9 @@ macro(xo_pybind11_library target projectTargets source_files) DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${_nxo_target}) endif() + message("-- [${target}] find_package(Python) (xo_pybind11_library)") find_package(Python COMPONENTS Interpreter Development REQUIRED) + message("-- [${target}] find_package(pybind11) (xo_pybind11_library)") find_package(pybind11) # this only works if one source file, right? @@ -878,7 +881,7 @@ macro(xo_pybind11_dependency target dep) # ok to keep dep libraries on link line in submodule build #message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") else() - message("xo_pybind11_dependency: ${target}: remove ${dep}.INTERFACE_LINK_LIBRARIES to avoid problems with transitive deps") + message("-- [${target}] remove ${dep}.INTERFACE_LINK_LIBRARIES to avoid problems with transitive deps (xo_pybind11_dependency)") set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") # also have to clobber libraries for From b8f2360b899739b72272036324a6997aa9169c8f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 1 Apr 2024 19:47:48 -0400 Subject: [PATCH 63/96] .gitignore: + compile_commands.json --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 24e5b0a1..7b6765fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .build +compile_commands.json From c8ac0ceb493c03af3edbcb008503b001bcba50be Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 16 Apr 2024 13:30:16 -0400 Subject: [PATCH 64/96] cmake: + xo_self_headeronly_dependency() --- cmake/xo_macros/xo_cxx.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index e63762f8..3fcf3e2f 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -736,6 +736,19 @@ macro(xo_self_dependency target dep) target_link_libraries(${target} PUBLIC ${dep}) endmacro() +# dependency on target provided from this codebase. +# +# Similar comments as for xo_self_dependency() +# 1. don't need find_package() in this case, since details of dep targets +# must be known to cmake for it to build them. +# 2. in any case, can't use find_package() when cmake runs, +# because supporting .cmake files haven't been generated yet +# 3. need to use INTERFACE instead of PUBLIC for a header-only dep +# +macro(xo_self_headeronly_dependency target dep) + target_link_libraries(${target} INTERFACE ${dep}) +endmacro() + # ---------------------------------------------------------------- # need this when linking pybind11-generated libraries # From 6a702ed88add250c669b1cd10750126c5bc76a20 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 13:12:46 -0400 Subject: [PATCH 65/96] xo-cmake: xo-cmake-config helper script + streamline coverage gen --- CMakeLists.txt | 39 +++++++++-- bin/xo-cmake-config.in | 74 +++++++++++++++++++++ bin/xo-cmake-lcov-harness.in | 121 +++++++++++++++++++++++++++++++++++ cmake/xo_macros/xo_cxx.cmake | 60 ++++++++++++++++- share/xo-macros/gen-ccov.in | 30 +++++++++ 5 files changed, 319 insertions(+), 5 deletions(-) create mode 100755 bin/xo-cmake-config.in create mode 100755 bin/xo-cmake-lcov-harness.in create mode 100644 share/xo-macros/gen-ccov.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e7e30b56..516c8c84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,13 +3,26 @@ cmake_minimum_required(VERSION 3.10) project(xo_macros VERSION 1.0) # if any are useful for this project.. -#include (cmake/foo.cmake) - -# ---------------------------------------------------------------- -# cmake export +include (GNUInstallDirs) set(XO_PROJECT_NAME xo_macros) +# LCOV_EXECUTABLE,GENHTML_EXECUTABLE: needed by xo-cmake-lcov-harness.in +find_program(LCOV_EXECUTABLE NAMES lcov) +find_program(GENHTML_EXECUTABLE NAMES genhtml) + +configure_file( + ${PROJECT_SOURCE_DIR}/bin/xo-cmake-lcov-harness.in + ${PROJECT_BINARY_DIR}/xo-cmake-lcov-harness + @ONLY + ) + +configure_file( + ${PROJECT_SOURCE_DIR}/bin/xo-cmake-config.in + ${PROJECT_BINARY_DIR}/xo-cmake-config + @ONLY + ) + install( FILES "cmake/xo_macros/xo-project-macros.cmake" @@ -18,3 +31,21 @@ install( PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION share/cmake/xo_macros ) + +install( + FILES + "${PROJECT_BINARY_DIR}/xo-cmake-lcov-harness" + "${PROJECT_BINARY_DIR}/xo-cmake-config" + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +# The cmake template gen-ccov.in should be expanded in downstream project; +# to pickup downstream project's PROJECT_SOURCE_DIR / PROJECT_BINARY_DIR +# +install( + FILES + "share/xo-macros/gen-ccov.in" + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${CMAKE_INSTALL_DATADIR}/xo-macros +) diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in new file mode 100755 index 00000000..aa8a4d7b --- /dev/null +++ b/bin/xo-cmake-config.in @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +usage() { + echo "$0 [-u|--usage|-h|--help|--lcov-exe|--genhtml-exe|--lcov-harness-exe|--gen-ccov-template|--cmake-module-path]" 1>&2 +} + +help() { + usage + + cat < 0 ]]; do + case "$1" in + -u | --usage) + cmd='usage' + ;; + -h | --help) + cmd='help' + ;; + --lcov-exe) + cmd='lcov_exe' + ;; + --genhtml-exe) + cmd='genhtml_exe' + ;; + --lcov-harness-exe) + cmd='lcov_harness_exe' + ;; + --gen-ccov-template) + cmd='gen_ccov_template' + ;; + --cmake-module-path) + cmd='cmake_module_path' + ;; + *) + usage + exit 1 + ;; + esac + + shift +done + +if [[ $cmd == 'usage' ]]; then + echo -n "usage: " + usage +elif [[ $cmd == 'help' ]]; then + echo -n "help: " + help +elif [[ $cmd == 'lcov_exe' ]]; then + echo -n @LCOV_EXECUTABLE@ +elif [[ $cmd == 'genhtml_exe' ]]; then + echo -n @GENHTML_EXECUTABLE@ +elif [[ $cmd == 'lcov_harness_exe' ]]; then + echo -n @CMAKE_INSTALL_FULL_BINDIR@/xo-cmake-lcov-harness +elif [[ $cmd == 'gen_ccov_template' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in +elif [[ $cmd == 'cmake_module_path' ]]; then + echo -n @CMAKE_MODULE_PATH@ +fi diff --git a/bin/xo-cmake-lcov-harness.in b/bin/xo-cmake-lcov-harness.in new file mode 100755 index 00000000..414b950a --- /dev/null +++ b/bin/xo-cmake-lcov-harness.in @@ -0,0 +1,121 @@ +#!/usr/bin/env bash + +srcdir=$1 +builddir=$2 +outputstem=$3 # optional +lcov=$4 # optional +genhtml=$5 # optional + +if [[ -z "${srcdir}" ]]; then + echo "xo-cmake-lcov-harness: expected non-empty srcdir" + exit 1 +fi + +if [[ -z "${builddir}" ]]; then + echo "xo-cmake-lcov-harness: expected non-empty builddir" + exit 1 +fi + +if [[ -z ${outputstem} ]]; then + outputstem=$builddir/ccov/out +fi + +if [[ -z ${lcov} ]]; then + lcov=@LCOV_EXECUTABLE@ + if [[ $lcov == "LCOV_EXECUTABLE-NOTFOUND" ]]; then + echo "xo-cmake-lcov-harness: lcov executable not found during xo-cmake build/install" + exit 1 + fi +fi + +if [[ -z ${genhtml} ]]; then + genhtml=@GENHTML_EXECUTABLE@ + if [[ $genhtml == "GENHTML_EXECUTABLE-NOTFOUND" ]]; then + echo "xo-cmake-lcov-harness: genhtml executable not found during xo-cmake build/install" + exit 1 + fi +fi + +mkdir -p $builddir/ccov + +# directory stems for location of {.gcda, gcno} coverage information, +# +# if we have source tree: +# +# ${srcdir} +# +- foo +# | \- foo.cpp +# \- bar +# \- quux +# +- quux.cpp +# \- quux_main.cpp +# +# then we expect build tree: +# +# ${builddir} +# +- foo +# | \- CMakeFiles +# | \- foo_target.dir +# | +- foo.cpp.gcda +# | \- foo.cpp.gcno +# +- bar +# \- quux +# \- CMakeFiles +# \- target4quux.dir +# +- quux.cpp.gcda +# +- quux.cpp.gcno +# +- quux_main.cpp.gcda +# \- quux_main.cpp.gcno +# +# in which case will have cmd_body: +# +# ${primarydirs} +# ./foo/CMakeFiles/foo_target.dir +# ./bar/quux/CMakeFiles/target4quux.dir +# +# here foo_target, quux_target are whatever build is using for corresponding cmake target names. +# +# We want to invoke lcov like: +# +# lcov --capture \ +# --output ${builddir}/ccov \ +# --exclude /utest/ \ +# --base-directory ${srcdir}/foo --directory ${builddir}/foo/CMakeFiles/foo_target.dir \ +# --base-directory ${srcdir}/bar/quux --directory ${builddir}/bar/quux/CMakeFiles/target4quux.dir +# +primarydirs=$(cd ${builddir} && find -name '*.gcno' \ + | xargs --replace=xx dirname xx \ + | uniq \ + | sed -e 's:^\./::') + +#echo "primarydirs=${primarydirs}" + +cmd="${lcov} --output ${outputstem}.info --capture --ignore-errors source" + +for bdir in ${primarydirs}; do + sdir=$(dirname $(dirname ${bdir})) + + cmd="${cmd} --base-directory ${srcdir}/${sdir} --directory ${builddir}/${bdir}" +done + +#echo cmd=${cmd} + +set -x + +# capture +${cmd} + +# keep only files with paths under source tree +# (don't want coverage for external libraries such as libstdc++ etc) +${lcov} --extract ${outputstem}.info "${srcdir}/*" --output ${outputstem}2.info + +# remove unit test dirs +# (we're interested in coverage of our installed code, not of the unit tests that exercise it) +${lcov} --remove ${outputstem}2.info '*/utest/*' --output ${outputstem}3.info + +# generate .html tree +mkdir -p ${builddir}/ccov/html +${genhtml} --ignore-errors source --show-details --prefix ${srcdir} --output-directory ${builddir}/ccov/html ${outputstem}3.info + +# also send report to stdout +${lcov} --list ${outputstem}3.info diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 3fcf3e2f..4d5bb431 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -1,5 +1,19 @@ +macro(xo_cxx_config_message) + message(STATUS "GUESSED_CMAKE_CMD=cmake -DXO_CMAKE_CONFIG_EXECUTABLE=${XO_CMAKE_CONFIG_EXECUTABLE} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR} -B ${CMAKE_BINARY_DIR}") + message(STATUS "XO_CMAKE_CONFIG_EXECUTABLE=${XO_CMAKE_CONFIG_EXECUTABLE}") + message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") +endmacro() + +macro(xo_cxx_bootstrap_message) + if (NOT XO_SUBMODULE_BUILD) + xo_cxx_config_message() + endif() +endmacro() + +# deprecated -- prefer xo_cxx_toplevel_options2() macro(xo_cxx_toplevel_options) + message(WARNING "deprecated: prefer xo_cxx_toplevel_options2") enable_language(CXX) xo_toplevel_compile_options() xo_toplevel_testing_options() @@ -11,6 +25,50 @@ macro(xo_toplevel_testing_options) add_code_coverage_all_targets(EXCLUDE /nix/store* utest/*) endmacro() +macro(xo_cxx_toplevel_options2) + enable_language(CXX) + xo_toplevel_compile_options() + enable_testing() +endmacro() + +# coverage build: +# 0. +# (cmake -DCMAKE_BUILD_TYPE=coverage ..) +# 1. invoke instrumented executables for which you want coverage: +# (cmake --build path/to/build -- test) +# 2. post-process low-level coverage data +# (path/to/build/gen-ccov) +# 3. point browser to generated html data +# file:///path/to/build/ccov/html/index.html +# +macro(xo_toplevel_coverage_config2) + #find_program(LCOV_EXECUTABLE NAMES lcov) + #find_program(GENHTML_EXECUTABLE NAMES genhtml) + # see bin/xo-cmake-lcov-harness in this repo + execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --lcov-harness-exe OUTPUT_VARIABLE XO_CMAKE_LCOV_HARNESS_EXECUTABLE) + execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --gen-ccov-template OUTPUT_VARIABLE XO_CMAKE_GEN_CCOV_TEMPLATE) + + if (NOT DEFINED PROJECT_CXX_FLAGS_COVERAGE) + # note: for clang would use -fprofile-instr-generate -fcoverage-mapping here instead and also at link time + set(PROJECT_CXX_FLAGS_COVERAGE -ggdb -Og -fprofile-arcs -ftest-coverage + CACHE STRING "coverage c++ compiler flags") + endif() + message("-- PROJECT_CXX_FLAGS_COVERAGE: coverage c++ flags are [${PROJECT_CXX_FLAGS_COVERAGE}]") + + add_compile_options("$<$:${PROJECT_CXX_FLAGS_COVERAGE}>") + # when -DCMAKE_BUILD_TYPE=coverage, must also link executables with gcov + link_libraries("$<$:gcov>") + + if("${XO_CMAKE_GEN_CCOV_TEMPLATE}" STREQUAL "") + message(ERROR "xo_toplevel_testing_config2: XO_CMAKE_GEN_CCOV_TEMPLATE not set") + message(ERROR "see xo_toplevel_testing_options2()") + else() + message(DEBUG "XO_CMAKE_GEN_CCOV_TEMPLATE=${XO_CMAKE_GEN_CCOV_TEMPLATE}") + configure_file(${XO_CMAKE_GEN_CCOV_TEMPLATE} ${PROJECT_BINARY_DIR}/gen-ccov @ONLY) + file(CHMOD ${PROJECT_BINARY_DIR}/gen-ccov PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + endif() +endmacro() + macro(xo_toplevel_compile_options) define_property( TARGET @@ -557,7 +615,7 @@ macro(xo_dependency_helper target visibility dep) xo_dependency_helper1(${target} ${visibility} repo/${_nxo_dep}/include) endif() else() - message("-- [${target}] find_package(${dep}) (xo_dependency_helper)") + message(STATUS "[${target}] find_package(${dep}) (xo_dependency_helper)") find_package(${dep} CONFIG REQUIRED) endif() diff --git a/share/xo-macros/gen-ccov.in b/share/xo-macros/gen-ccov.in new file mode 100644 index 00000000..c81c3f53 --- /dev/null +++ b/share/xo-macros/gen-ccov.in @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +srcdir=@PROJECT_SOURCE_DIR@ +builddir=@PROJECT_BINARY_DIR@ + +#lcov=@LCOV_EXECUTABLE@ +#genhtml=@GENHTML_EXECUTABLE@ +# +#if [[ $lcov == "LCOV_EXECUTABLE-NOTFOUND" ]]; then +# echo "gen-ccov: lcov executable not found" +# exit 1 +#fi +# +#if [[ $genhtml == "GENHTML_EXECUTABLE-NOTFOUND" ]]; then +# echo "gen-ccov: genhtml executable not found" +# exit 1 +#fi + +lcovharness=@XO_CMAKE_LCOV_HARNESS_EXECUTABLE@ + +if [[ -z $lcovharness ]]; then + echo "gen-ccov: lcov-harness executable (XO_CMAKE_LCOV_HARNESS_EXECUTABLE) not configured" + echo "gen-ccov: expect value of path/to/xo-cmake-config --lcov-harness-exe" + echo "gen-ccov: stored in XO_CMAKE_LCOV_HARNESS_EXECUTABLE by xo_toplevel_testing_options2()" + exit 1 +fi + +# TODO: allow providing LCOV_EXECUTABLE GENHTML_EXECUTABLE here + +$lcovharness $srcdir $builddir From 3339ea8eb6dc5323a8fcc1a56e54ffbd4a238df7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 13:44:47 -0400 Subject: [PATCH 66/96] xo-cmake: github: + workflow using docker-xo-builder --- .github/workflows/xo-cpp-main.yml | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/xo-cpp-main.yml diff --git a/.github/workflows/xo-cpp-main.yml b/.github/workflows/xo-cpp-main.yml new file mode 100644 index 00000000..dfa221f6 --- /dev/null +++ b/.github/workflows/xo-cpp-main.yml @@ -0,0 +1,73 @@ +name: XO cmake xo-cpp-builder + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + container: + # custom docker image. see github.com:rconybea/docker-xo-builder for definition + image: ghcr.io/rconybea/docker-xo-builder:v1 + + steps: + - name: xo-cmake + run: | + # treat github.com as known host to prevent shtoopid SSL errors + mkdir -p ~/.ssh + ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts + cat ~/.ssh/known_hosts + + git config --global http.sslVerify false + + XO_NAME=xo-cmake + XO_SRC=repo/${XO_NAME} + XO_BUILDDIR=${{github.workspace}}/build_${XO_NAME} + PREFIX=${{github.workspace}}/local + + XO_REPO=https://github.com/rconybea/xo-cmake.git + + mkdir -p ${XO_SRC} + mkdir -p ${XO_BUILDDIR} + + echo "::group::clone ${XO_NAME}" + export GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no' + export GIT_SSL_NOVERIFY=true + git clone ${XO_REPO} ${XO_SRC} + echo "::endgroup" + + echo "::group::configure ${XO_NAME}" + cmake -B ${XO_BUILDDIR} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${XO_SRC} + echo "::endgroup" + + echo "::group::compile ${XO_NAME}" + cmake --build ${XO_BUILDDIR} -j + echo "::endgroup" + + echo "::group::local install ${XO_NAME}" + cmake --install ${XO_BUILDDIR} + echo "::endgroup" + + echo "::group::local dir tree" + tree ${PREFIX} + echo "::endgroup" + + echo "::group::verify" + ${PREFIX}/xo-cmake-config --help + echo "$(${PREFIX}/xo-cmake-config --lcov-exe)" + echo "$(${PREFIX}/xo-cmake-config --genhtml-exe)" + echo "$(${PREFIX}/xo-cmake-config --lcov-harness-exe)" + echo "$(${PREFIX}/xo-cmake-config --gen-ccov-template)" + echo "$(${PREFIX}/xo-cmake-config --cmake-module-path)" + echo "::endgroup" From a978d91e94095b9cf76af3d9a73133d7e5947f9c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 13:46:23 -0400 Subject: [PATCH 67/96] xo-cmake: github: + debug message --- .github/workflows/xo-cpp-main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/xo-cpp-main.yml b/.github/workflows/xo-cpp-main.yml index dfa221f6..a876c831 100644 --- a/.github/workflows/xo-cpp-main.yml +++ b/.github/workflows/xo-cpp-main.yml @@ -64,6 +64,7 @@ jobs: echo "::endgroup" echo "::group::verify" + ls -l ${PREFIX}/xo-cmake-config ${PREFIX}/xo-cmake-config --help echo "$(${PREFIX}/xo-cmake-config --lcov-exe)" echo "$(${PREFIX}/xo-cmake-config --genhtml-exe)" From 294f1ebb81b2cfe29e807d75cd3c8bca149a660c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 13:47:47 -0400 Subject: [PATCH 68/96] xo-cmake: github: fix xo-cmake-config path --- .github/workflows/xo-cpp-main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/xo-cpp-main.yml b/.github/workflows/xo-cpp-main.yml index a876c831..a792ec7d 100644 --- a/.github/workflows/xo-cpp-main.yml +++ b/.github/workflows/xo-cpp-main.yml @@ -64,11 +64,11 @@ jobs: echo "::endgroup" echo "::group::verify" - ls -l ${PREFIX}/xo-cmake-config - ${PREFIX}/xo-cmake-config --help - echo "$(${PREFIX}/xo-cmake-config --lcov-exe)" - echo "$(${PREFIX}/xo-cmake-config --genhtml-exe)" - echo "$(${PREFIX}/xo-cmake-config --lcov-harness-exe)" - echo "$(${PREFIX}/xo-cmake-config --gen-ccov-template)" - echo "$(${PREFIX}/xo-cmake-config --cmake-module-path)" + ls -l ${PREFIX}/bin/xo-cmake-config + ${PREFIX}/bin/xo-cmake-config --help + echo "$(${PREFIX}/bin/xo-cmake-config --lcov-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --genhtml-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --lcov-harness-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --gen-ccov-template)" + echo "$(${PREFIX}/bin/xo-cmake-config --cmake-module-path)" echo "::endgroup" From d3b12a97e2cb690041da9068b9fb4b5e7bdca037 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 13:58:38 -0400 Subject: [PATCH 69/96] xo-cmake: bugfix: cmake_module_path must-> CMAKE_INSTALL_DATADIR ! --- CMakeLists.txt | 2 +- bin/xo-cmake-config.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 516c8c84..075246d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ install( "cmake/xo_macros/xo_cxx.cmake" "cmake/xo_macros/code-coverage.cmake" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION share/cmake/xo_macros + DESTINATION ${CMAKE_INSTALL_DATADIR}/xo_macros ) install( diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in index aa8a4d7b..81ebce45 100755 --- a/bin/xo-cmake-config.in +++ b/bin/xo-cmake-config.in @@ -70,5 +70,5 @@ elif [[ $cmd == 'lcov_harness_exe' ]]; then elif [[ $cmd == 'gen_ccov_template' ]]; then echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in elif [[ $cmd == 'cmake_module_path' ]]; then - echo -n @CMAKE_MODULE_PATH@ + echo -n @CMAKE_INSTALL_DATADIR@ fi From c111a3eff29f4b69b6cf75175573a14b2e6aa44a Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 14:00:29 -0400 Subject: [PATCH 70/96] xo-cmake: bugfix: need full CMAKE_INSTALL_FULL_DATADIR --- bin/xo-cmake-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in index 81ebce45..e6adcb9f 100755 --- a/bin/xo-cmake-config.in +++ b/bin/xo-cmake-config.in @@ -70,5 +70,5 @@ elif [[ $cmd == 'lcov_harness_exe' ]]; then elif [[ $cmd == 'gen_ccov_template' ]]; then echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in elif [[ $cmd == 'cmake_module_path' ]]; then - echo -n @CMAKE_INSTALL_DATADIR@ + echo -n @CMAKE_INSTALL_FULL_DATADIR@ fi From 40ce9b63bc113747931b420d6feef2f221e68567 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 14:07:48 -0400 Subject: [PATCH 71/96] xo-cmake: bugfix: fix path for cmake macro install dest --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 075246d9..9e1d74bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ install( "cmake/xo_macros/xo_cxx.cmake" "cmake/xo_macros/code-coverage.cmake" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_DATADIR}/xo_macros + DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/xo_macros ) install( From f9619cf5b08c136eee2e8a7ab5a3f3d038961096 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 14:13:24 -0400 Subject: [PATCH 72/96] xo-cmake: bugfix: fix path in exported cmake_module_path config --- bin/xo-cmake-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in index e6adcb9f..39def9fa 100755 --- a/bin/xo-cmake-config.in +++ b/bin/xo-cmake-config.in @@ -70,5 +70,5 @@ elif [[ $cmd == 'lcov_harness_exe' ]]; then elif [[ $cmd == 'gen_ccov_template' ]]; then echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in elif [[ $cmd == 'cmake_module_path' ]]; then - echo -n @CMAKE_INSTALL_FULL_DATADIR@ + echo -n @CMAKE_INSTALL_FULL_DATADIR@/cmake fi From 8846fa5da875d6f5d0875ac79c5ec01fcf7f9e76 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 25 Apr 2024 14:31:24 -0400 Subject: [PATCH 73/96] xo-cmake: + xo-cmake-config --doxygen-template --- bin/xo-cmake-config.in | 16 +- share/xo-macros/Doxyfile.in | 2816 +++++++++++++++++++++++++++++++++++ 2 files changed, 2827 insertions(+), 5 deletions(-) create mode 100644 share/xo-macros/Doxyfile.in diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in index 39def9fa..df5a2d8e 100755 --- a/bin/xo-cmake-config.in +++ b/bin/xo-cmake-config.in @@ -14,11 +14,12 @@ display xo-cmake configuration variables Options: -u | --usage brief help message --help this help message + --cmake-module-path report directory providing xo-cmake macros (will use/appear-in CMAKE_MODULE_PATH) --lcov-exe report path to 'lcov' executable --genhtml-exe report path to 'genhtml' executable --lcov-harness-exe report path to 'xo-cmake-lcov-harness' executable --gen-ccov-template report path to 'gen-ccov.in' template - --cmake-module-path report directory providing xo-cmake macros (will use/appear-in CMAKE_MODULE_PATH) + --doxygen-template report path to 'Doxyfile.in' template EOF } @@ -31,6 +32,9 @@ while [[ $# > 0 ]]; do -h | --help) cmd='help' ;; + --cmake-module-path) + cmd='cmake_module_path' + ;; --lcov-exe) cmd='lcov_exe' ;; @@ -43,8 +47,8 @@ while [[ $# > 0 ]]; do --gen-ccov-template) cmd='gen_ccov_template' ;; - --cmake-module-path) - cmd='cmake_module_path' + --doxygen-template) + cmd='doxygen_template' ;; *) usage @@ -61,6 +65,8 @@ if [[ $cmd == 'usage' ]]; then elif [[ $cmd == 'help' ]]; then echo -n "help: " help +elif [[ $cmd == 'cmake_module_path' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/cmake elif [[ $cmd == 'lcov_exe' ]]; then echo -n @LCOV_EXECUTABLE@ elif [[ $cmd == 'genhtml_exe' ]]; then @@ -69,6 +75,6 @@ elif [[ $cmd == 'lcov_harness_exe' ]]; then echo -n @CMAKE_INSTALL_FULL_BINDIR@/xo-cmake-lcov-harness elif [[ $cmd == 'gen_ccov_template' ]]; then echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in -elif [[ $cmd == 'cmake_module_path' ]]; then - echo -n @CMAKE_INSTALL_FULL_DATADIR@/cmake +elif [[ $cmd == 'doxygen_template' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/Doxyfile.in fi diff --git a/share/xo-macros/Doxyfile.in b/share/xo-macros/Doxyfile.in new file mode 100644 index 00000000..13dfb0fa --- /dev/null +++ b/share/xo-macros/Doxyfile.in @@ -0,0 +1,2816 @@ +# If filename is Doxyfile.in: +# template (to be expanded by cmake) for real doxyfile +# @SOMEVAR@ expands to value of cmake variable SOMEVAR +# +# expressions to be expanded include: +# @DOX_INPUT_DIR@ +# @DOX_OUTPUT_DIR@ +# +# if filename is Doxyfile: +# expanded template in build directory, to configure doxygen + +# Doxyfile 1.9.7 +# + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Cmake Examples" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @DOX_OUTPUT_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = @DOX_INPUT_DIR@ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0. and GITHUB Use the lower case version of title +# with any whitespace replaced by '-' and punctations characters removed.. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = YES + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = YES + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = SYSTEM + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @DOX_INPUT_DIR@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = */utest/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /