project(launcher) # Dependencies add_subdirectory(dependencies) # Launcher add_executable(launcher src/bootstrap.c src/patchelf.c src/crash-report.c) if(MCPI_SERVER_MODE) target_sources(launcher PRIVATE src/server/launcher.c) else() add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/available-feature-flags.c" COMMAND xxd -i available-feature-flags "${CMAKE_CURRENT_BINARY_DIR}/available-feature-flags.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/client/available-feature-flags" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/client" VERBATIM ) target_sources(launcher PRIVATE src/client/launcher.cpp "${CMAKE_CURRENT_BINARY_DIR}/available-feature-flags.c") endif() target_link_libraries(launcher reborn-util) # RPath set_target_properties(launcher PROPERTIES INSTALL_RPATH "$ORIGIN/lib/native") # Install install(TARGETS launcher DESTINATION "${MCPI_INSTALL_DIR}") install_symlink("../${MCPI_INSTALL_DIR}/launcher" "bin/${MCPI_VARIANT_NAME}") # Install Desktop Entry file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop" "[Desktop Entry]\n" "Name=${MCPI_APP_TITLE}\n" "Comment=Fun with Blocks\n" "Icon=${MCPI_APP_ID}\n" "Exec=${MCPI_VARIANT_NAME}\n" "Type=Application\n" "Categories=Game;\n" ) if(MCPI_HEADLESS_MODE) file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop" "Terminal=true\n" "NoDisplay=true\n" ) else() file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop" "Terminal=false\n" "StartupNotify=false\n" "StartupWMClass=${MCPI_APP_TITLE}\n" ) endif() install( FILES "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop" DESTINATION "${MCPI_SHARE_DIR}/applications" RENAME "${MCPI_APP_ID}.desktop" ) # Install AppStream Metadata file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml" "\n" "\n" " ${MCPI_APP_ID}\n" " ${MCPI_APP_TITLE}\n" " CC0-1.0\n" " Fun with Blocks\n" " \n" "

Minecraft: Pi Edition Modding Project.

\n" "

NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.

\n" "
\n" " https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn\n" " ${MCPI_APP_ID}.desktop\n" " \n" " com.thebrokenrail.MCPIRebornClient.desktop\n" " \n" " LicenseRef-proprietary\n" " TheBrokenRail & Mojang AB\n" " \n" " moderate\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " intense\n" " none\n" " none\n" " none\n" " none\n" " none\n" " none\n" " \n" " \n" " \n" " \n" ) if(NOT MCPI_HEADLESS_MODE) file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml" " \n" " \n" " https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn/raw/branch/master/images/start.png\n" " \n" " \n" ) endif() file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml" "
\n" ) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml" DESTINATION "${MCPI_SHARE_DIR}/metainfo" RENAME "${MCPI_APP_ID}.appdata.xml" ) # AppImage if(MCPI_IS_APPIMAGE_BUILD) install_symlink("bin/${MCPI_VARIANT_NAME}" "AppRun") install_symlink("${MCPI_SHARE_DIR}/applications/${MCPI_APP_ID}.desktop" "${MCPI_APP_ID}.desktop") endif()