11 set(QT_USE_QTMAIN TRUE) |
11 set(QT_USE_QTMAIN TRUE) |
12 |
12 |
13 find_package(Qt4 REQUIRED) |
13 find_package(Qt4 REQUIRED) |
14 include(${QT_USE_FILE}) |
14 include(${QT_USE_FILE}) |
15 |
15 |
|
16 # https://bugreports.qt-project.org/browse/QTBUG-17333 |
16 if(APPLE AND |
17 if(APPLE AND |
17 ${QTVERSION} VERSION_GREATER "4.7.0" AND |
18 ${QTVERSION} VERSION_GREATER "4.7.0" AND |
18 ${QTVERSION} VERSION_LESS "4.7.4") |
19 ${QTVERSION} VERSION_LESS "4.7.4") |
19 message(FATAL_ERROR "This version of QT is known *not* to work, please update or use a lower version") |
20 message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version") |
20 endif() |
21 endif() |
21 |
22 |
22 find_package(SDL2 REQUIRED) |
23 find_package(SDL2 REQUIRED) |
23 find_package(SDL2_mixer REQUIRED) #audio in SDLInteraction |
24 find_package(SDL2_mixer REQUIRED) #audio in SDLInteraction |
24 include_directories(${SDL2_INCLUDE_DIR}) |
25 include_directories(${SDL2_INCLUDE_DIR}) |
25 include_directories(${SDL2MIXER_INCLUDE_DIR}) |
26 include_directories(${SDL2MIXER_INCLUDE_DIR}) |
26 |
27 |
27 if(${FFMPEG_FOUND}) |
28 if(LIBAV_FOUND) |
28 add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS) |
29 add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS) |
29 include_directories(${FFMPEG_INCLUDE_DIR}) |
30 include_directories(${LIBAV_INCLUDE_DIR}) |
30 list(APPEND HW_LINK_LIBS ${FFMPEG_LIBRARIES}) |
31 list(APPEND HW_LINK_LIBS ${LIBAV_LIBRARIES}) |
31 endif() |
32 endif() |
32 |
33 |
33 # server messages localization |
34 # server messages localization |
34 file(GLOB ServerSources ${CMAKE_SOURCE_DIR}/gameServer/*.hs) |
35 file(GLOB ServerSources ${CMAKE_SOURCE_DIR}/gameServer/*.hs) |
35 foreach(hsfile ${ServerSources}) |
36 foreach(hsfile ${ServerSources}) |
59 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/dialog) |
60 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/dialog) |
60 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/page) |
61 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/page) |
61 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget) |
62 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget) |
62 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util) |
63 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util) |
63 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform) |
64 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform) |
64 include_directories(${PHYSFS_INCLUDE_DIR}) |
65 include_directories(BEFORE ${PHYSFS_INCLUDE_DIR}) |
65 include_directories(${PHYSLAYER_INCLUDE_DIR}) |
66 include_directories(BEFORE ${PHYSLAYER_INCLUDE_DIR}) |
66 |
67 include_directories(${LUA_INCLUDE_DIR}) #brought by physlayer hwpacksmounter.h |
67 |
68 |
68 if(UNIX) |
69 if(UNIX) |
69 # HACK: in freebsd cannot find iconv.h included via SDL.h |
70 # HACK: in freebsd cannot find iconv.h included via SDL.h |
70 include_directories("/usr/local/include") |
71 include_directories("/usr/local/include") |
71 endif(UNIX) |
72 endif(UNIX) |
150 ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
151 ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
151 ) |
152 ) |
152 |
153 |
153 set(hwfr_rez hedgewars.qrc) |
154 set(hwfr_rez hedgewars.qrc) |
154 |
155 |
155 if(${BUILD_ENGINE_LIBRARY}) |
156 if(BUILD_ENGINE_LIBRARY) |
156 add_definitions(-DHWLIBRARY=1) |
157 add_definitions(-DHWLIBRARY=1) |
157 set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
158 set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
158 list(APPEND HW_LINK_LIBS ${hwlibname}) |
159 list(APPEND HW_LINK_LIBS ${hwlibname}) |
|
160 |
|
161 if(LIBAV_FOUND) |
|
162 # add_subdirectory(avwrapper) |
|
163 list(APPEND HW_LINK_LIBS avwrapper) |
|
164 endif() |
159 endif() |
165 endif() |
160 |
166 |
161 qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
167 qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
162 |
168 |
163 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
169 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
182 endif() |
188 endif() |
183 endif() |
189 endif() |
184 |
190 |
185 #when debugging, always prompt a console to see fronted messages |
191 #when debugging, always prompt a console to see fronted messages |
186 #TODO: check it doesn't interfere on UNIX |
192 #TODO: check it doesn't interfere on UNIX |
187 if(CMAKE_BUILD_TYPE MATCHES "RELEASE") |
193 if(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO") |
188 set(console_access "WIN32") |
194 set(console_access "WIN32") |
189 endif(CMAKE_BUILD_TYPE MATCHES "RELEASE") |
195 endif(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO") |
190 |
196 |
191 add_executable(hedgewars ${console_access} |
197 add_executable(hedgewars ${console_access} |
192 ${hwfr_src} |
198 ${hwfr_src} |
193 ${hwfr_moc_srcs} |
199 ${hwfr_moc_srcs} |
194 ${hwfr_hdrs} |
200 ${hwfr_hdrs} |