author | Wuzzy <almikes@aol.com> |
Thu, 27 Apr 2017 21:00:28 +0200 | |
changeset 12361 | 05fe955e2763 |
parent 11851 | 5edd66c2d422 |
child 12386 | e4f8bf43224d |
permissions | -rw-r--r-- |
555 | 1 |
# Configure for Qt4 |
10489 | 2 |
set(QT_MIN_VERSION "4.7.0") |
6032 | 3 |
include(CheckLibraryExists) |
260 | 4 |
|
502
bc178daca088
Fix build with CMake & gcc 4.1.2 on my system (treating #include <QtGui> as including directory)
unc0rr
parents:
495
diff
changeset
|
5 |
set(QT_USE_QTCORE TRUE) |
bc178daca088
Fix build with CMake & gcc 4.1.2 on my system (treating #include <QtGui> as including directory)
unc0rr
parents:
495
diff
changeset
|
6 |
set(QT_USE_QTGUI TRUE) |
494 | 7 |
set(QT_USE_QTNETWORK TRUE) |
2525 | 8 |
set(QT_USE_QTSVG FALSE) |
2428 | 9 |
set(QT_USE_QTXML FALSE) |
10 |
set(QT_USE_QTOPENGL FALSE) |
|
494 | 11 |
set(QT_USE_QTMAIN TRUE) |
12 |
||
184 | 13 |
find_package(Qt4 REQUIRED) |
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
14 |
include(${QT_USE_FILE}) |
184 | 15 |
|
10385
15eda15df81c
add bug reference to explain the qt version check on osx
vittorio.giovara@gmail.com
parents:
10384
diff
changeset
|
16 |
# https://bugreports.qt-project.org/browse/QTBUG-17333 |
9519 | 17 |
if(APPLE AND |
18 |
${QTVERSION} VERSION_GREATER "4.7.0" AND |
|
19 |
${QTVERSION} VERSION_LESS "4.7.4") |
|
10109 | 20 |
message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version") |
9519 | 21 |
endif() |
22 |
||
11360 | 23 |
find_package(SDL2 REQUIRED) |
24 |
find_package(SDL2_mixer REQUIRED) #audio in SDLInteraction |
|
25 |
include_directories(${SDL2_INCLUDE_DIR}) |
|
26 |
include_directories(${SDL2MIXER_INCLUDE_DIR}) |
|
8666
1652c1d9adc8
rework ffmpeg/libav/videorec linking and their cmake discovery
koda
parents:
8659
diff
changeset
|
27 |
|
9959 | 28 |
if(LIBAV_FOUND) |
8666
1652c1d9adc8
rework ffmpeg/libav/videorec linking and their cmake discovery
koda
parents:
8659
diff
changeset
|
29 |
add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS) |
9959 | 30 |
include_directories(${LIBAV_INCLUDE_DIR}) |
31 |
list(APPEND HW_LINK_LIBS ${LIBAV_LIBRARIES}) |
|
7817
6cc558a69b58
countless small optimisation for cmake, output messages are now coherent (mostly) and the options get fully respected (eg. skipping library search if not activated)
koda
parents:
7813
diff
changeset
|
32 |
endif() |
555 | 33 |
|
8401
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
34 |
# server messages localization |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
35 |
file(GLOB ServerSources ${CMAKE_SOURCE_DIR}/gameServer/*.hs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
36 |
foreach(hsfile ${ServerSources}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
37 |
file(READ ${hsfile} hs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
38 |
string(REGEX MATCHALL "loc *\"[^\n\"]+\"" locs ${hs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
39 |
foreach(str ${locs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
40 |
string(REGEX REPLACE "loc *\"([^\n\"]+)\"" "QT_TRANSLATE_NOOP(\"server\", \"\\1\")" s ${str}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
41 |
list(APPEND serverlocs ${s}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
42 |
endforeach(str) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
43 |
endforeach(hsfile) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
44 |
|
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
45 |
list(REMOVE_DUPLICATES serverlocs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
46 |
list(GET serverlocs 0 firstline) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
47 |
list(REMOVE_AT serverlocs 0) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
48 |
set(locsout "const char * serverMessages[] = {\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
49 |
foreach(l ${serverlocs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
50 |
list(APPEND locsout ${l} ",\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
51 |
endforeach(l) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
52 |
list(APPEND locsout ${firstline} "\n}\\;\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
53 |
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h ${locsout}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
54 |
|
8410 | 55 |
include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
56 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
|
6061 | 57 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/model) |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
58 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/net) |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
59 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui) |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
60 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/dialog) |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
61 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/page) |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
62 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget) |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
63 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util) |
8381
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
64 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform) |
9801
8fb7737fbd31
Move physfs includes before all others
Dmitry Marakasov <amdmi3@amdmi3.ru>
parents:
9650
diff
changeset
|
65 |
include_directories(BEFORE ${PHYSFS_INCLUDE_DIR}) |
8fb7737fbd31
Move physfs includes before all others
Dmitry Marakasov <amdmi3@amdmi3.ru>
parents:
9650
diff
changeset
|
66 |
include_directories(BEFORE ${PHYSLAYER_INCLUDE_DIR}) |
9952
32f5982604f4
Fix build (no idea what's going on in this branch btw)
unc0rr
parents:
9950
diff
changeset
|
67 |
include_directories(${LUA_INCLUDE_DIR}) #brought by physlayer hwpacksmounter.h |
8522 | 68 |
|
1159 | 69 |
if(UNIX) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
70 |
# HACK: in freebsd cannot find iconv.h included via SDL.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
71 |
include_directories("/usr/local/include") |
1159 | 72 |
endif(UNIX) |
555 | 73 |
|
8316
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
74 |
#only the cocoa version of qt supports building 64 bit apps |
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
75 |
if(APPLE AND (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64*") AND (NOT QT_MAC_USE_COCOA)) |
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
76 |
message(FATAL_ERROR "Building the 64 bit version of Hedgewars *requires* the Cocoa variant of QT on Mac OS X") |
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
77 |
endif() |
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
78 |
#endif() |
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
79 |
|
2219
07f5345ecae7
additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
2218
diff
changeset
|
80 |
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 81 |
|
6061 | 82 |
file(GLOB NetCpp net/*.cpp) |
83 |
file(GLOB ModelCpp model/*.cpp) |
|
84 |
file(GLOB_RECURSE UIcpp ui/*.cpp) |
|
85 |
file(GLOB UtilCpp util/*.cpp) |
|
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
86 |
|
8347 | 87 |
list(APPEND hwfr_src |
6061 | 88 |
${ModelCpp} |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
89 |
${NetCpp} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
90 |
${UIcpp} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
91 |
${UtilCpp} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
92 |
achievements.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
93 |
binds.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
94 |
drawmapscene.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
95 |
game.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
96 |
gameuiconfig.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
97 |
HWApplication.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
98 |
hwform.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
99 |
main.cpp |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
100 |
team.cpp |
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
6931
diff
changeset
|
101 |
campaign.cpp |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
102 |
ui_hwform.cpp |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
103 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
104 |
) |
184 | 105 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
106 |
if(MINGW) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
107 |
# resource compilation for mingw |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
108 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
8283 | 109 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
110 |
-i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
|
111 |
-o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
|
8347 | 112 |
list(APPEND hwfr_src ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
113 |
else(MINGW) |
8347 | 114 |
list(APPEND hwfr_src hedgewars.rc) |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
115 |
endif(MINGW) |
184 | 116 |
|
6061 | 117 |
file(GLOB ModelHdr model/*.h) |
118 |
file(GLOB NetHdr net/*.h) |
|
119 |
file(GLOB_RECURSE UIhdr ui/*.h) |
|
120 |
file(GLOB UtilHdr util/*.h) |
|
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
121 |
|
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
122 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
123 |
set(hwfr_moc_hdrs |
6061 | 124 |
${ModelHdr} |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
125 |
${NetHdr} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
126 |
${UIhdr} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
127 |
drawmapscene.h |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
128 |
game.h |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
129 |
gameuiconfig.h |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
130 |
HWApplication.h |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
131 |
hwform.h |
6223
cc3eb9b7230f
It doesn't make much sense to make checks like 'if(game)' if you never set game to 0. Using smart pointers instead. Does it fix segfaults? Probably.
unc0rr
parents:
6204
diff
changeset
|
132 |
team.h |
6931
86c951cd0f3f
make DataManager a QObject with reload() slot that emits signal updated()
sheepluva
parents:
6604
diff
changeset
|
133 |
util/DataManager.h |
7897 | 134 |
util/LibavInteraction.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
135 |
) |
184 | 136 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
137 |
set(hwfr_hdrs |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
138 |
${UtilHdr} |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
139 |
team.h |
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
140 |
achievements.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
141 |
binds.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
142 |
ui_hwform.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
143 |
hwconsts.h |
6060
fdfc01419815
I started to move stuff around, c'mon, hate on meee. PS: if your (clean) build is broken - let me know)
sheepluva
parents:
6038
diff
changeset
|
144 |
sdlkeys.h |
7639 | 145 |
campaign.h |
8401
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
146 |
${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
147 |
) |
184 | 148 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
149 |
set(hwfr_rez hedgewars.qrc) |
184 | 150 |
|
9961 | 151 |
if(BUILD_ENGINE_LIBRARY) |
8314
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
152 |
add_definitions(-DHWLIBRARY=1) |
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
153 |
set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
8347 | 154 |
list(APPEND HW_LINK_LIBS ${hwlibname}) |
10173 | 155 |
|
156 |
if(LIBAV_FOUND) |
|
157 |
# add_subdirectory(avwrapper) |
|
158 |
list(APPEND HW_LINK_LIBS avwrapper) |
|
159 |
endif() |
|
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8283
diff
changeset
|
160 |
endif() |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8283
diff
changeset
|
161 |
|
2641 | 162 |
qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
184 | 163 |
|
2641 | 164 |
qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
184 | 165 |
|
2652 | 166 |
|
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
167 |
if(APPLE) |
8279
c03d64969112
less linking needed, raise minimum_osx_version when videorec is enabled
koda
parents:
8223
diff
changeset
|
168 |
find_library(iokit_framework NAMES IOKit) |
8347 | 169 |
list(APPEND HW_LINK_LIBS ${iokit_framework}) |
8381
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
170 |
list(APPEND hwfr_src util/platform/CocoaInitializer.mm |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
171 |
util/platform/InstallController.cpp |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
172 |
util/platform/M3Panel.mm |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
173 |
util/platform/M3InstallController.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
174 |
util/platform/NSWorkspace_RBAdditions.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
175 |
) |
8688 | 176 |
include(${CMAKE_MODULE_PATH}/utils.cmake) |
177 |
find_package_or_disable_msg(Sparkle NOAUTOUPDATE "Autoupdater will not be built.") |
|
178 |
if(SPARKLE_FOUND) |
|
8686
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
179 |
add_definitions(-DSPARKLE_ENABLED) |
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
180 |
list(APPEND hwfr_src util/platform/AutoUpdater.cpp |
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
181 |
util/platform/SparkleAutoUpdater.mm) |
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
182 |
list(APPEND HW_LINK_LIBS ${SPARKLE_LIBRARY}) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
183 |
endif() |
2652 | 184 |
endif() |
185 |
||
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
186 |
#when debugging, always prompt a console to see fronted messages |
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
187 |
#TODO: check it doesn't interfere on UNIX |
10783
8e742c9ffdf8
Add RelWithDebInfo for debugging purposes
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
parents:
10489
diff
changeset
|
188 |
if(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO") |
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
189 |
set(console_access "WIN32") |
10783
8e742c9ffdf8
Add RelWithDebInfo for debugging purposes
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
parents:
10489
diff
changeset
|
190 |
endif(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO") |
2652 | 191 |
|
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
192 |
add_executable(hedgewars ${console_access} |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
193 |
${hwfr_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
194 |
${hwfr_moc_srcs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
195 |
${hwfr_hdrs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
196 |
${hwfr_rez_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
197 |
) |
2191 | 198 |
|
8347 | 199 |
list(APPEND HW_LINK_LIBS |
9225
d8d929f92633
use target name instead of the resulting library, use more macros around
koda
parents:
9198
diff
changeset
|
200 |
physfs physlayer |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
201 |
${QT_LIBRARIES} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
202 |
) |
184 | 203 |
|
11360 | 204 |
list(APPEND HW_LINK_LIBS |
205 |
${SDL2_LIBRARY} |
|
206 |
${SDL2MIXER_LIBRARY} |
|
207 |
) |
|
10173 | 208 |
|
184 | 209 |
if(WIN32 AND NOT UNIX) |
11368
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
11362
diff
changeset
|
210 |
if(NOT SDL2_LIBRARY) |
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
11362
diff
changeset
|
211 |
list(APPEND HW_LINK_LIBS SDL2) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
212 |
endif() |
555 | 213 |
|
8347 | 214 |
list(APPEND HW_LINK_LIBS |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
215 |
ole32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
216 |
oleaut32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
217 |
winspool |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
218 |
uuid |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
219 |
) |
2663 | 220 |
endif() |
184 | 221 |
|
9270 | 222 |
if(CMAKE_CXX_COMPILER MATCHES "clang*") |
9984
84835d0ceb64
Fixed build failure to a missing math library linked with BUILD_ENGINE_C=1 and clang
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
parents:
9952
diff
changeset
|
223 |
list(APPEND HW_LINK_LIBS stdc++ m) |
9270 | 224 |
endif() |
225 |
||
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
226 |
target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
227 |
|
495 | 228 |
|
8316
89232b2fa1d6
cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents:
8315
diff
changeset
|
229 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir}) |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
230 |