forked from AppleWin/AppleWin
-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
124 lines (102 loc) · 2.4 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
include(FindPkgConfig)
include(FindOpenGL)
add_executable(sa2)
set(IMGUI_PATH "imgui/imgui")
set(IMGUI_CLUB_PATH "imgui/imgui_club")
find_package(SDL2 REQUIRED)
# we should use find_package, but Ubuntu does not provide it for SDL2_image
pkg_search_module(SDL2_IMAGE REQUIRED SDL2_image)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# only OpenGL supported on MacOS
set (SA2_OPENGL ON)
else()
option(SA2_OPENGL "Prefer OpenGL over OpenGL ES" OFF)
endif()
if (SA2_OPENGL)
find_package(OpenGL REQUIRED)
else()
pkg_search_module(GLES2 REQUIRED glesv2)
target_compile_definitions(sa2 PRIVATE
IMGUI_IMPL_OPENGL_ES2
)
endif()
set(SOURCE_FILES
main.cpp
gamepad.cpp
sdirectsound.cpp
utils.cpp
sdlframe.cpp
processfile.cpp
renderer/sdlrendererframe.cpp
)
set(HEADER_FILES
gamepad.h
sdirectsound.h
utils.h
sdlframe.h
processfile.h
renderer/sdlrendererframe.h
)
target_compile_features(sa2 PUBLIC cxx_std_17)
target_include_directories(sa2 PRIVATE
${SDL2_INCLUDE_DIRS}
${SDL2_IMAGE_INCLUDE_DIRS}
${GLES2_INCLUDE_DIRS}
)
target_link_libraries(sa2 PRIVATE
${SDL2_LIBRARIES}
${SDL2_IMAGE_LIBRARIES}
${GLES2_LIBRARIES}
OpenGL::GL
appleii
common2
windows
)
target_link_directories(sa2 PRIVATE
${SDL2_LIBRARY_DIRS}
${SDL2_IMAGE_LIBRARY_DIRS}
${GLES2_LIBRARY_DIRS}
)
target_sources(sa2 PRIVATE
${SOURCE_FILES}
${HEADER_FILES}
)
target_sources(sa2 PRIVATE
imgui/sdlimguiframe.cpp
imgui/image.cpp
imgui/settingshelper.cpp
imgui/sdlsettings.cpp
imgui/sdldebugger.cpp
imgui/sdlmemory.cpp
imgui/inputtexthistory.cpp
imgui/cycletabitems.cpp
imgui/sdlimguiframe.h
imgui/image.h
imgui/settingshelper.h
imgui/sdlsettings.h
imgui/sdldebugger.h
imgui/sdlmemory.h
imgui/imconfig.h
imgui/glselector.h
imgui/inputtexthistory.h
imgui/cycletabitems.h
${IMGUI_PATH}/imgui.h
${IMGUI_PATH}/imgui.cpp
${IMGUI_PATH}/imgui_demo.cpp
${IMGUI_PATH}/imgui_draw.cpp
${IMGUI_PATH}/imgui_tables.cpp
${IMGUI_PATH}/imgui_widgets.cpp
${IMGUI_PATH}/backends/imgui_impl_sdl2.cpp
${IMGUI_PATH}/backends/imgui_impl_opengl3.cpp
${IMGUI_CLUB_PATH}/imgui_memory_editor/imgui_memory_editor.h
)
target_include_directories(sa2 PRIVATE
${IMGUI_PATH}
${IMGUI_PATH}/backends
${IMGUI_CLUB_PATH}/imgui_memory_editor
)
target_compile_definitions(sa2 PRIVATE
IMGUI_USER_CONFIG="frontends/sdl/imgui/imconfig.h"
)
install(TARGETS sa2
DESTINATION bin)