Browse Source

CMake as optional build system

wantedhl
a1batross 8 years ago
parent
commit
42052a5057
  1. 62
      CMakeLists.txt
  2. 107
      cl_dll/CMakeLists.txt
  3. 148
      dlls/CMakeLists.txt

62
CMakeLists.txt

@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
#
# Copyright (c) 2016 Alibek Omarov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
cmake_minimum_required(VERSION 2.6.0)
project (HLSDK-XASH3D)
#--------------
# USER DEFINES \
################\
option(USE_VGUI "Enable VGUI1. UNDONE" OFF)
option(USE_VGUI2 "Enable VGUI2. UNDONE" OFF)
option(USE_VOICEMGR "Enable VOICE MANAGER." OFF)
option(BUILD_CLIENT "Build client dll" ON)
option(BUILD_SERVER "Build server dll" ON)
#-----------------
# MAIN BUILD CODE \
###################\
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# Build 32-bit Xash on 64-bit, because Xash3D not support this
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(MSVC)
error("UNDONE: set 32 build flags")
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
endif()
endif()
if(BUILD_CLIENT)
add_subdirectory(cl_dll)
endif()
if(BUILD_SERVER)
add_subdirectory(dlls)
endif()
if(NOT BUILD_SERVER AND NOT BUILD_CLIENT)
error("Nothing to build")
endif()

107
cl_dll/CMakeLists.txt

@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
#
# Copyright (c) 2016 Alibek Omarov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
cmake_minimum_required(VERSION 2.6.0)
project (CLDLL)
set (CLDLL_LIBRARY client)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -w")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
set (CLDLL_SOURCES
../dlls/crossbow.cpp
../dlls/crowbar.cpp
../dlls/egon.cpp
../dlls/gauss.cpp
../dlls/handgrenade.cpp
../dlls/hornetgun.cpp
../dlls/mp5.cpp
../dlls/python.cpp
../dlls/rpg.cpp
../dlls/satchel.cpp
../dlls/shotgun.cpp
../dlls/squeakgrenade.cpp
../dlls/tripmine.cpp
../dlls/glock.cpp
ev_hldm.cpp
hl/hl_baseentity.cpp
hl/hl_events.cpp
hl/hl_objects.cpp
hl/hl_weapons.cpp
ammo.cpp
ammo_secondary.cpp
ammohistory.cpp
battery.cpp
cdll_int.cpp
com_weapons.cpp
death.cpp
demo.cpp
entity.cpp
ev_common.cpp
events.cpp
flashlight.cpp
GameStudioModelRenderer.cpp
geiger.cpp
health.cpp
hud.cpp
hud_msg.cpp
hud_redraw.cpp
hud_spectator.cpp
hud_update.cpp
in_camera.cpp
input.cpp
#SRCS+=./inputw32.cpp
menu.cpp
message.cpp
overview.cpp
parsemsg.cpp
../pm_shared/pm_debug.c
../pm_shared/pm_math.c
../pm_shared/pm_shared.c
saytext.cpp
status_icons.cpp
statusbar.cpp
studio_util.cpp
StudioModelRenderer.cpp
text_message.cpp
train.cpp
tri.cpp
util.cpp
view.cpp
input_xash3d.cpp
scoreboard.cpp
MOTD.cpp)
include_directories (. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public)
if(USE_VOICEMGR)
#set(CLDLL_SOURCES
# ${CLDLL_SOURCES}
# ../game_shared/voice_banmgr.cpp
# ../game_shared/voice_status.cpp)
endif()
add_library (${CLDLL_LIBRARY} SHARED ${CLDLL_SOURCES})
set_target_properties (${CLDLL_SHARED} PROPERTIES
POSITION_INDEPENDENT_CODE 1)

148
dlls/CMakeLists.txt

@ -0,0 +1,148 @@ @@ -0,0 +1,148 @@
#
# Copyright (c) 2015 Pavlo Lavrenenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
cmake_minimum_required(VERSION 2.6.0)
project (SVDLL)
set (SVDLL_LIBRARY server)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LINUX -DCLIENT_WEAPONS -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -fno-exceptions -w")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
set (SVDLL_SOURCES
agrunt.cpp
airtank.cpp
aflock.cpp
animating.cpp
animation.cpp
apache.cpp
barnacle.cpp
barney.cpp
bigmomma.cpp
bloater.cpp
bmodels.cpp
bullsquid.cpp
buttons.cpp
cbase.cpp
client.cpp
combat.cpp
controller.cpp
crossbow.cpp
crowbar.cpp
defaultai.cpp
doors.cpp
effects.cpp
egon.cpp
explode.cpp
flyingmonster.cpp
func_break.cpp
func_tank.cpp
game.cpp
gamerules.cpp
gargantua.cpp
gauss.cpp
genericmonster.cpp
ggrenade.cpp
globals.cpp
glock.cpp
gman.cpp
h_ai.cpp
h_battery.cpp
h_cine.cpp
h_cycler.cpp
h_export.cpp
handgrenade.cpp
hassassin.cpp
headcrab.cpp
healthkit.cpp
hgrunt.cpp
hornet.cpp
hornetgun.cpp
houndeye.cpp
ichthyosaur.cpp
islave.cpp
items.cpp
leech.cpp
lights.cpp
maprules.cpp
monstermaker.cpp
monsters.cpp
monsterstate.cpp
mortar.cpp
mp5.cpp
multiplay_gamerules.cpp
nihilanth.cpp
nodes.cpp
osprey.cpp
pathcorner.cpp
plane.cpp
plats.cpp
player.cpp
python.cpp
rat.cpp
roach.cpp
rpg.cpp
satchel.cpp
schedule.cpp
scientist.cpp
scripted.cpp
shotgun.cpp
singleplay_gamerules.cpp
skill.cpp
sound.cpp
soundent.cpp
spectator.cpp
squadmonster.cpp
squeakgrenade.cpp
subs.cpp
talkmonster.cpp
teamplay_gamerules.cpp
tempmonster.cpp
tentacle.cpp
triggers.cpp
tripmine.cpp
turret.cpp
util.cpp
weapons.cpp
world.cpp
xen.cpp
zombie.cpp
../pm_shared/pm_debug.c
../pm_shared/pm_math.c
../pm_shared/pm_shared.c
)
include_directories (. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public)
if(USE_VOICEMGR)
set(SVDLL_SOURCES
${SVDLL_SOURCES}
../game_shared/voice_gamemgr.cpp)
else()
add_definitions(-DNO_VOICEGAMEMGR)
endif()
add_library (${SVDLL_LIBRARY} SHARED ${SVDLL_SOURCES})
set_target_properties (${SVDLL_SHARED} PROPERTIES
POSITION_INDEPENDENT_CODE 1)
Loading…
Cancel
Save