Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use linux line ending * Use pthread lib for netplay * Do not link against sdl2main except for MXE * Readd slash for qt string. * Use glew static on Linux
- Loading branch information
Showing
36 changed files
with
709 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
project (miniupnpc C) | ||
|
||
file(GLOB HEADERS "*.h") | ||
file(GLOB SRC "*.c") | ||
|
||
add_library(miniupnpc ${HEADERS} ${SRC}) | ||
|
||
#install(TARGETS hello-world DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#cmake_policy(SET CMP0040 OLD) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(wz2100 CXX) | ||
ENABLE_LANGUAGE(C) | ||
|
||
set (CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
|
||
find_package(Qt5 COMPONENTS Core Widgets Script Gui REQUIRED) | ||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") | ||
find_package(PkgConfig) | ||
if(${CMAKE_CROSSCOMPILING}) | ||
add_definitions("-DQT_STATICPLUGIN") | ||
pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Core Qt5Script) | ||
link_directories(${QT5ALL_LIBRARY_DIRS}) | ||
add_definitions("-DGLEW_STATIC") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") | ||
endif() | ||
endif() | ||
find_package(GLEW REQUIRED) | ||
find_package(PhysFS REQUIRED) | ||
find_package(OpenSSL REQUIRED) | ||
find_package(PNG REQUIRED) | ||
find_package(Freetype REQUIRED) | ||
find_package(OpenGL REQUIRED) | ||
|
||
add_definitions("-DYY_NO_UNISTD_H") | ||
add_definitions("-DMINIUPNP_STATICLIB") | ||
add_definitions("-DHAVE_CONFIG_H") | ||
|
||
include_directories(".") | ||
include_directories("3rdparty") | ||
include_directories("3rdparty/theora/include") | ||
include_directories("${GLEW_INCLUDE_DIR}") | ||
include_directories("${PHYSFS_INCLUDE_DIR}") | ||
include_directories("${OPENSSL_INCLUDE_DIR}") | ||
include_directories("${PNG_INCLUDE_DIR}") | ||
include_directories("${CMAKE_CURRENT_BINARY_DIR}") | ||
include_directories("${FREETYPE_INCLUDE_DIR_ft2build}") | ||
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" AND ${CMAKE_CROSSCOMPILING}) | ||
include_directories(${QT5ALL_INCLUDE_DIRS}) | ||
endif() | ||
|
||
OPTION(ENABLE_NLS "Native Language Support" ON) | ||
OPTION(WZ_PORTABLE "Portable" ON) | ||
SET(STDC_HEADERS ON) | ||
SET(HAVE_CFPREFERENCESCOPYAPPVALUE OFF) | ||
SET(_MINIX OFF) | ||
SET(_POSIX_1_SOURCE OFF) | ||
SET(_POSIX_SOURCE OFF) | ||
SET(_XOPEN_SOURCE) | ||
SET(PACKAGE "warzone2100") | ||
SET(PACKAGE_BUGREPORT "http://wz2100.net/") | ||
SET(PACKAGE_NAME "Warzone 2100") | ||
SET(PACKAGE_TARNAME "warzone2100") | ||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") | ||
SET(_GNU_SOURCE ON) | ||
endif() | ||
|
||
INCLUDE (CheckIncludeFiles) | ||
CHECK_INCLUDE_FILES(alloca.h HAVE_ALLOCA_H) | ||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H) | ||
else() | ||
SET(HAVE_INTTYPES_H OFF) | ||
endif() | ||
CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H) | ||
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) | ||
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) | ||
CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H) | ||
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) | ||
CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H) | ||
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H) | ||
CHECK_INCLUDE_FILES("sys/ucontext.h" HAVE_SYS_UCONTEXT_H) | ||
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) | ||
|
||
INCLUDE (CheckFunctionExists) | ||
CHECK_FUNCTION_EXISTS(gettext HAVE_GETTEXT) | ||
CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV) | ||
CHECK_FUNCTION_EXISTS(strlcat HAVE_SYSTEM_STRLCAT) | ||
CHECK_FUNCTION_EXISTS(strlcpy HAVE_SYSTEM_STRLCPY) | ||
CHECK_FUNCTION_EXISTS(strlcat HAVE_VALID_STRLCAT) | ||
CHECK_FUNCTION_EXISTS(strlcpy HAVE_VALID_STRLCPY) | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) | ||
|
||
add_subdirectory(3rdparty/miniupnpc) | ||
add_subdirectory(lib) | ||
add_subdirectory(src) | ||
add_subdirectory(po) | ||
add_subdirectory(data) | ||
add_subdirectory(doc) | ||
add_subdirectory(pkg/nsis) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# - Try to locate SDL2 | ||
# This module defines: | ||
# | ||
# SDL2_INCLUDE_DIR | ||
# SDL2_LIBRARY | ||
# SDL2_FOUND | ||
# | ||
|
||
FIND_PATH(SDL2_INCLUDE_DIR NAMES SDL.h PATH_SUFFIXES SDL2) | ||
|
||
FIND_LIBRARY(SDL2_LIBRARY NAMES SDL2) | ||
FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) | ||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_INCLUDE_DIR SDL2_LIBRARY) | ||
|
||
MARK_AS_ADVANCED(SDL2_INCLUDE_DIR SDL2_LIBRARY SDL2MAIN_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
project(data) | ||
|
||
|
||
add_custom_target(data_base COMMAND | ||
${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_CURRENT_BINARY_DIR}/base.wz" --format=zip | ||
"palette.txt" | ||
"audio" | ||
"campaigns" | ||
"components" | ||
"effects" | ||
"features" | ||
"gamedesc.lev" | ||
"ruleset.json" | ||
"images" | ||
"messages" | ||
"misc" | ||
"fonts" | ||
"script" | ||
"sequenceaudio" | ||
"shaders" | ||
"stats" | ||
"structs" | ||
"texpages" | ||
"tileset" | ||
"wrf" | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/base") | ||
|
||
add_custom_target(data_mp COMMAND | ||
${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_CURRENT_BINARY_DIR}/mp.wz" --format=zip | ||
"addon.lev" | ||
"ruleset.json" | ||
"anims" | ||
"challenges" | ||
"tests" | ||
"components" | ||
"effects" | ||
"messages" | ||
"multiplay" | ||
"stats" | ||
"structs" | ||
"wrf" | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/mp" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
project(doc) | ||
|
||
add_custom_target(doc_wz2100) | ||
|
||
set(doc_DATA | ||
"images/artillery-far-away.jpg" | ||
"images/artillery-sensor.jpg" | ||
"images/attackrange.jpg" | ||
"images/awaymission.jpg" | ||
"images/building.jpg" | ||
"images/building-select.jpg" | ||
"images/cb-sensor.png" | ||
"images/cb-sensor-vtol.png" | ||
"images/cheapweapon.png" | ||
"images/commander-factory-assignment.jpg" | ||
"images/commander-panel.jpg" | ||
"images/commander.png" | ||
"images/commandpanel.png" | ||
"images/design-bars.jpg" | ||
"images/design.jpg" | ||
"images/design-more.png" | ||
"images/design-screen.jpg" | ||
"images/design-unit.jpg" | ||
"images/expensiveweapon.png" | ||
"images/firing.jpg" | ||
"images/hq.png" | ||
"images/indirect-fire-support.jpg" | ||
"images/intelligencedisplay.jpg" | ||
"images/interface.jpg" | ||
"images/logo.png" | ||
"images/manufacture.jpg" | ||
"images/manufacture-select.jpg" | ||
"images/minimap.jpg" | ||
"images/movement.jpg" | ||
"images/oilresource.jpg" | ||
"images/powerbar.jpg" | ||
"images/powerupgrade.png" | ||
"images/rallypoints.jpg" | ||
"images/recycling.jpg" | ||
"images/research.jpg" | ||
"images/research-select.jpg" | ||
"images/retreatthreshold.jpg" | ||
"images/return.jpg" | ||
"images/satellite-uplink.png" | ||
"images/sensor.png" | ||
"images/sensor-tower.png" | ||
"images/transport.jpg" | ||
"images/unitordersmenu.jpg" | ||
"images/wss.png" | ||
"images/www.png" | ||
"ScriptingManual.htm" | ||
"docbook-xsl.css") | ||
|
||
add_custom_command( | ||
TARGET doc_wz2100 | ||
COMMAND "a2x" | ||
ARGS | ||
"-f" | ||
"xhtml" | ||
"-D" | ||
"${CMAKE_CURRENT_BINARY_DIR}" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/quickstartguide.asciidoc" | ||
) | ||
|
||
add_custom_command( | ||
TARGET doc_wz2100 | ||
COMMAND "a2x" | ||
ARGS | ||
"-f" | ||
"xhtml" | ||
"-D" | ||
"${CMAKE_CURRENT_BINARY_DIR}" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/warzone2100.6.asciidoc" | ||
) | ||
|
||
if (${WKHTMLTOPDF_AVAILABLE}) | ||
|
||
add_custom_command( | ||
TARGET doc_wz2100 | ||
COMMAND "wkhtmltopdf" | ||
ARGS | ||
"${CMAKE_CURRENT_SOURCE_DIR}/quickstartguide.htm" | ||
"${CMAKE_CURRENT_BINARY_DIR}/quickstartguide.pdf" | ||
) | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
add_subdirectory(exceptionhandler) | ||
add_subdirectory(framework) | ||
add_subdirectory(gamelib) | ||
add_subdirectory(ivis_opengl) | ||
add_subdirectory(netplay) | ||
add_subdirectory(script) | ||
add_subdirectory(sdl) | ||
add_subdirectory(sequence) | ||
add_subdirectory(sound) | ||
add_subdirectory(widget) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
project (exception-handler CXX) | ||
|
||
file(GLOB HEADERS "*.h") | ||
if(WIN32) | ||
file(GLOB SRC "*.cpp") | ||
else() | ||
set(SRC "dumpinfo.cpp" "exceptionhandler.cpp") | ||
endif() | ||
|
||
add_library(exception-handler ${HEADERS} ${SRC}) | ||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND ${CMAKE_CROSSCOMPILING}) | ||
target_link_libraries(exception-handler bfd iberty) | ||
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") | ||
target_link_libraries(exception-handler "dbghelp.lib") | ||
endif() | ||
target_link_libraries(exception-handler Qt5::Core) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
project (framework CXX) | ||
|
||
file(GLOB HEADERS "*.h") | ||
file(GLOB SRC "*.cpp") | ||
|
||
add_library(framework ${HEADERS} ${SRC}) | ||
target_link_libraries(framework Qt5::Core) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.