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
|
2014-02-05 23:25:36 +03:00
|
|
|
StdInc.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
../CCallback.cpp
|
2013-11-30 12:43:31 +03:00
|
|
|
|
|
|
|
battle/CBattleInterface.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
battle/CBattleAnimations.cpp
|
|
|
|
battle/CBattleInterfaceClasses.cpp
|
|
|
|
battle/CCreatureAnimation.cpp
|
|
|
|
|
2014-07-15 10:14:49 +03:00
|
|
|
gui/CAnimation.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
gui/CCursorHandler.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
gui/CGuiHandler.cpp
|
|
|
|
gui/CIntObject.cpp
|
|
|
|
gui/Fonts.cpp
|
|
|
|
gui/Geometries.cpp
|
|
|
|
gui/SDL_Extensions.cpp
|
2013-11-30 12:43:31 +03:00
|
|
|
|
2014-07-13 20:53:37 +03:00
|
|
|
widgets/AdventureMapClasses.cpp
|
2014-07-15 10:14:49 +03:00
|
|
|
widgets/Buttons.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
widgets/CArtifactHolder.cpp
|
|
|
|
widgets/CComponent.cpp
|
|
|
|
widgets/CGarrisonInt.cpp
|
2014-07-15 10:14:49 +03:00
|
|
|
widgets/Images.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
widgets/MiscWidgets.cpp
|
2014-07-15 10:14:49 +03:00
|
|
|
widgets/ObjectLists.cpp
|
|
|
|
widgets/TextControls.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
|
|
|
|
windows/CAdvmapInterface.cpp
|
|
|
|
windows/CCastleInterface.cpp
|
|
|
|
windows/CCreatureWindow.cpp
|
|
|
|
windows/CHeroWindow.cpp
|
|
|
|
windows/CKingdomInterface.cpp
|
|
|
|
windows/CQuestLog.cpp
|
|
|
|
windows/CSpellWindow.cpp
|
|
|
|
windows/CTradeWindow.cpp
|
2014-07-15 10:14:49 +03:00
|
|
|
windows/CWindowObject
|
|
|
|
windows/InfoWindows.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
windows/GUIClasses.cpp
|
|
|
|
|
2014-07-11 11:01:03 +03:00
|
|
|
CBitmapHandler.cpp
|
|
|
|
CDefHandler.cpp
|
|
|
|
CGameInfo.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
Client.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
CMessage.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
CMT.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
CMusicHandler.cpp
|
2014-07-13 20:53:37 +03:00
|
|
|
CPlayerInterface.cpp
|
|
|
|
CPreGame.cpp
|
2014-07-11 11:01:03 +03:00
|
|
|
CVideoHandler.cpp
|
|
|
|
Graphics.cpp
|
|
|
|
mapHandler.cpp
|
|
|
|
NetPacksClient.cpp
|
2016-01-30 23:34:46 +02:00
|
|
|
SDLRWwrapper.cpp
|
2012-07-01 17:27:41 +03:00
|
|
|
)
|
|
|
|
|
2014-07-15 10:14:49 +03:00
|
|
|
set(client_HEADERS
|
|
|
|
gui/SDL_Pixels.h
|
|
|
|
gui/SDL_Compat.h
|
|
|
|
)
|
|
|
|
|
2014-07-10 00:47:22 +03:00
|
|
|
if(APPLE)
|
2014-07-11 11:01:03 +03:00
|
|
|
# OS X specific includes
|
|
|
|
include_directories(${SPARKLE_INCLUDE_DIR})
|
2013-03-02 00:32:26 +03:00
|
|
|
|
2014-07-11 11:01:03 +03:00
|
|
|
# OS X specific source files
|
|
|
|
set(client_SRCS ${client_SRCS} SDLMain.m OSX.mm Info.plist vcmi.icns ../osx/vcmi_dsa_public.pem)
|
2013-11-30 12:43:31 +03:00
|
|
|
add_executable(vcmiclient MACOSX_BUNDLE ${client_SRCS} ${client_HEADERS})
|
2013-03-02 00:32:26 +03:00
|
|
|
|
2014-07-11 11:01:03 +03:00
|
|
|
# OS X specific libraries
|
|
|
|
target_link_libraries(vcmiclient ${SPARKLE_FRAMEWORK})
|
|
|
|
|
|
|
|
# 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 minizip)
|
|
|
|
|
|
|
|
# Custom Info.plist
|
|
|
|
set_target_properties(vcmiclient PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
|
|
|
|
|
|
|
# Copy icon file and public key for Sparkle
|
|
|
|
set_source_files_properties(vcmi.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
set_source_files_properties(../osx/vcmi_dsa_public.pem PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
|
|
|
|
set_target_properties(vcmiclient PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/")
|
|
|
|
|
|
|
|
# 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)/libminizip.dylib ${BUNDLE_PATH}/MacOS/libminizip.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 &&
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/osx/vcmibuilder.app ${BUNDLE_PATH}/MacOS/vcmibuilder.app &&
|
|
|
|
|
|
|
|
# Copy frameworks
|
2015-10-17 08:23:40 +02:00
|
|
|
sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/${CMAKE_FRAMEWORK_PATH} ${BUNDLE_PATH}/Frameworks/ || true' &&
|
2014-07-11 11:01:03 +03:00
|
|
|
|
|
|
|
# Copy vcmi data
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data &&
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data/Mods &&
|
|
|
|
mkdir -p ${BUNDLE_PATH}/Data/launcher &&
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/config/ ${BUNDLE_PATH}/Data/config/ &&
|
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/Mods/vcmi/ ${BUNDLE_PATH}/Data/Mods/vcmi/ &&
|
2015-10-17 08:23:40 +02:00
|
|
|
sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/Mods/WoG/ ${BUNDLE_PATH}/Data/Mods/WoG/ || echo "Download WoG mod from http://wiki.vcmi.eu/index.php?title=Mod_list"' &&
|
|
|
|
sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/Mods/hota/ ${BUNDLE_PATH}/Data/Mods/hota/ || echo "Download HOTA mod from http://wiki.vcmi.eu/index.php?title=Mod_list"' &&
|
2014-07-11 11:01:03 +03:00
|
|
|
cp -r ${CMAKE_HOME_DIRECTORY}/launcher/icons/ ${BUNDLE_PATH}/Data/launcher/icons/)
|
|
|
|
|
|
|
|
add_custom_command(TARGET vcmiclient POST_BUILD COMMAND ${MakeVCMIBundle})
|
2014-07-14 01:02:00 +03:00
|
|
|
elseif(WIN32)
|
2014-10-12 16:32:02 +03:00
|
|
|
add_executable(vcmiclient ${client_SRCS} VCMI_client.rc)
|
2012-12-01 09:30:52 +03:00
|
|
|
else()
|
2014-07-10 00:47:22 +03:00
|
|
|
add_executable(vcmiclient ${client_SRCS})
|
2012-12-01 09:30:52 +03:00
|
|
|
endif()
|
2012-07-01 17:27:41 +03:00
|
|
|
|
2014-07-10 01:06:37 +03:00
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(vcmiclient PROPERTIES OUTPUT_NAME VCMI_client)
|
|
|
|
endif()
|
|
|
|
|
2014-07-10 00:47:22 +03:00
|
|
|
target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES} ${SYSTEM_LIBS})
|
2012-10-05 15:38:17 +03:00
|
|
|
|
2014-02-05 23:25:36 +03:00
|
|
|
set_target_properties(vcmiclient PROPERTIES ${PCH_PROPERTIES})
|
|
|
|
cotire(vcmiclient)
|
2014-02-01 16:37:26 +03:00
|
|
|
|
|
|
|
|
2012-10-05 15:38:17 +03:00
|
|
|
install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
|
|
|
|
|