1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
vcmi/server/CMakeLists.txt
Andrey Filipenkov b6c4126bed install files after building server/client
package required files inside app bundle
2022-09-24 15:55:17 +03:00

66 lines
1.7 KiB
CMake

set(server_SRCS
StdInc.cpp
CGameHandler.cpp
CQuery.cpp
CVCMIServer.cpp
NetPacksServer.cpp
NetPacksLobbyServer.cpp
)
set(server_HEADERS
StdInc.h
CGameHandler.h
CQuery.h
CVCMIServer.h
)
if(APPLE_IOS)
set(server_SRCS ${server_SRCS} ios/main.mm)
endif(APPLE_IOS)
assign_source_group(${server_SRCS} ${server_HEADERS})
if(ANDROID) # android needs client/server to be libraries, not executables, so we can't reuse the build part of this script
return()
endif()
add_executable(vcmiserver ${server_SRCS} ${server_HEADERS})
set(server_LIBS vcmi)
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
set(server_LIBS execinfo ${server_LIBS})
elseif(APPLE_IOS)
set(server_LIBS ${server_LIBS} "-framework UIKit")
endif()
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
target_include_directories(vcmiserver
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
if(WIN32)
set_target_properties(vcmiserver
PROPERTIES
OUTPUT_NAME "VCMI_server"
PROJECT_LABEL "VCMI_server"
)
elseif(APPLE_IOS)
set_target_properties(vcmiserver PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist.in")
# TODO: move to a common dir / add macro?
target_sources(vcmiserver PRIVATE ${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard)
set_source_files_properties(${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
endif()
vcmi_set_output_dir(vcmiserver "")
enable_pch(vcmiserver)
if(APPLE_IOS)
add_custom_command(TARGET vcmiserver POST_BUILD
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiserver>"
)
else()
install(TARGETS vcmiserver DESTINATION ${BIN_DIR})
endif()