Fixed installation on other than Ubuntu GNU/Linux distributions

This commit is contained in:
ElXreno 2019-12-06 13:13:18 +03:00
parent 6e7ef52bda
commit f6478067ae
No known key found for this signature in database
GPG key ID: 684214850DBE3423

View file

@ -1413,13 +1413,14 @@ if(TARGET_OS STREQUAL "windows")
endif() endif()
if(NOT DEV) if(NOT DEV)
install(DIRECTORY data DESTINATION share/ddnet COMPONENT data) include(GNUInstallDirs)
install(TARGETS ${TARGET_CLIENT} DESTINATION bin COMPONENT client) install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ddnet COMPONENT data)
install(TARGETS ${TARGET_SERVER} DESTINATION bin COMPONENT server) install(TARGETS ${TARGET_CLIENT} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
install(TARGETS ${TARGETS_TOOLS} DESTINATION lib/ddnet COMPONENT tools) install(TARGETS ${TARGET_SERVER} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
install(FILES other/ddnet.desktop DESTINATION share/applications COMPONENT client) install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT tools)
install(FILES other/ddnet.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications COMPONENT client)
foreach(SIZE 16 32 48 128 256 512) foreach(SIZE 16 32 48 128 256 512)
install(FILES other/icons/DDNet_${SIZE}x${SIZE}x32.png DESTINATION share/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet.png COMPONENT client) install(FILES other/icons/DDNet_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet.png COMPONENT client)
endforeach() endforeach()
endif() endif()