Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function(add_cxx_flag_if_supported)
endforeach()
endfunction()

find_package(utf8cpp 3.2.0)
find_package(utf8cpp)
if(NOT utf8cpp_FOUND)
include(FetchContent REQUIRED)
FetchContent_Declare(
Expand All @@ -61,6 +61,11 @@ if(NOT utf8cpp_FOUND)
)
FetchContent_MakeAvailable(utf8cpp)
endif()
if(TARGET utf8cpp::utf8cpp)
set(libebml_utf8cpp_link_libraries utf8cpp::utf8cpp)
else()
set(libebml_utf8cpp_link_libraries $<BUILD_INTERFACE:utf8cpp>)
endif()

if(DEV_MODE)
message(STATUS "Using developer mode for ${CMAKE_CXX_COMPILER_ID}")
Expand Down Expand Up @@ -138,7 +143,7 @@ if(WIN32)
target_compile_definitions(ebml PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()

target_link_libraries(ebml PRIVATE $<BUILD_INTERFACE:utf8cpp>)
target_link_libraries(ebml PRIVATE ${libebml_utf8cpp_link_libraries})

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
if(${CMAKE_CXX_BYTE_ORDER} STREQUAL "BIG_ENDIAN")
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
parent projects via `add_subdirectory`.
* Enabled building shared libraries via the usual CMake definition
`BUILD_SHARES_LIBS` (default: off).
* Fixed cmake rules for building with utf8cpp 4.x; fixes #344

# Version 1.4.3 2022-09-30

Expand Down
Loading