forked from MaaAssistantArknights/MaaAssistantArknights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (30 loc) · 1.23 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 2.8)
project(MeoAssistantArknights)
option(BUILD_TEST "build a demo" OFF)
include_directories(include 3rdparty/include)
aux_source_directory(src/MeoAssistant SRC)
add_definitions(-DASST_DLL_EXPORTS)
if (WIN32)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/MP>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/MP>")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif()
set(CMAKE_CXX_STANDARD 17)
add_library(MeoAssistant SHARED ${SRC})
find_library(PaddleOCR_LIB NAMES ppocr PATHS 3rdparty/lib)
find_library(Penguin_LIB NAMES penguin-stats-recognize PATHS 3rdparty/lib)
if (WIN32)
find_library(OpenCV NAMES opencv_world453 PATHS 3rdparty/lib)
find_library(ZLIB NAMES zlibstatic PATHS 3rdparty/lib)
else ()
find_package(OpenCV REQUIRED)
find_package(ZLIB REQUIRED)
endif ()
target_link_libraries(MeoAssistant ${OpenCV} ${PaddleOCR_LIB} ${Penguin_LIB} ${ZLIB})
if (BUILD_TEST)
add_executable(test tools/TestCaller/main.cpp)
target_link_libraries(test MeoAssistant)
endif(BUILD_TEST)