1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
vcmi/server/CMakeLists.txt

66 lines
1.7 KiB
CMake
Raw Normal View History

2012-07-01 17:27:41 +03:00
set(server_SRCS
StdInc.cpp
2014-07-11 11:01:03 +03:00
CGameHandler.cpp
CQuery.cpp
CVCMIServer.cpp
2014-07-11 11:01:03 +03:00
NetPacksServer.cpp
NetPacksLobbyServer.cpp
2012-07-01 17:27:41 +03:00
)
set(server_HEADERS
StdInc.h
CGameHandler.h
CQuery.h
CVCMIServer.h
)
if(APPLE_IOS)
2021-03-10 09:57:07 +02:00
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})
2012-07-01 17:27:41 +03:00
set(server_LIBS vcmi)
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
set(server_LIBS execinfo ${server_LIBS})
elseif(APPLE_IOS)
2021-03-09 10:12:17 +02:00
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}
)
2014-07-10 01:06:37 +03:00
if(WIN32)
set_target_properties(vcmiserver
PROPERTIES
OUTPUT_NAME "VCMI_server"
PROJECT_LABEL "VCMI_server"
)
elseif(APPLE_IOS)
2021-03-10 09:57:07 +02:00
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?
2021-03-10 09:57:07 +02:00
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")
2014-07-10 01:06:37 +03:00
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()