From 70b4ce79fb493e45ae8884389ed146cf334a0369 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Fri, 3 Nov 2023 22:53:31 +0100 Subject: [PATCH] Fix build on Mac with Homebrew utf8cpp --- taglib/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index 911ce058..89f527d1 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -343,6 +343,16 @@ add_library(tag ${tag_LIB_SRCS} ${tag_HDRS}) target_link_libraries(tag $<$:utf8::cpp>) target_link_libraries(tag $<$:ZLIB::ZLIB>) +# Homebrew utf8cpp 4.0.1 seems to have issues. utf8.h is not found because +# imported target utf8::cpp does not exist. The imported target utf8cpp::utf8cpp +# includes non-existent path /usr/local/include/utf8cpp and cannot be used. +# Therefore the following (temporary) hack is used to find the utf8cpp includes. +if(APPLE) + if(EXISTS /usr/local/include/utf8.h) + include_directories(/usr/local/include) + endif() +endif() + set_target_properties(tag PROPERTIES VERSION ${TAGLIB_SOVERSION_MAJOR}.${TAGLIB_SOVERSION_MINOR}.${TAGLIB_SOVERSION_PATCH} SOVERSION ${TAGLIB_SOVERSION_MAJOR}