File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO wolfgitpr/cpp-pinyin
4
+ REF "${VERSION} "
5
+ SHA512 cdd78cdc493ab352bfd7c5adfb4642bc587fb26f65b4d81a07e7c89c377222a30730f3e800f028106b66cbc35e32709c1a0e470e9737b6ee9718e3ce9da8137a
6
+ HEAD_REF main
7
+ )
8
+
9
+ string (COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE} " "static" CPP_PINYIN_BUILD_STATIC)
10
+
11
+ vcpkg_cmake_configure(
12
+ SOURCE_PATH "${SOURCE_PATH} "
13
+ OPTIONS
14
+ -DCPP_PINYIN_BUILD_STATIC=${CPP_PINYIN_BUILD_STATIC}
15
+ -DCPP_PINYIN_BUILD_TESTS=FALSE
16
+ "-DVCPKG_DICT_DIR=${CURRENT_PACKAGES_DIR} /share/${PORT} "
17
+ )
18
+
19
+ vcpkg_cmake_install()
20
+
21
+ vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT} " )
22
+
23
+ file (REMOVE_RECURSE "${CURRENT_PACKAGES_DIR} /debug/include" )
24
+
25
+ vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH} /LICENSE" )
26
+ configure_file ("${CMAKE_CURRENT_LIST_DIR} /usage" "${CURRENT_PACKAGES_DIR} /share/${PORT} /usage" COPYONLY )
Original file line number Diff line number Diff line change
1
+ cpp-pinyin provides CMake targets:
2
+
3
+ find_package(cpp-pinyin CONFIG REQUIRED)
4
+ target_link_libraries(main PRIVATE cpp-pinyin::cpp-pinyin)
5
+
6
+ To use the library, you need to copy the dictionary files to the binary directory.
7
+
8
+ add_custom_command(TARGET main POST_BUILD
9
+ COMMAND "${CMAKE_COMMAND}" -E copy_directory
10
+ "${cpp-pinyin_DIR}/dict"
11
+ "$<TARGET_FILE_DIR:main>/dict"
12
+ )
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " cpp-pinyin" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " A lightweight Chinese/Cantonese to Pinyin library." ,
5
+ "homepage" : " https://github.com/wolfgitpr/cpp-pinyin" ,
6
+ "license" : " Apache-2.0" ,
7
+ "dependencies" : [
8
+ {
9
+ "name" : " vcpkg-cmake" ,
10
+ "host" : true
11
+ },
12
+ {
13
+ "name" : " vcpkg-cmake-config" ,
14
+ "host" : true
15
+ }
16
+ ]
17
+ }
Original file line number Diff line number Diff line change 1920
1920
"baseline" : " 1.9.0" ,
1921
1921
"port-version" : 0
1922
1922
},
1923
+ "cpp-pinyin" : {
1924
+ "baseline" : " 1.0.0" ,
1925
+ "port-version" : 0
1926
+ },
1923
1927
"cpp-redis" : {
1924
1928
"baseline" : " 4.3.1" ,
1925
1929
"port-version" : 5
Original file line number Diff line number Diff line change
1
+ {
2
+ "versions" : [
3
+ {
4
+ "git-tree" : " f3a4b0cc31a8acaecebdee019de6f0a07b45037a" ,
5
+ "version" : " 1.0.0" ,
6
+ "port-version" : 0
7
+ }
8
+ ]
9
+ }
You can’t perform that action at this time.
0 commit comments