vcpkg/ports/opencc/fix-dependencies.patch

61 lines
1.8 KiB
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee08591..c8c6b61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,12 +185,14 @@ if(NOT USE_SYSTEM_MARISA)
message(STATUS "Use bundled marisa library.")
add_subdirectory(deps/marisa-0.2.6)
else()
- find_library(LIBMARISA NAMES marisa)
- if (LIBMARISA)
- message(STATUS "libmarisa found: ${LIBMARISA}")
- else()
- message(FATAL_ERROR "libmarisa not found.")
- endif()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(marisa REQUIRED IMPORTED_TARGET marisa)
+ # find_library(LIBMARISA NAMES marisa)
+ # if (LIBMARISA)
+ # message(STATUS "libmarisa found: ${LIBMARISA}")
+ # else()
+ # message(FATAL_ERROR "libmarisa not found.")
+ # endif()
endif()
######## Subdirectories
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c0a0b10..91b4037 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -114,7 +114,7 @@ configure_file(
add_library(libopencc ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
set_target_properties(libopencc PROPERTIES POSITION_INDEPENDENT_CODE ON)
source_group(libopencc FILES ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
-target_link_libraries(libopencc marisa)
+target_link_libraries(libopencc PkgConfig::marisa)
GENERATE_EXPORT_HEADER(
libopencc
@@ -137,6 +137,21 @@ set_target_properties(
2023-02-24 03:11:11 +08:00
${OPENCC_VERSION_MAJOR}.${OPENCC_VERSION_MINOR}
)
+if(USE_SYSTEM_RAPIDJSON)
+ find_package(RapidJSON CONFIG REQUIRED)
2023-02-24 03:11:11 +08:00
+ target_link_libraries(libopencc rapidjson)
+endif()
2022-08-27 03:11:07 +08:00
+
+if(USE_SYSTEM_TCLAP)
+ find_path(TCLAP_INCLUDE_DIRS "tclap/Arg.h")
+ target_include_directories(libopencc PUBLIC ${TCLAP_INCLUDE_DIRS})
+endif()
+
+if(USE_SYSTEM_DARTS)
+ find_path(DARTS_INCLUDE_DIRS "darts.h")
+ target_include_directories(libopencc PUBLIC ${DARTS_INCLUDE_DIRS})
+endif()
+
# Installation
install(