Skip to content

Commit

Permalink
refactor: Update ICU library configuration and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Aug 30, 2024
1 parent 851f6a5 commit 8ef418c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if(ENABLE_TESTS)

find_libav(${CMAKE_PROJECT_NAME}-tests)

target_link_libraries(${CMAKE_PROJECT_NAME}-tests PRIVATE ct2 sentencepiece Whispercpp Ort OBS::libobs ICU::ICU)
target_link_libraries(${CMAKE_PROJECT_NAME}-tests PRIVATE ct2 sentencepiece Whispercpp Ort OBS::libobs ICU)
target_include_directories(${CMAKE_PROJECT_NAME}-tests PRIVATE src)

# install the tests to the release/test directory
Expand Down
15 changes: 7 additions & 8 deletions cmake/BuildICU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ if(WIN32)
install(FILES ${ICU_IN_DLL} DESTINATION "obs-plugins/64bit")

add_library(ICU::ICU_data SHARED IMPORTED GLOBAL)
set_target_properties(ICU::ICU_data PROPERTIES IMPORTED_LOCATION "${ICU_DATA_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES
"${ICU_INCLUDE_DIR}")
set_target_properties(ICU::ICU_data PROPERTIES IMPORTED_LOCATION "${ICU_DATA_LIBRARY}" IMPORTED_IMPLIB
"${ICU_DATA_LIBRARY}")

add_library(ICU::ICU_uc SHARED IMPORTED GLOBAL)
set_target_properties(ICU::ICU_uc PROPERTIES IMPORTED_LOCATION "${ICU_UC_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES
"${ICU_INCLUDE_DIR}")
set_target_properties(ICU::ICU_uc PROPERTIES IMPORTED_LOCATION "${ICU_UC_LIBRARY}" IMPORTED_IMPLIB
"${ICU_UC_LIBRARY}")

add_library(ICU::ICU_in SHARED IMPORTED GLOBAL)
set_target_properties(ICU::ICU_in PROPERTIES IMPORTED_LOCATION "${ICU_IN_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES
"${ICU_INCLUDE_DIR}")

set_target_properties(ICU::ICU_in PROPERTIES IMPORTED_LOCATION "${ICU_IN_LIBRARY}" IMPORTED_IMPLIB
"${ICU_IN_LIBRARY}")
else()
set(ICU_URL
"https://github.com/unicode-org/icu/releases/download/release-${ICU_VERSION_DASH}/icu4c-${ICU_VERSION_UNDERSCORE}-src.tgz"
Expand Down Expand Up @@ -128,4 +127,4 @@ endif()
add_library(ICU INTERFACE)
add_dependencies(ICU ICU_build)
target_link_libraries(ICU INTERFACE ICU::ICU_data ICU::ICU_uc ICU::ICU_in)
target_include_directories(ICU SYSTEM INTERFACE ${ICU_INCLUDE_DIR})
target_include_directories(ICU INTERFACE $<BUILD_INTERFACE:${ICU_INCLUDE_DIR}>)

0 comments on commit 8ef418c

Please sign in to comment.