+ xo_cxx_toplevel_options() to consolidate boilerplate

This commit is contained in:
Roland Conybeare 2023-10-23 13:34:53 -04:00
commit 5ae6f41e63
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,2 @@
include(xo_macros/xo_cxx)
include(xo_macros/code-coverage)

View file

@ -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) macro(xo_toplevel_compile_options)
define_property( define_property(
TARGET TARGET
@ -214,6 +226,24 @@ endmacro()
# e.g. # e.g.
# - target=xo_pyutil cmake target name for this library # - 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) macro(xo_add_headeronly_library target)
add_library(${target} INTERFACE) add_library(${target} INTERFACE)