forked from skmp/nullDCe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
202 lines (103 loc) · 2.74 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
##
## NullDCe cmake script, top level
#
PROJECT( NDCE )
cmake_minimum_required(VERSION 2.6)
## Build Options ##
# Target Specifics #
OPTION(_X86 "Build for CPU:X86 PC" OFF)
OPTION(_X64 "Build for CPU:X64 PC" OFF)
OPTION(_ARM "Build for CPU:ARM" OFF)
OPTION(_PPC "Build for CPU:PPC" OFF)
OPTION(_MIPS "Build for CPU:MIPS" OFF)
if(_X86)
set(HOST_CPU _X86)
endif(_X86)
if(_X64)
set(HOST_CPU _X64)
endif(_X64)
if(_ARM)
set(HOST_CPU _ARM)
endif(_ARM)
if(_PPC)
set(HOST_CPU _PPC)
endif(_PPC)
if(_MIPS)
set(HOST_CPU _MIPS)
endif(_MIPS)
OPTION(_LINUX "Build for OS:Linux" OFF)
OPTION(_DARWIN "Build for OS:Darwin" OFF)
OPTION(_WINDOWS "Build for OS:Windows" OFF)
OPTION(_WII "Build for OS:WII (Requires _PPC)" OFF)
OPTION(_PSP "Build for OS:PSP (Requires _MIPS)" OFF)
if(_LINUX)
set(HOST_OS _LINUX)
endif(_LINUX)
if(_DARWIN)
set(HOST_OS _DARWIN)
endif(_DARWIN)
if(_WINDOWS)
set(HOST_OS _WINDOWS)
endif(_WINDOWS)
if(_WII)
set(HOST_OS _WII)
endif(_WII)
if(_PSP)
set(HOST_OS _PSP)
endif(_PSP)
if(NOT DEFINED HOST_CPU)
set(HOST_CPU _X86)
endif(NOT DEFINED HOST_CPU)
if(NOT DEFINED HOST_OS)
set(HOST_OS _WINDOWS)
endif(NOT DEFINED HOST_OS)
MACRO(SRC_DIR SDIR)
FILE(GLOB_RECURSE inFiles RELATIVE
"${CMAKE_CURRENT_SOURCE_DIR}/${SDIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/${SDIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/${SDIR}/*.cpp"
)
FOREACH(infileName ${inFiles})
# MESSAGE(STATUS "Process file: ${SDIR}/${infileName}")
SET(NDCE_SRCS ${NDCE_SRCS} "${SDIR}/${infileName}")
ENDFOREACH(infileName)
ENDMACRO(SRC_DIR SDIR)
# Non-Recurse, we want to be able to separate so we'll use add_subdir (or not)
FILE(GLOB inFiles RELATIVE
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)
SET(NDCE_SRCS ${inFiles})
# Platform independant base #
SRC_DIR(dc)
SRC_DIR(naomi)
SRC_DIR(cl)
SRC_DIR(gui)
SRC_DIR(config)
SRC_DIR(plugins)
SRC_DIR(profiler)
SRC_DIR(serial_ipc)
# TODO Change to MAKE_LIBRARY macro for platforms
SRC_DIR(plugs)
IF(_PSP)
SRC_DIR(psp)
SRC_DIR(dvemgr)
ENDIF(_PSP)
IF(_LINUX)
SRC_DIR(linux)
ENDIF(_LINUX)
IF(_ARM)
SRC_DIR(rec-ARM)
#ADD_LIBRARY(rec-ARM)
ENDIF(_ARM)
IF(_X86)
SRC_DIR(win-x86)
#ADD_LIBRARY(win-x86)
ENDIF(_X86)
# The actual host generation #
set(CMAKE_VERBOSE_MAKEFILE ON)
add_definitions(-D${HOST_OS} -D${HOST_CPU})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
MESSAGE(STATUS "Building NullDCe for: ${HOST_OS}-${HOST_CPU}")
ADD_EXECUTABLE(ndce ${NDCE_SRCS})