From 99e3db95abfb9f5b0580b539d825adc954845991 Mon Sep 17 00:00:00 2001 From: zinface Date: Tue, 21 Mar 2023 19:56:08 +0800 Subject: [PATCH] =?UTF-8?q?cmake-plugin:=20=E5=A4=84=E7=90=86=E5=9C=A8=20W?= =?UTF-8?q?indows=20=E4=B8=AD=E7=9A=84=E5=A4=96=E9=83=A8OpenCC=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/opencc-demo-plugin/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugin/opencc-demo-plugin/CMakeLists.txt b/src/plugin/opencc-demo-plugin/CMakeLists.txt index b1294db..02c978c 100644 --- a/src/plugin/opencc-demo-plugin/CMakeLists.txt +++ b/src/plugin/opencc-demo-plugin/CMakeLists.txt @@ -107,7 +107,7 @@ ExternalProject_Add(${libopencc} CONFIGURE_COMMAND ${CMAKE_COMMAND} -S ${libopencc_src} -B ${libopencc_build} ${libopencc_flags} # CMAKE_GENERATOR # BUILD_COMMAND ${CMAKE_COMMAND} --build ${libopencc_build} --config $ - INSTALL_COMMAND ${CMAKE_COMMAND} --install ${libopencc_build} --prefix ${libopencc_install} + # INSTALL_COMMAND ${CMAKE_COMMAND} --install ${libopencc_build} --prefix ${libopencc_install} # TEST_COMMAND GIT_REMOTE_UPDATE_STRATEGY CHECKOUT EXCLUDE_FROM_ALL @@ -124,4 +124,11 @@ set_target_properties(opencc # 确保 opencc_git 在此插件之前构建完成 add_dependencies(${LOCAL_PLUGIN_NAME} opencc_git) -target_link_libraries(${LOCAL_PLUGIN_NAME} opencc) \ No newline at end of file +target_link_libraries(${LOCAL_PLUGIN_NAME} opencc) + +if(WIN32) + target_include_directories(${LOCAL_PLUGIN_NAME} PUBLIC ${libopencc_install}/include) + target_compile_definitions(${LOCAL_PLUGIN_NAME} + PRIVATE + OPENCC_EXPORT=) +endif(WIN32) \ No newline at end of file