From 37656ac465b43a5160a407ab289d405fd8a9bd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Tue, 13 Feb 2024 09:33:28 +0100 Subject: [PATCH] fixed the find_component that did not advertise it with the found variable --- CMakeLists.txt | 8 +++++--- cmake/config.cmake.in | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50d1451..b7e8bc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,10 @@ if(IO1_WITH_TESTS) list(APPEND VCPKG_MANIFEST_FEATURES "tests") endif() +set(IO1_PROJECT_NAME "money") + project( - io1-money + io1-${IO1_PROJECT_NAME} VERSION 0.1.0 DESCRIPTION "A class to store money amounts for personal accounting applications." @@ -27,10 +29,10 @@ target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20) set_target_properties( ${PROJECT_NAME} PROPERTIES - EXPORT_NAME "money" + EXPORT_NAME ${IO1_PROJECT_NAME} ) -add_library(io1::money ALIAS ${PROJECT_NAME}) +add_library(io1::${IO1_PROJECT_NAME} ALIAS ${PROJECT_NAME}) install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}) diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in index 6618f0a..6fcad68 100644 --- a/cmake/config.cmake.in +++ b/cmake/config.cmake.in @@ -2,6 +2,9 @@ foreach(component ${io1_FIND_COMPONENTS}) include(${CMAKE_CURRENT_LIST_DIR}/io1-${component}.cmake) + if (TARGET io1::${component}) + set(io1_${component}_FOUND TRUE) + endif() endforeach() check_required_components(io1)