LunaTranslator/cpp/wcocr/CMakeLists.txt

26 lines
944 B
CMake
Raw Permalink Normal View History

2024-07-13 21:55:16 +08:00
project(wcocr)
2025-01-03 13:06:55 +08:00
set(wcocr_src wechat-ocr/src/mojocall.cpp wechat-ocr/src/ocr_common.pb.cc wechat-ocr/src/ocr_wx3.pb.cc wechat-ocr/src/ocr_wx4.pb.cc wechat-ocr/src/wechatocr.cpp)
2024-07-13 21:55:16 +08:00
2025-01-04 07:28:06 +08:00
add_library(wcocr MODULE wcocr.cpp ${wcocr_src} ${versioninfo})
2025-01-03 13:06:55 +08:00
target_include_directories(wcocr PUBLIC wechat-ocr/vs.proj PUBLIC wechat-ocr/src PRIVATE wechat-ocr/spt)
2024-07-13 21:55:16 +08:00
target_compile_options(wcocr
PUBLIC
2025-01-03 13:06:55 +08:00
/std:c++20
2024-07-13 21:55:16 +08:00
/MD
/wd4018
/DUNICODE
/D_UNICODE
)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
2025-01-03 13:06:55 +08:00
target_link_libraries(wcocr ${CMAKE_CURRENT_SOURCE_DIR}/wechat-ocr/spt/x64/libprotobuf-lite.lib ${CMAKE_CURRENT_SOURCE_DIR}/wechat-ocr/spt/x64/mmmojo_64.lib)
2024-07-13 21:55:16 +08:00
target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo_64.dll")
else()
2025-01-03 13:06:55 +08:00
target_link_libraries(wcocr ${CMAKE_CURRENT_SOURCE_DIR}/wechat-ocr/spt/x86/libprotobuf-lite.lib ${CMAKE_CURRENT_SOURCE_DIR}/wechat-ocr/spt/x86/mmmojo.lib)
2024-07-13 21:55:16 +08:00
target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo.dll")
endif()