-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathCMakeLists.txt
89 lines (70 loc) · 2.11 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
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0025 NEW)
project(LA140_emulator)
set(CMAKE_SUPPRESS_REGENERATION true)
set (CMAKE_CXX_STANDARD 17)
# call "brew install sdl2"
if (ARM)
include_directories("../os_library/include")
endif()
if (DESKTOP)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
include_directories("include/")
file(GLOB main_src
"source/sdlmain.cpp"
"include/library.h"
)
file(GLOB bios_src
"source/bios/*.cpp"
"source/bios/*.h"
)
file(GLOB framework_src
"source/framework/*.cpp"
"source/framework/*.h"
)
file(GLOB gui_src
"source/gui/*.cpp"
"source/gui/*.h"
)
endif()
if (ARM)
file(GLOB main_src
"../os_host/source/framework/Wnd.cpp"
)
file(GLOB linker_script
"../apps/test36_esp_server/app.lds"
)
endif()
file(GLOB application_src
"../apps/test36_esp_server/*.cpp"
"../apps/test36_esp_server/*.h"
)
#file(GLOB application_graph_src
# "../apps/test34_scope/graph/*.cpp"
# "../apps/test34_scope/graph/*.h"
#)
#file(GLOB application_sensor_src
# "../apps/test34_scope/sensor/*.cpp"
# "../apps/test34_scope/sensor/*.h"
#)
if (DESKTOP)
source_group("source\\main" FILES "source/sdlmain.cpp")
source_group("source\\bios" FILES ${bios_src})
source_group("source\\framework" FILES ${framework_src})
source_group("source\\gui" FILES ${gui_src})
endif()
source_group("application" FILES ${application_src})
source_group("application\\graph" FILES ${application_graph_src})
source_group("application\\sensor" FILES ${application_sensor_src})
source_group("include" FILES "include/library.h")
add_executable(application ${main_src} ${bios_src} ${framework_src} ${gui_src} ${application_src} ${application_graph_src} ${application_sensor_src})
if (ARM)
target_link_libraries(application m)
target_link_libraries(application bios)
set_target_properties(application PROPERTIES LINK_DEPENDS ${linker_script})
set_target_properties(application PROPERTIES LINK_FLAGS "-T ${linker_script}")
endif()
target_link_libraries(application ${SDL2_LIBRARIES})
install(TARGETS application DESTINATION bin)