set(clientapp_SRCS StdInc.cpp EntryPoint.cpp ) set(clientapp_HEADERS StdInc.h ) assign_source_group(${clientapp_SRCS} ${clientapp_HEADERS}) add_executable(vcmiclient ${clientapp_SRCS} ${clientapp_HEADERS}) target_link_libraries(vcmiclient PRIVATE vcmiclientcommon) target_include_directories(vcmiclient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) if(WIN32) target_sources(vcmiclient PRIVATE "VCMI_client.rc") set_target_properties(vcmiclient PROPERTIES OUTPUT_NAME "VCMI_client" PROJECT_LABEL "VCMI_client" ) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT vcmiclient) if(NOT ENABLE_DEBUG_CONSOLE) set_target_properties(vcmiclient PROPERTIES WIN32_EXECUTABLE) target_link_libraries(vcmiclient SDL2::SDL2main) endif() target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH) # TODO: very hacky, find proper solution to copy AI dlls into bin dir if(MSVC) add_custom_command(TARGET vcmiclient POST_BUILD WORKING_DIRECTORY "$" COMMAND ${CMAKE_COMMAND} -E copy AI/fuzzylite.dll fuzzylite.dll COMMAND ${CMAKE_COMMAND} -E copy AI/tbb12.dll tbb12.dll ) endif() elseif(APPLE_IOS) set_target_properties(vcmiclient PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist" XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "$(CODE_SIGNING_ALLOWED_FOR_APPS)" XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon ) set(CMAKE_EXE_LINKER_FLAGS "-Wl,-e,_vcmiclient_main") endif() vcmi_set_output_dir(vcmiclient "") enable_pch(vcmiclient) if(APPLE_IOS) vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}") add_custom_command(TARGET vcmiclient POST_BUILD COMMAND ios/set_build_version.sh "$" COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component "${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}" --config "$" --prefix "$" COMMAND ios/rpath_remove_symlinks.sh COMMAND ios/codesign.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) install(TARGETS vcmiclient DESTINATION Payload COMPONENT app) # for ipa generation with cpack elseif(ANDROID) find_program(androidDeployQt androiddeployqt PATHS "${qtBinDir}" ) vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}/${LIB_DIR}") add_custom_target(android_deploy ALL COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$" --prefix "${androidQtBuildDir}" COMMAND "${androidDeployQt}" --input "${CMAKE_BINARY_DIR}/androiddeployqt.json" --output "${androidQtBuildDir}" --android-platform "android-${ANDROID_TARGET_SDK_VERSION}" --verbose $<$>:--release> ${ANDROIDDEPLOYQT_OPTIONS} COMMAND_EXPAND_LISTS VERBATIM COMMENT "Create android package" ) add_dependencies(android_deploy vcmiclient) else() install(TARGETS vcmiclient DESTINATION ${BIN_DIR}) endif() #install icons and desktop file on Linux if(NOT WIN32 AND NOT APPLE AND NOT ANDROID) #FIXME: move to client makefile? foreach(iconSize 16 22 32 48 64 128 256 512 1024 2048) install(FILES "icons/vcmiclient.${iconSize}x${iconSize}.png" DESTINATION "share/icons/hicolor/${iconSize}x${iconSize}/apps" RENAME vcmiclient.png ) endforeach() install(FILES icons/vcmiclient.svg DESTINATION share/icons/hicolor/scalable/apps RENAME vcmiclient.svg ) install(FILES icons/vcmiclient.desktop DESTINATION share/applications ) endif()