-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
132 lines (125 loc) · 4.6 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
cmake_minimum_required(VERSION 3.28)
enable_language(OBJCXX)
project(ShogiCamera LANGUAGES C CXX Swift VERSION 1.2.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(SHOGI_CAMERA_DISABLE_HINT OFF)
set(SHOGI_CAMERA_ENABLE_SUNFISH OFF)
set(SHOGI_CAMERA_ENABLE_MICRO686 OFF)
list(APPEND shogi_camera_gcc_preprocessor_definitions
$<IF:$<CONFIG:Debug>,SHOGI_CAMERA_DEBUG=1,SHOGI_CAMERA_RELEASE=1>
$<$<BOOL:${SHOGI_CAMERA_DISABLE_HINT}>:SHOGI_CAMERA_DISABLE_HINT=1>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_SUNFISH}>:SHOGI_CAMERA_ENABLE_SUNFISH=1>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_MICRO686}>:SHOGI_CAMERA_ENABLE_MICRO686=1>
)
list(APPEND shogi_camera_swift_active_compilation_conditions
$<IF:$<CONFIG:Debug>,SHOGI_CAMERA_DEBUG,SHOGI_CAMERA_RELEASE>
$<$<BOOL:${SHOGI_CAMERA_DISABLE_HINT}>:SHOGI_CAMERA_DISABLE_HINT>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_SUNFISH}>:SHOGI_CAMERA_ENABLE_SUNFISH>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_MICRO686}>:SHOGI_CAMERA_ENABLE_MICRO686>
)
add_subdirectory(deps/sunfish3/src/core EXCLUDE_FROM_ALL)
target_include_directories(sunfish_core PRIVATE deps/sunfish3/src)
add_subdirectory(deps/sunfish3/src/searcher EXCLUDE_FROM_ALL)
target_include_directories(sunfish_searcher PRIVATE deps/sunfish3/src)
add_subdirectory(deps/sunfish3/src/logger EXCLUDE_FROM_ALL)
target_include_directories(sunfish_logger PRIVATE deps/sunfish3/src)
find_library(opencv2 opencv2 HINTS deps/opencv/opencv/build-ios)
add_library(shogi_camera STATIC
include/shogi_camera/shogi_camera.hpp
src/game.cpp
src/img.cpp
src/move.cpp
src/piece_book.cpp
src/position.cpp
src/random_ai.cpp
src/session.cpp
src/shogi_camera.cpp
src/statistics.cpp
src/sunfish3_ai.cpp
src/piece_contour.cpp
src/csa_adapter.cpp
src/objc/shogi_camera.mm
src/csa_server.cpp
src/micro686_ai.cpp
test/doctest_main.cpp
test/move.test.hpp
test/game.test.hpp
test/img.test.hpp
)
target_include_directories(shogi_camera PUBLIC
include
deps/sunfish3/src
deps/base64/include
deps/hwm.task
deps/colormap-shaders/include
deps/opencv/opencv/build-ios/opencv2.xcframework/ios-arm64/opencv2.framework
)
target_include_directories(shogi_camera PRIVATE
deps/doctest
)
set_target_properties(shogi_camera PROPERTIES
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++20"
XCODE_ATTRIBUTE_SWIFT_OBJC_INTEROP_MODE "objcxx"
XCODE_ATTRIBUTE_GCC_PREPROCESSOR_DEFINITIONS "$<LIST:JOIN,${shogi_camera_gcc_preprocessor_definitions}, >"
)
target_link_libraries(shogi_camera
$<$<BOOL:${SHOGI_CAMERA_ENABLE_SUNFISH}>:sunfish_searcher>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_SUNFISH}>:sunfish_core>
$<$<BOOL:${SHOGI_CAMERA_ENABLE_SUNFISH}>:sunfish_logger>
)
add_executable(ShogiCameraApp MACOSX_BUNDLE
app/AppDelegate.swift
app/OpenCV+Utility.swift
app/Reader.swift
app/ShogiCamera+Utility.swift
app/MainViewController.swift
app/CGRect+Utility.swift
app/Analyzer.swift
app/VideoOverlay.swift
app/StartView.swift
app/GameView.swift
app/BoardLayer.swift
app/RoundButton.swift
app/HelpViewController.swift
app/StableBoardLayer.swift
app/CGSize+Utility.swift
app/Colors.swift
app/LaunchScreen.storyboard
app/Assets.xcassets
include/shogi_camera/module.modulemap
res/voice/voice.wav
app/Info.plist
)
set(shogi_camera_app_resources
app/LaunchScreen.storyboard
app/Assets.xcassets
res/voice/voice.wav
)
set_target_properties(ShogiCameraApp PROPERTIES
BUNDLE YES
RESOURCE "${shogi_camera_app_resources}"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.kbinani.shogi-camera"
MACOSX_BUNDLE_BUNDLE_NAME shogi-camera
MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_PROJECT_VERSION}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${CMAKE_PROJECT_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright © kbinani"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.github.kbinani.shogi-camera"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1"
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++20"
XCODE_ATTRIBUTE_SWIFT_OBJC_INTEROP_MODE "objcxx"
XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/app/Info.plist"
XCODE_ATTRIBUTE_SKIP_INSTALL "NO"
XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
XCODE_ATTRIBUTE_SHOGI_CAMERA_PROJECT_VERSION "${CMAKE_PROJECT_VERSION}"
XCODE_ATTRIBUTE_GCC_PREPROCESSOR_DEFINITIONS "$<LIST:JOIN,${shogi_camera_gcc_preprocessor_definitions}, >"
XCODE_ATTRIBUTE_SWIFT_ACTIVE_COMPILATION_CONDITIONS "$<LIST:JOIN,${shogi_camera_swift_active_compilation_conditions}, >"
)
target_link_libraries(ShogiCameraApp
shogi_camera
"-framework opencv2"
)