diff --git a/CMakeLists.txt b/CMakeLists.txt index 94bd08fa..6a7b8377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,14 +33,15 @@ xo_toplevel_compile_options() add_subdirectory(utest) -set(SELF_LIB xo_ordinaltree) +# ---------------------------------------------------------------- +# header-only library -add_library(${SELF_LIB} INTERFACE) -xo_include_headeronly_options2(${SELF_LIB}) +set(SELF_LIB ordinaltree) +xo_add_headeronly_library(${SELF_LIB}) # ---------------------------------------------------------------- # -xo_install_library2(${PROJECT_NAME}) +xo_install_library3(${SELF_LIB} ${PROJECT_NAME}Targets) xo_install_include_tree() # (note: ..Targets from xo_install_library2()) xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index 26b370b4..30311ce5 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -1,4 +1,4 @@ -# tree/utest/CMakeLists.txt +# ordinaltree/utest/CMakeLists.txt # note: tests in this directory use Catch2-provided main set(SELF_EXE utest.tree) @@ -22,26 +22,4 @@ xo_dependency(${SELF_EXE} randomgen) xo_external_target_dependency(${SELF_EXE} Catch2 Catch2::Catch2) -# need this so that catch2/include appears in compile_commands.json, -# on which lsp integration relies. -# -# See also /nix/store/*-catch2-*/lib/cmake/Catch2/ParseAndAddCatchTests.cmake; -# commands here derived from ^ .cmake file -# - -# let's see if xo_external_target_dependency() works for these.. -#find_path(CATCH_INCLUDE_DIR "catch2/catch.hpp") -#target_include_directories(${SELF_UTEST_NAME} PUBLIC ${CATCH_INCLUDE_DIR}) - -## ---------------------------------------------------------------- -## 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() - -# end tree/utest/CMakeLists.txt +# end ordinaltree/utest/CMakeLists.txt