Fix CMake build system to use existing include directory (#112)

Also provide an imported target utf8::cpp for backward compatibility.
This commit is contained in:
Urs Fleisch 2023-11-04 15:22:16 +01:00
parent e41ec639b7
commit 40d6c67d0a
2 changed files with 5 additions and 1 deletions

View file

@ -10,7 +10,7 @@ include(GNUInstallDirs)
target_include_directories(utf8cpp INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>"
$<INSTALL_INTERFACE:include/utf8cpp>
$<INSTALL_INTERFACE:include>
)
include(CMakePackageConfigHelpers)

View file

@ -2,3 +2,7 @@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")
if(NOT TARGET utf8::cpp)
add_library(utf8::cpp ALIAS utf8cpp::utf8cpp)
endif()