LunaTranslator/cpp/LunaOCR/CMakeLists.txt

24 lines
710 B
CMake
Raw Normal View History

2024-11-04 23:10:41 +08:00
project(LunaOCR)
generate_product_version(
versioninfo
NAME "LunaTranslator OCR"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
find_package(OnnxRuntime REQUIRED)
2024-11-05 15:46:45 +08:00
set(OpenCV_STATIC ON)
find_package(OpenCV REQUIRED)
2024-11-04 23:10:41 +08:00
add_library(LunaOCR SHARED OCR.cpp ${versioninfo})
2024-11-15 03:04:53 +08:00
target_link_libraries(LunaOCR ${OnnxRuntime_LIBS} ${OpenCV_LIBS} Clipper2Lib ${YY_Thunks_for_WinXP})
2024-11-04 23:10:41 +08:00
target_precompile_headers(LunaOCR REUSE_FROM pch)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set_target_properties(LunaOCR PROPERTIES OUTPUT_NAME "LunaOCR64")
else()
set_target_properties(LunaOCR PROPERTIES OUTPUT_NAME "LunaOCR32")
endif()