Skip to content
Merged
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
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ endfunction()

find_package(utf8cpp)
if(NOT utf8cpp_FOUND)
# a headers-only utf8cpp installation ships no CMake package
find_path(LIBEBML_UTF8CPP_INCLUDE_DIR utf8/checked.h PATH_SUFFIXES utf8cpp)
mark_as_advanced(LIBEBML_UTF8CPP_INCLUDE_DIR)
endif()
if(NOT utf8cpp_FOUND AND NOT LIBEBML_UTF8CPP_INCLUDE_DIR)
include(FetchContent REQUIRED)
FetchContent_Declare(
utf8cpp
Expand Down Expand Up @@ -160,7 +165,11 @@ if(MSVC)
target_compile_definitions(ebml PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()

target_link_libraries(ebml PRIVATE ${libebml_utf8cpp_link_libraries})
if(LIBEBML_UTF8CPP_INCLUDE_DIR)
target_include_directories(ebml PRIVATE ${LIBEBML_UTF8CPP_INCLUDE_DIR})
else()
target_link_libraries(ebml PRIVATE ${libebml_utf8cpp_link_libraries})
endif()

include(GenerateExportHeader)
generate_export_header(ebml EXPORT_MACRO_NAME EBML_DLL_API)
Expand Down
Loading