author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 11 Jul 2019 16:24:09 +0200 | |
changeset 15252 | c10e9261ab9c |
parent 14980 | 5cd4edd71d22 |
child 15474 | 6e09555b25b4 |
permissions | -rw-r--r-- |
13299
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
1 |
if(APPLE AND EXISTS /usr/local/opt/qt5) |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
2 |
# Special treatment for OS X users who |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
3 |
# install Qt5 via Homebrew. |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
4 |
# Homebrew installs Qt5 (up to at least 5.9.1) in |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
5 |
# /usr/local/qt5, ensure it can be found by CMake since |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
6 |
# it is not in the default /usr/local prefix. |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
7 |
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5") |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
8 |
endif() |
6fda879d5052
CMake: Make sure Qt5 is also found on OS X after installing it via Homebrew
Wuzzy <Wuzzy2@mail.ru>
parents:
13222
diff
changeset
|
9 |
|
13222
d6364e31f9c9
Drop Qt XML from dependencies. QXmlStreamReader is part of QtCore
Wuzzy <Wuzzy2@mail.ru>
parents:
13221
diff
changeset
|
10 |
find_package(Qt5 COMPONENTS Core Widgets Gui Network) |
260 | 11 |
|
12897
fc47fc4af6bd
Finish porting. Seems to work, but no thorough testing has been performed
unc0rr
parents:
12896
diff
changeset
|
12 |
include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS}) |
fc47fc4af6bd
Finish porting. Seems to work, but no thorough testing has been performed
unc0rr
parents:
12896
diff
changeset
|
13 |
|
12896 | 14 |
include(CheckLibraryExists) |
9519 | 15 |
|
11360 | 16 |
find_package(SDL2 REQUIRED) |
12386 | 17 |
find_package(SDL2_mixer 2 REQUIRED) #audio in SDLInteraction |
11360 | 18 |
include_directories(${SDL2_INCLUDE_DIR}) |
12386 | 19 |
include_directories(${SDL2_MIXER_INCLUDE_DIRS}) |
8666
1652c1d9adc8
rework ffmpeg/libav/videorec linking and their cmake discovery
koda
parents:
8659
diff
changeset
|
20 |
|
9959 | 21 |
if(LIBAV_FOUND) |
8666
1652c1d9adc8
rework ffmpeg/libav/videorec linking and their cmake discovery
koda
parents:
8659
diff
changeset
|
22 |
add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS) |
9959 | 23 |
include_directories(${LIBAV_INCLUDE_DIR}) |
24 |
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
|
25 |
endif() |
555 | 26 |
|
8401
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
27 |
# server messages localization |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
28 |
file(GLOB ServerSources ${CMAKE_SOURCE_DIR}/gameServer/*.hs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
29 |
foreach(hsfile ${ServerSources}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
30 |
file(READ ${hsfile} hs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
31 |
string(REGEX MATCHALL "loc *\"[^\n\"]+\"" locs ${hs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
32 |
foreach(str ${locs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
33 |
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
|
34 |
list(APPEND serverlocs ${s}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
35 |
endforeach(str) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
36 |
endforeach(hsfile) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
37 |
|
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
38 |
list(REMOVE_DUPLICATES serverlocs) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
39 |
list(GET serverlocs 0 firstline) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
40 |
list(REMOVE_AT serverlocs 0) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
41 |
set(locsout "const char * serverMessages[] = {\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
42 |
foreach(l ${serverlocs}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
43 |
list(APPEND locsout ${l} ",\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
44 |
endforeach(l) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
45 |
list(APPEND locsout ${firstline} "\n}\\;\n") |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
46 |
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h ${locsout}) |
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
47 |
|
14449
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
48 |
|
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
49 |
# Credits localization |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
50 |
file(GLOB CreditsCSV ${CMAKE_SOURCE_DIR}/QTfrontend/res/credits.csv) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
51 |
foreach(csvfile ${CreditsCSV}) |
14518
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
52 |
# Load credits.csv |
14449
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
53 |
file(READ ${csvfile} csv) |
14518
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
54 |
|
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
55 |
# Match first line of CSV file |
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
56 |
string(REGEX MATCH "(E|S|U),\"[^\n\"]+\"" loc_top ${csv}) |
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
57 |
string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "\nQT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${loc_top}) |
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
58 |
list(APPEND csvlocs ${s}) |
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
59 |
|
34fd1f32f440
Localization: Also collect first line of credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14483
diff
changeset
|
60 |
# Match remaining lines of CSV file |
14450
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14449
diff
changeset
|
61 |
string(REGEX MATCHALL "\n(E|S|U),\"[^\n\"]+\"" locs ${csv}) |
14449
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
62 |
foreach(str ${locs}) |
14450
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14449
diff
changeset
|
63 |
string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "QT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${str}) |
14449
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
64 |
list(APPEND csvlocs ${s}) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
65 |
endforeach(str) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
66 |
endforeach(csvfile) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
67 |
|
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
68 |
list(REMOVE_DUPLICATES csvlocs) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
69 |
list(GET csvlocs 0 firstline) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
70 |
list(REMOVE_AT csvlocs 0) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
71 |
set(locsout "const char * creditsMessages[] = {") |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
72 |
foreach(l ${csvlocs}) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
73 |
list(APPEND locsout ${l} ",") |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
74 |
endforeach(l) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
75 |
list(APPEND locsout ${firstline} "\n}\\;\n") |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
76 |
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/creditsmessages.h ${locsout}) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
77 |
|
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14291
diff
changeset
|
78 |
|
8410 | 79 |
include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
80 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
|
6061 | 81 |
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
|
82 |
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
|
83 |
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
|
84 |
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
|
85 |
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
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
include_directories(BEFORE ${PHYSFS_INCLUDE_DIR}) |
8fb7737fbd31
Move physfs includes before all others
Dmitry Marakasov <amdmi3@amdmi3.ru>
parents:
9650
diff
changeset
|
90 |
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
|
91 |
include_directories(${LUA_INCLUDE_DIR}) #brought by physlayer hwpacksmounter.h |
8522 | 92 |
|
1159 | 93 |
if(UNIX) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
94 |
# 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
|
95 |
include_directories("/usr/local/include") |
1159 | 96 |
endif(UNIX) |
555 | 97 |
|
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
|
98 |
#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
|
99 |
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
|
100 |
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
|
101 |
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
|
102 |
#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
|
103 |
|
2219
07f5345ecae7
additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
2218
diff
changeset
|
104 |
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 105 |
|
6061 | 106 |
file(GLOB NetCpp net/*.cpp) |
107 |
file(GLOB ModelCpp model/*.cpp) |
|
108 |
file(GLOB_RECURSE UIcpp ui/*.cpp) |
|
109 |
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
|
110 |
|
8347 | 111 |
list(APPEND hwfr_src |
6061 | 112 |
${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
|
113 |
${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
|
114 |
${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
|
115 |
${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
|
116 |
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
|
117 |
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
|
118 |
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
|
119 |
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
|
120 |
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
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
team.cpp |
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
6931
diff
changeset
|
125 |
campaign.cpp |
14483
4c743ef80b1b
Add team selection in training page and basic check mark support
Wuzzy <Wuzzy2@mail.ru>
parents:
14450
diff
changeset
|
126 |
mission.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
|
127 |
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
|
128 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
13565
730e7837d9df
sdlkeys is in source not binary, no .in folder. Locutus brought to our attention.
nemo
parents:
13542
diff
changeset
|
129 |
${CMAKE_CURRENT_SOURCE_DIR}/sdlkeys.cpp |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
130 |
) |
184 | 131 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
132 |
if(MINGW) |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
133 |
# 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
|
134 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
8283 | 135 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
136 |
-i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
|
137 |
-o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
|
8347 | 138 |
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
|
139 |
else(MINGW) |
8347 | 140 |
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
|
141 |
endif(MINGW) |
184 | 142 |
|
6061 | 143 |
file(GLOB ModelHdr model/*.h) |
144 |
file(GLOB NetHdr net/*.h) |
|
145 |
file(GLOB_RECURSE UIhdr ui/*.h) |
|
146 |
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
|
147 |
|
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
|
148 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
149 |
set(hwfr_moc_hdrs |
6061 | 150 |
${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
|
151 |
${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
|
152 |
${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
|
153 |
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
|
154 |
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
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
team.h |
6931
86c951cd0f3f
make DataManager a QObject with reload() slot that emits signal updated()
sheepluva
parents:
6604
diff
changeset
|
159 |
util/DataManager.h |
7897 | 160 |
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
|
161 |
) |
184 | 162 |
|
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
163 |
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
|
164 |
${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
|
165 |
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
|
166 |
achievements.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
167 |
binds.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
168 |
ui_hwform.h |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
169 |
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
|
170 |
sdlkeys.h |
7639 | 171 |
campaign.h |
14483
4c743ef80b1b
Add team selection in training page and basic check mark support
Wuzzy <Wuzzy2@mail.ru>
parents:
14450
diff
changeset
|
172 |
mission.h |
8401
87410ae372f6
Server messages localization using Qt's l10n subsystem:
unc0rr
parents:
8383
diff
changeset
|
173 |
${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
14483
4c743ef80b1b
Add team selection in training page and basic check mark support
Wuzzy <Wuzzy2@mail.ru>
parents:
14450
diff
changeset
|
174 |
${CMAKE_CURRENT_BINARY_DIR}/creditsmessages.h |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
175 |
) |
184 | 176 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
177 |
set(hwfr_rez hedgewars.qrc) |
184 | 178 |
|
9961 | 179 |
if(BUILD_ENGINE_LIBRARY) |
8314
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
180 |
add_definitions(-DHWLIBRARY=1) |
7faceaca67d4
can change library name and compile it on windows again
koda
parents:
8312
diff
changeset
|
181 |
set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
8347 | 182 |
list(APPEND HW_LINK_LIBS ${hwlibname}) |
10173 | 183 |
|
184 |
if(LIBAV_FOUND) |
|
185 |
# add_subdirectory(avwrapper) |
|
186 |
list(APPEND HW_LINK_LIBS avwrapper) |
|
187 |
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
|
188 |
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
|
189 |
|
12896 | 190 |
qt5_add_resources(hwfr_rez_src ${hwfr_rez}) |
184 | 191 |
|
12896 | 192 |
qt5_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
184 | 193 |
|
2652 | 194 |
|
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
195 |
if(APPLE) |
8279
c03d64969112
less linking needed, raise minimum_osx_version when videorec is enabled
koda
parents:
8223
diff
changeset
|
196 |
find_library(iokit_framework NAMES IOKit) |
8347 | 197 |
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
|
198 |
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
|
199 |
util/platform/InstallController.cpp |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
200 |
util/platform/M3Panel.mm |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
201 |
util/platform/M3InstallController.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
202 |
util/platform/NSWorkspace_RBAdditions.m |
588a8e6e2041
move platform code around, based off a gci task by dag10
koda
parents:
8347
diff
changeset
|
203 |
) |
8688 | 204 |
include(${CMAKE_MODULE_PATH}/utils.cmake) |
205 |
find_package_or_disable_msg(Sparkle NOAUTOUPDATE "Autoupdater will not be built.") |
|
206 |
if(SPARKLE_FOUND) |
|
8686
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
207 |
add_definitions(-DSPARKLE_ENABLED) |
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
208 |
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
|
209 |
util/platform/SparkleAutoUpdater.mm) |
d303da4568b7
introduce find_package_or_fail/disable to group together similar cmake code
koda
parents:
8666
diff
changeset
|
210 |
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
|
211 |
endif() |
2652 | 212 |
endif() |
213 |
||
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
214 |
#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
|
215 |
#TODO: check it doesn't interfere on UNIX |
10783
8e742c9ffdf8
Add RelWithDebInfo for debugging purposes
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
parents:
10489
diff
changeset
|
216 |
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
|
217 |
set(console_access "WIN32") |
10783
8e742c9ffdf8
Add RelWithDebInfo for debugging purposes
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
parents:
10489
diff
changeset
|
218 |
endif(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO") |
2652 | 219 |
|
8104
09c38cdf380d
show console on win when debugging to see frontend messages
koda
parents:
8083
diff
changeset
|
220 |
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
|
221 |
${hwfr_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
222 |
${hwfr_moc_srcs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
223 |
${hwfr_hdrs} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
224 |
${hwfr_rez_src} |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
225 |
) |
2191 | 226 |
|
8347 | 227 |
list(APPEND HW_LINK_LIBS |
9225
d8d929f92633
use target name instead of the resulting library, use more macros around
koda
parents:
9198
diff
changeset
|
228 |
physfs physlayer |
13222
d6364e31f9c9
Drop Qt XML from dependencies. QXmlStreamReader is part of QtCore
Wuzzy <Wuzzy2@mail.ru>
parents:
13221
diff
changeset
|
229 |
Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Network |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
230 |
) |
184 | 231 |
|
11360 | 232 |
list(APPEND HW_LINK_LIBS |
233 |
${SDL2_LIBRARY} |
|
12386 | 234 |
${SDL2_MIXER_LIBRARIES} |
11360 | 235 |
) |
12896 | 236 |
|
184 | 237 |
if(WIN32 AND NOT UNIX) |
11368
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
11362
diff
changeset
|
238 |
if(NOT SDL2_LIBRARY) |
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
11362
diff
changeset
|
239 |
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
|
240 |
endif() |
555 | 241 |
|
8347 | 242 |
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
|
243 |
ole32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
244 |
oleaut32 |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
245 |
winspool |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
246 |
uuid |
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4410
diff
changeset
|
247 |
) |
2663 | 248 |
endif() |
184 | 249 |
|
9270 | 250 |
if(CMAKE_CXX_COMPILER MATCHES "clang*") |
14980 | 251 |
list(APPEND HW_LINK_LIBS stdc++ m) |
252 |
if(NOT APPLE) |
|
253 |
list(APPEND HW_LINK_LIBS atomic) |
|
254 |
endif() |
|
9270 | 255 |
endif() |
256 |
||
14291
efa901b04bad
prevent qtmain from not being linked in on windows
alfadur
parents:
13565
diff
changeset
|
257 |
if(WIN32 AND VCPKG_TOOLCHAIN) |
efa901b04bad
prevent qtmain from not being linked in on windows
alfadur
parents:
13565
diff
changeset
|
258 |
list(APPEND HW_LINK_LIBS Qt5::WinMain) |
efa901b04bad
prevent qtmain from not being linked in on windows
alfadur
parents:
13565
diff
changeset
|
259 |
endif() |
efa901b04bad
prevent qtmain from not being linked in on windows
alfadur
parents:
13565
diff
changeset
|
260 |
|
8317
ec9f94ab2737
remove the CROSSAPPLE option until a better solution is found
koda
parents:
8316
diff
changeset
|
261 |
target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
262 |
|
495 | 263 |
|
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
|
264 |
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
|
265 |