-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
164 lines (142 loc) · 3.77 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
# ROQUEN - First rough draft
project(CSBWin)
cmake_minimum_required(VERSION 2.4.0)
set(PACKAGE_NAME csb)
set(PACKAGE_VERSION 11.1.0)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "some-form-thread-link")
# Do not allow building at the root of the source tree.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
CMake would overwrite the files distributed with CSBWin.
Please create a directory and run cmake from there, passing the path
to this source directory as the last argument.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
Please delete them.")
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
set(CSB_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CSB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_C_FLAGS "-g -fsigned-char -O1")
set(CMAKE_CXX_FLAGS "-g -fsigned-char -O1")
set(CMAKE_LD_FLAGS -g)
if(WIN32)
MESSAGE("WIN32")
if(CYGWIN)
set(CSB_ON_WIN32 0)
set(CSB_ON_UNIX 1)
add_definitions(-D_LINUX)
MESSAGE("got here")
else(CYGWIN)
MESSAGE("got win32")
set(CSB_ON_WIN32 1)
set(CSB_ON_UNIX 0)
endif(CYGWIN)
else(WIN32)
if(UNIX)
set(CSB_ON_WIN32 0)
set(CSB_ON_UNIX 1)
add_definitions(-D_LINUX)
else(UNIX)
MESSAGE(SEND_ERROR "Unable to determine platform")
endif(UNIX)
endif(WIN32)
# BLAH --
if(MSVC)
add_definitions(-D_MSVC_INTEL -D_MIDI -D_MOVIE)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
set(PLATFORM_SRC CSBwin.cpp)
else(MSVC)
add_definitions(-D_LINUX)
if(APPLE)
set(PLATFORM_SRC MacScreen.cpp CSBMac.cpp)
else(APPLE)
set(PLATFORM_SRC LinScreen.cpp CSBlinux.cpp LinCSBUI.cpp)
endif(APPLE)
endif(MSVC)
#if(CSB_USE_SDL)
# find_path(SDL_PATH)
#endif(CSB_USE_SDL)
# NO! NO! NO! --- mucking around
if (CMAKE_COMPILER_IS_GNUCXX)
MESSAGE("GCC")
add_definitions(-D_LINUX)
endif (CMAKE_COMPILER_IS_GNUCXX)
#CSBUICE2002.cpp
#CSBWinCE2002.cpp
#WinScreenCE2002.cpp
#HintCE.cpp
#Win32_SoundMixer.cpp
# The "WIN32" thing is ignored under other OSes
add_executable(CsbWin WIN32
${PLATFORM_SRC}
AsciiDump.cpp
Attack.cpp
Bitmaps.cpp
CSBCode.cpp
CSBUI.cpp
Chaos.cpp
Character.cpp
Code11f52.cpp
Code13ea4.cpp
Code17818.cpp
Code1f9e6.cpp
Code222ea.cpp
Code390e.cpp
Code51a4.cpp
Codea59a.cpp
DSA.cpp
Graphics.cpp
Hint.cpp
Magic.cpp
Menu.cpp
Monster.cpp
Mouse.cpp
MoveObject.cpp
NewBugs.cpp
OldBugs.cpp
RC4.cpp
Recording.cpp
SaveGame.cpp
SmartDiscard.cpp
Sound.cpp
Statistics.cpp
Stdafx.cpp
Timer.cpp
Translation.cpp
VBL.cpp
Viewport.cpp
WinScreen.cpp
data.cpp
md5C.cpp
system.cpp
utility.cpp
)
if(UNIX)
FIND_PACKAGE(GTK2)
if(GTK2_FOUND)
message("GTK found")
include_directories(${GTK2_INCLUDE_DIRS})
target_link_libraries(CsbWin ${GTK2_LIBRARIES})
#add_definitions(-DUSE_OLD_GTK)
else(GTK2_FOUND)
message("no GTK")
endif(GTK2_FOUND)
FIND_PACKAGE(SDL REQUIRED)
if(SDL_FOUND)
message("SDL found")
include_directories(${SDL_INCLUDE_DIRS})
target_link_libraries(CsbWin ${SDL_LIBRARIES})
else(SDL_FOUND)
message(FATAL_ERROR "libSDL is required")
endif(SDL_FOUND)
FIND_PACKAGE(SDL_mixer)
if(SDLMIXER_FOUND)
message("SDL mixer found")
include_directories(${SDLMIXER_INCLUDE_DIR})
target_link_libraries(CsbWin ${SDLMIXER_LIBRARY})
add_definitions(-DSOUND__SDLMIXER)
endif(SDLMIXER_FOUND)
endif(UNIX)
if (CSB_ON_WIN32)
target_link_libraries(CsbWin winmm.lib)
endif(CSB_ON_WIN32)