From fb5bb1b03a1f2a6b9250dab078f0810c019ba527 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 17:57:54 -0400 Subject: [PATCH] randomgen: build streamlining using xo-cmake macros --- CMakeLists.txt | 15 ++++++--------- example/ex1/CMakeLists.txt | 2 +- example/ex2/CMakeLists.txt | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16cb2202..e27486bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,15 +6,13 @@ project(randomgen VERSION 0.1) enable_language(CXX) include(xo_macros/xo_cxx) -include(cmake/cxx.cmake) -include(cmake/code-coverage.cmake) +include(xo_macros/code-coverage) +#include(cmake/cxx.cmake) # ---------------------------------------------------------------- # unit test setup enable_testing() - - # activate code coverage for all executables + libraries (when configured with -DCODE_COVERAGE=ON) add_code_coverage() # 1. assuming that /nix/store/ prefixes .hpp files belonging to gcc, catch2 etc. @@ -50,9 +48,8 @@ endif() if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX /home/${USER}/local CACHE STRING "install directory") endif() -if(NOT CMAKE_INSTALL_RPATH) - set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING "runpath in installed libraries/executables") -endif() + +xo_toplevel_compile_options() # ---------------------------------------------------------------- # external dependencies @@ -60,7 +57,7 @@ endif() # set CMAKE_INSTALL_PREFIX to analog of /usr # to use .cmake assistants from /usr/lib/cmake/indentlog # -find_package(indentlog REQUIRED) +#find_package(indentlog REQUIRED) # ---------------------------------------------------------------- @@ -69,6 +66,6 @@ add_subdirectory(example) # ---------------------------------------------------------------- -install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) +xo_install_include_tree() install(TARGETS ex1 DESTINATION bin/randomgen/example) 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 bab03164..ee6687f2 100644 --- a/example/ex2/CMakeLists.txt +++ b/example/ex2/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(ex2 ex2.cpp) -xo_include_options(ex2) -xo_indentlog_dependency(ex2) +xo_include_options2(ex2) +xo_internal_dependency(ex2 indentlog)