author | unc0rr |
Thu, 17 Jan 2013 11:16:03 +0400 | |
changeset 8394 | 26f0d7ab5adf |
parent 8383 | b557c73a7593 |
child 8401 | 87410ae372f6 |
permissions | -rw-r--r-- |
555 | 1 |
# Configure for Qt4 |
6604
9cc612a24b43
this should lower compatibility with qt4.5 again, but i have no way to test it
koda
parents:
6441
diff
changeset
|
2 |
set(QT_MIN_VERSION "4.5.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 |
|
8083
2edbd01a04a0
added sdl_net headers and def lib for windows, fix frontlib compilation on windows
koda
parents:
8082
diff
changeset
|
16 |
find_package(SDL REQUIRED) #video in SDLInteraction |
2edbd01a04a0
added sdl_net headers and def lib for windows, fix frontlib compilation on windows
koda
parents:
8082
diff
changeset
|
17 |
find_package(SDL_mixer REQUIRED) #audio in SDLInteraction |
2edbd01a04a0
added sdl_net headers and def lib for windows, fix frontlib compilation on windows
koda
parents:
8082
diff
changeset
|
18 |
find_package(SDL_net REQUIRED) #network frontlib |
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
|
19 |
if(NOT NOVIDEOREC) |
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
|
20 |
find_package(FFMPEG) |
8144
f3ba33d5d2b1
Google Code-in: Hide "video record" keybind option
Mitchell Kember <mk12360@gmail.com>
parents:
8104
diff
changeset
|
21 |
if(${FFMPEG_FOUND}) |
8147
53190e590919
Use same macro for hiding video record button and keybinding
Mitchell Kember <mk12360@gmail.com>
parents:
8144
diff
changeset
|
22 |
add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS) |
8144
f3ba33d5d2b1
Google Code-in: Hide "video record" keybind option
Mitchell Kember <mk12360@gmail.com>
parents:
8104
diff
changeset
|
23 |
endif() |
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
|
24 |
endif() |
555 | 25 |
|
2239
d7b5c65f7544
move C and C++ optimization flags in the main CMakeLists.txt
koda
parents:
2230
diff
changeset
|
26 |
include_directories(.) |
6061 | 27 |
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
|
28 |
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
|
29 |
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
|
30 |
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
|
31 |
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
|
32 |
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
|
33 |
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
|
34 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform) |
707 | 35 |
include_directories(${SDL_INCLUDE_DIR}) |
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
2443
diff
changeset
|
36 |
include_directories(${SDLMIXER_INCLUDE_DIR}) |
7528
f8cf277dca36
FindFFMPEG.cmake (used only for frontend for now).
Stepan777 <stepik-777@mail.ru>
parents:
7278
diff
changeset
|
37 |
include_directories(${FFMPEG_INCLUDE_DIR}) |
7778 | 38 |
include_directories(${CMAKE_SOURCE_DIR}/misc/physfs/src) |
8052 | 39 |
include_directories(${CMAKE_SOURCE_DIR}/misc/physfs/extras) |
1159 | 40 |
if(UNIX) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
41 |
# 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
|
42 |
include_directories("/usr/local/include") |
1159 | 43 |
endif(UNIX) |
555 | 44 |
|
8335
bc948db1273a
oops, forgot that data absolute path only applies to linux
koda
parents:
8333
diff
changeset
|
45 |
#directory for resources, relative to bindir (on linux an absolute path is always used) |
8342 | 46 |
string(SUBSTRING "${SHAREPATH}" 0 1 sharepath_start) |
47 |
if(APPLE OR WIN32 OR ${sharepath_start} MATCHES "/") |
|
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
|
48 |
set(HEDGEWARS_DATADIR ${SHAREPATH}) |
2652 | 49 |
else() |
8333
416cb5e5a405
move DATA_INSTALL_DIR to the configurable options section
koda
parents:
8323
diff
changeset
|
50 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/${SHAREPATH}) |
2663 | 51 |
endif() |
184 | 52 |
|
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
|
53 |
#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
|
54 |
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
|
55 |
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
|
56 |
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
|
57 |
#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
|
58 |
|
2219
07f5345ecae7
additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
2218
diff
changeset
|
59 |
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 60 |
|
6061 | 61 |
file(GLOB NetCpp net/*.cpp) |
62 |
file(GLOB ModelCpp model/*.cpp) |
|
63 |
file(GLOB_RECURSE UIcpp ui/*.cpp) |
|
64 |
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
|
65 |
|
8347 | 66 |
list(APPEND hwfr_src |
6061 | 67 |
${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
|
68 |
${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
|
69 |
${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
|
70 |
${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
|
71 |
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
|
72 |
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
|
73 |
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
|
74 |
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
|
75 |
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
|
76 |
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
|
77 |
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
|
78 |
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
|
79 |
team.cpp |
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
6931
diff
changeset
|
80 |
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
|
81 |
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
|
82 |
${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
|
83 |
) |
184 | 84 |
|
2821 | 85 |
#xfire integration |
86 |
if(WIN32) |
|
8381
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
87 |
list(APPEND hwfr_src util/platform/xfire.cpp util/platform/xfiregameclient.cpp) |
2821 | 88 |
endif(WIN32) |
89 |
||
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
90 |
if(MINGW) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
91 |
# 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
|
92 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
8283 | 93 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
94 |
-i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
|
95 |
-o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
|
8347 | 96 |
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
|
97 |
else(MINGW) |
8347 | 98 |
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
|
99 |
endif(MINGW) |
184 | 100 |
|
6061 | 101 |
file(GLOB ModelHdr model/*.h) |
102 |
file(GLOB NetHdr net/*.h) |
|
103 |
file(GLOB_RECURSE UIhdr ui/*.h) |
|
104 |
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
|
105 |
|
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
|
106 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
107 |
set(hwfr_moc_hdrs |
6061 | 108 |
${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
|
109 |
${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
|
110 |
${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
|
111 |
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
|
112 |
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
|
113 |
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
|
114 |
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
|
115 |
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
|
116 |
team.h |
6931
86c951cd0f3f
make DataManager a QObject with reload() slot that emits signal updated()
sheepluva
parents:
6604
diff
changeset
|
117 |
util/DataManager.h |
7897 | 118 |
util/LibavInteraction.h |
8383 | 119 |
util/MessageDialog.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
120 |
) |
184 | 121 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
122 |
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
|
123 |
${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
|
124 |
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
|
125 |
achievements.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
126 |
binds.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
127 |
ui_hwform.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
128 |
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
|
129 |
sdlkeys.h |
7639 | 130 |
campaign.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
131 |
) |
184 | 132 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
133 |
set(hwfr_rez hedgewars.qrc) |
184 | 134 |
|
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
|
135 |
if(${BUILD_ENGINE_LIBRARY}) |
8314
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
136 |
add_definitions(-DHWLIBRARY=1) |
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
137 |
set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
8347 | 138 |
list(APPEND HW_LINK_LIBS ${hwlibname}) |
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
|
139 |
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
|
140 |
|
2641 | 141 |
qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
184 | 142 |
|
2641 | 143 |
qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
184 | 144 |
|
2652 | 145 |
|
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
146 |
if(APPLE) |
8279
c03d64969112
less linking needed, raise minimum_osx_version when videorec is enabled
koda
parents:
8223
diff
changeset
|
147 |
find_library(iokit_framework NAMES IOKit) |
8347 | 148 |
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
|
149 |
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
|
150 |
util/platform/InstallController.cpp |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
151 |
util/platform/M3Panel.mm |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
152 |
util/platform/M3InstallController.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
153 |
util/platform/NSWorkspace_RBAdditions.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
154 |
) |
4775 | 155 |
if(NOT NOAUTOUPDATE) |
156 |
find_package(Sparkle) |
|
157 |
if(SPARKLE_FOUND) |
|
158 |
add_definitions(-DSPARKLE_ENABLED) |
|
8381
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
159 |
list(APPEND hwfr_src util/platform/AutoUpdater.cpp |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
160 |
util/platform/SparkleAutoUpdater.mm) |
8347 | 161 |
list(APPEND HW_LINK_LIBS ${SPARKLE_LIBRARY}) |
4775 | 162 |
endif() |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
163 |
endif() |
2652 | 164 |
endif() |
165 |
||
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
166 |
#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
|
167 |
#TODO: check it doesn't interfere on UNIX |
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
168 |
if(CMAKE_BUILD_TYPE MATCHES "RELEASE") |
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
169 |
set(console_access "WIN32") |
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
170 |
endif(CMAKE_BUILD_TYPE MATCHES "RELEASE") |
2652 | 171 |
|
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
172 |
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
|
173 |
${hwfr_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
174 |
${hwfr_moc_srcs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
175 |
${hwfr_hdrs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
176 |
${hwfr_rez_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
177 |
) |
2191 | 178 |
|
8315
b3875e10a8ae
edit rpath manually, allowing frontend+libengine to run on linux too
koda
parents:
8314
diff
changeset
|
179 |
if((UNIX AND NOT APPLE) AND ${BUILD_ENGINE_LIBRARY}) |
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
|
180 |
set_target_properties(hedgewars PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}") |
8315
b3875e10a8ae
edit rpath manually, allowing frontend+libengine to run on linux too
koda
parents:
8314
diff
changeset
|
181 |
endif() |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
182 |
|
8347 | 183 |
list(APPEND HW_LINK_LIBS |
7778 | 184 |
physfs |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
185 |
${QT_LIBRARIES} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
186 |
${SDL_LIBRARY} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
187 |
${SDLMIXER_LIBRARY} |
7528
f8cf277dca36
FindFFMPEG.cmake (used only for frontend for now).
Stepan777 <stepik-777@mail.ru>
parents:
7278
diff
changeset
|
188 |
${FFMPEG_LIBRARIES} |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
189 |
) |
184 | 190 |
|
191 |
if(WIN32 AND NOT UNIX) |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
192 |
if(NOT SDL_LIBRARY) |
8347 | 193 |
list(APPEND HW_LINK_LIBS SDL) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
194 |
endif() |
555 | 195 |
|
8347 | 196 |
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
|
197 |
ole32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
198 |
oleaut32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
199 |
winspool |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
200 |
uuid |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
201 |
) |
2663 | 202 |
endif() |
184 | 203 |
|
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
204 |
target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
205 |
|
495 | 206 |
|
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
|
207 |
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
|
208 |