From 48470cb1ba3eae0c2cc62553d84c988b9207085c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 18 Jul 2024 09:51:47 +1000 Subject: [PATCH] build: use the new in-tree library name for cruft-util --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42b66f7..7d66956 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ ############################################################################### -cmake_minimum_required(VERSION 3.7.0) +cmake_minimum_required(VERSION 3.20.0) project(cruft-cxx CXX) +############################################################################### +if (NOT TARGET cruft::util) + find_package (cruft CONFIG REQUIRED COMPONENTS util) +endif() + + ############################################################################### list (APPEND sources src/type_traits @@ -12,8 +18,8 @@ list (APPEND sources ##----------------------------------------------------------------------------- -add_library (cruft-cxx STATIC ${sources}) - +add_library (libcruft-cxx STATIC ${sources}) +add_library (cruft::cxx ALIAS libcruft-cxx) ############################################################################### option (TESTS "enable unit testing" ON) @@ -26,7 +32,7 @@ if (TESTS) foreach (t type_traits exception) string(REPLACE "/" "_" name "test/${t}") add_executable(cxx_${name} test/${t}.cpp) - target_link_libraries(cxx_${name} PRIVATE cruft-cxx cruft) + target_link_libraries(cxx_${name} PRIVATE cruft::cxx cruft::util) target_include_directories(cxx_${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) add_test(NAME cxx_${name} COMMAND cxx_${name}) endforeach()