From 49567a59a150370b219793d1d588fd99e5ca9a1c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 17:30:13 -0400 Subject: [PATCH] indentlog: build: streamline using xo-cmake macros --- CMakeLists.txt | 42 ++++++------------------------------ example/ex1/CMakeLists.txt | 2 +- example/ex2/CMakeLists.txt | 2 +- example/ex3/CMakeLists.txt | 2 +- example/ex4/CMakeLists.txt | 2 +- example/hello/CMakeLists.txt | 2 +- utest/CMakeLists.txt | 2 +- 7 files changed, 12 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86f6de3a..c8c5c655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,7 @@ enable_language(CXX) # common XO cmake macros (see proj/xo-cmake) include(xo_macros/xo_cxx) -include(cmake/nestlog.cmake) -include(cmake/code-coverage.cmake) +include(xo_macros/code-coverage) enable_testing() # activate code coverage for all executables + libraries (when -DCODE_COVERAGE=ON) @@ -46,10 +45,11 @@ add_subdirectory(utest) # see [[https://stackoverflow.com/questions/47718485/install-and-export-interface-only-library-cmake]] # add_library(indentlog INTERFACE) -target_include_directories(indentlog INTERFACE - $ - $ - ) +xo_include_headeronly_options2(indentlog) +#target_include_directories(indentlog INTERFACE +# $ +# $ +# ) # ---------------------------------------------------------------- # provide find_package() support @@ -60,36 +60,6 @@ xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets xo_install_library2(${PROJECT_NAME}) -#include(CMakePackageConfigHelpers) -#write_basic_package_version_file("${PROJECT_BINARY_DIR}/indentlogConfigVersion.cmake" -# VERSION 0.1 -# COMPATIBILITY AnyNewerVersion -#) -# -#install( -# TARGETS indentlog -# EXPORT indentlogTargets -# 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 -# ) - -#include(CMakePackageConfigHelpers) -#configure_package_config_file( -# "${PROJECT_SOURCE_DIR}/cmake/indentlogConfig.cmake.in" -# "${PROJECT_BINARY_DIR}/indentlogConfig.cmake" -# INSTALL_DESTINATION lib/cmake/indentlog -# ) -# -#install(EXPORT indentlogTargets DESTINATION lib/cmake/indentlog) -#install( -# FILES -# "${PROJECT_BINARY_DIR}/indentlogConfigVersion.cmake" -# "${PROJECT_BINARY_DIR}/indentlogConfig.cmake" -# DESTINATION lib/cmake/indentlog) - # ---------------------------------------------------------------- # install .hpp diff --git a/example/ex1/CMakeLists.txt b/example/ex1/CMakeLists.txt index 6af29d79..a9d1b27d 100644 --- a/example/ex1/CMakeLists.txt +++ b/example/ex1/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(ex1 ex1.cpp) -xo_include_options(ex1) +xo_include_options2(ex1) diff --git a/example/ex2/CMakeLists.txt b/example/ex2/CMakeLists.txt index 1ac5735a..20026b03 100644 --- a/example/ex2/CMakeLists.txt +++ b/example/ex2/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(ex2 ex2.cpp) -xo_include_options(ex2) +xo_include_options2(ex2) diff --git a/example/ex3/CMakeLists.txt b/example/ex3/CMakeLists.txt index d81e0e99..9791a931 100644 --- a/example/ex3/CMakeLists.txt +++ b/example/ex3/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(ex3 ex3.cpp) -xo_include_options(ex3) +xo_include_options2(ex3) diff --git a/example/ex4/CMakeLists.txt b/example/ex4/CMakeLists.txt index 02c1f301..2a6b9c31 100644 --- a/example/ex4/CMakeLists.txt +++ b/example/ex4/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(ex4 ex4.cpp) -xo_include_options(ex4) +xo_include_options2(ex4) diff --git a/example/hello/CMakeLists.txt b/example/hello/CMakeLists.txt index d6f694e6..1ff23000 100644 --- a/example/hello/CMakeLists.txt +++ b/example/hello/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(hello hello.cpp) -xo_include_options(hello) +xo_include_options2(hello) diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index c6e6e596..fbbeb9d7 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -7,7 +7,7 @@ set(SELF_SOURCE_FILES indentlog_utest_main.cpp) add_executable(${SELF_EXECUTABLE_NAME} ${SELF_SOURCE_FILES}) -xo_include_options(${SELF_EXECUTABLE_NAME}) +xo_include_options2(${SELF_EXECUTABLE_NAME}) add_test(NAME ${SELF_EXECUTABLE_NAME} COMMAND ${SELF_EXECUTABLE_NAME}) target_code_coverage(${SELF_EXECUTABLE_NAME} AUTO ALL)