#Help adding ICU to cmake project

7 messages · Page 1 of 1 (latest)

manic lance
#

I have a problem with a cpp project where I need to install and import ICU for unicode strings.

In my CMakeList.txt I added the following:

find_library(unistring unistring REQUIRED) set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND libunistring) find_package(ICU COMPONENTS io i18n data uc REQUIRED) target_link_libraries(ocos_operators PUBLIC ICU::io ICU::i18n ICU::data ICU::uc "${unistring}")

Which works fine meaning it finds the local library and links it with no errors. However when I try to import "unicode/unistr.h" it fails to find that file. Which step have I missed?.

This is the cmake project I am trying to add icu to (https://github.com/microsoft/onnxruntime-extensions). I am on a mac m1.

stark thornBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

pastel moon
#

You need to add include directories.

manic lance
#

I tried to this below:
target_include_directories(ocos_operators PUBLIC ${ICU_INCLUDE_DIRS}/include)

but still no import

pastel moon
#

Try removing /include.

manic lance
#

Its working 🥳 Its weird because I did try it yesterday but it seems deleting the output folders have helped in this case

#

!solved