2012-07-15 19:05:41 +03:00
|
|
|
project(vcmiclient)
|
2012-07-01 17:27:41 +03:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib)
|
|
|
|
include_directories(${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR})
|
2013-01-26 22:39:54 +03:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIRS})
|
2012-07-01 17:27:41 +03:00
|
|
|
|
|
|
|
set(client_SRCS
|
|
|
|
../CCallback.cpp
|
|
|
|
BattleInterface/CBattleAnimations.cpp
|
|
|
|
BattleInterface/CBattleInterface.cpp
|
|
|
|
BattleInterface/CBattleInterfaceClasses.cpp
|
|
|
|
BattleInterface/CCreatureAnimation.cpp
|
|
|
|
UIFramework/CGuiHandler.cpp
|
|
|
|
UIFramework/CIntObject.cpp
|
|
|
|
UIFramework/CIntObjectClasses.cpp
|
2012-12-19 20:24:53 +03:00
|
|
|
UIFramework/Fonts.cpp
|
2012-07-01 17:27:41 +03:00
|
|
|
UIFramework/Geometries.cpp
|
|
|
|
UIFramework/CCursorHandler.cpp
|
|
|
|
UIFramework/SDL_Extensions.cpp
|
|
|
|
AdventureMapClasses.cpp
|
|
|
|
CAdvmapInterface.cpp
|
|
|
|
CAnimation.cpp
|
|
|
|
CBitmapHandler.cpp
|
|
|
|
CCastleInterface.cpp
|
|
|
|
CCreatureWindow.cpp
|
|
|
|
CDefHandler.cpp
|
|
|
|
CGameInfo.cpp
|
|
|
|
CHeroWindow.cpp
|
|
|
|
CKingdomInterface.cpp
|
|
|
|
Client.cpp
|
|
|
|
CMessage.cpp
|
|
|
|
CMT.cpp
|
|
|
|
CMusicHandler.cpp
|
|
|
|
CPlayerInterface.cpp
|
|
|
|
CPreGame.cpp
|
|
|
|
CSpellWindow.cpp
|
|
|
|
CVideoHandler.cpp
|
2012-07-15 19:05:41 +03:00
|
|
|
CQuestLog.cpp
|
2012-07-01 17:27:41 +03:00
|
|
|
Graphics.cpp
|
|
|
|
GUIClasses.cpp
|
|
|
|
mapHandler.cpp
|
|
|
|
NetPacksClient.cpp
|
|
|
|
)
|
|
|
|
|
2012-12-01 09:30:52 +03:00
|
|
|
if(WIN32)
|
2012-07-15 19:05:41 +03:00
|
|
|
add_executable(vcmiclient WIN32 ${client_SRCS})
|
2012-12-01 09:30:52 +03:00
|
|
|
elseif(APPLE)
|
2013-03-02 00:32:26 +03:00
|
|
|
# OS X specific includes
|
|
|
|
include_directories(${SPARKLE_INCLUDE_DIR})
|
|
|
|
|
|
|
|
# OS X specific source files
|
|
|
|
set(client_SRCS ${client_SRCS} SDLMain.m OSX.mm Info.plist vcmi.icns ../osx/vcmi_dsa_public.pem)
|
|
|
|
add_executable(vcmiclient MACOSX_BUNDLE ${client_SRCS})
|
|
|
|
|
|
|
|
# OS X specific libraries
|
|
|
|
target_link_libraries(vcmiclient ${SPARKLE_FRAMEWORK})
|
2012-12-01 09:30:52 +03:00
|
|
|
|
|
|
|
# Because server and AI libs would be copies to bundle they need to be built before client
|
|
|
|
add_dependencies(vcmiclient vcmiserver VCAI EmptyAI StupidAI BattleAI)
|
|
|
|
|
2013-02-06 18:39:34 +03:00
|
|
|
# Custom Info.plist
|
|
|
|
set_target_properties(vcmiclient PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
|
|
|
|
2013-03-02 00:32:26 +03:00
|
|
|
# Copy icon file and public key for Sparkle
|
2013-02-06 18:39:34 +03:00
|
|
|
set_source_files_properties(vcmi.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
2013-03-02 00:32:26 +03:00
|
|
|
set_source_files_properties(../osx/vcmi_dsa_public.pem PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
2012-12-01 09:30:52 +03:00
|
|
|
|
|
|
|
# Copy server executable, libs and game data to bundle
|
|
|
|
set(BUNDLE_PATH ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/vcmiclient.app/Contents)
|
|
|
|
set(MakeVCMIBundle
|
|
|
|
# Copy all needed binaries
|
|
|
|
mkdir -p ${BUNDLE_PATH}/MacOS/AI &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/vcmiserver ${BUNDLE_PATH}/MacOS/vcmiserver &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/libvcmi.dylib ${BUNDLE_PATH}/MacOS/libvcmi.dylib &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/libVCAI.dylib ${BUNDLE_PATH}/MacOS/AI/libVCAI.dylib &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/libStupidAI.dylib ${BUNDLE_PATH}/MacOS/AI/libStupidAI.dylib &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/libEmptyAI.dylib ${BUNDLE_PATH}/MacOS/AI/libEmptyAI.dylib &&
|
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/libBattleAI.dylib ${BUNDLE_PATH}/MacOS/AI/libBattleAI.dylib &&
|
2012-12-27 12:21:30 +03:00
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/osx/vcmibuilder.app ${BUNDLE_PATH}/MacOS/vcmibuilder.app &&
|
2012-12-01 09:30:52 +03:00
|
|
|
|
|
|
|
# Copy frameworks
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/${CMAKE_FRAMEWORK_PATH} ${BUNDLE_PATH}/Frameworks &&
|
|
|
|
|
|
|
|
# Copy vcmi data
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data &&
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data/Mods &&
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data/Mods/WoG &&
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/config ${BUNDLE_PATH}/Data/config &&
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/Mods/vcmi ${BUNDLE_PATH}/Data/Mods/vcmi &&
|
2012-12-15 10:24:25 +03:00
|
|
|
cp ${CMAKE_HOME_DIRECTORY}/Mods/WoG/mod.json ${BUNDLE_PATH}/Data/Mods/WoG/mod.json)
|
2012-12-01 09:30:52 +03:00
|
|
|
add_custom_command(TARGET vcmiclient POST_BUILD COMMAND ${MakeVCMIBundle})
|
|
|
|
else()
|
|
|
|
add_executable(vcmiclient ${client_SRCS})
|
|
|
|
endif()
|
2012-07-01 17:27:41 +03:00
|
|
|
|
2012-07-19 21:52:44 +03:00
|
|
|
target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES} ${RT_LIB} ${DL_LIB})
|
2012-10-05 15:38:17 +03:00
|
|
|
|
|
|
|
install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
|
|
|
|
|