diff options
author | Bart Ribbers <PureTryOut@users.noreply.github.com> | 2018-01-09 19:34:01 +0100 |
---|---|---|
committer | mujx <mujx@users.noreply.github.com> | 2018-01-09 20:34:01 +0200 |
commit | 3d321622bb2425634c2ee2965a7a9351ed3bd14d (patch) | |
tree | f3c093c9302ef655895268c6954daacc3d58950c /CMakeLists.txt | |
parent | Communities (#195) (diff) | |
download | nheko-3d321622bb2425634c2ee2965a7a9351ed3bd14d.tar.xz |
Add make install and make uninstall rules to cmake (#196)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 29c28527..f44198f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ option(APPVEYOR_BUILD "Build on appveyor" OFF) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +include(GNUInstallDirs) + # Include Qt basic functions include(QtCommon) @@ -337,3 +339,24 @@ else() add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS}) target_link_libraries (nheko ${NHEKO_LIBS} Qt5::Multimedia) endif() + +if(UNIX AND NOT APPLE) + install (TARGETS nheko RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install (FILES "resources/nheko-16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "nheko.png") + install (FILES "resources/nheko-32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "nheko.png") + install (FILES "resources/nheko-48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "nheko.png") + install (FILES "resources/nheko-64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "nheko.png") + install (FILES "resources/nheko-128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "nheko.png") + install (FILES "resources/nheko-256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "nheko.png") + install (FILES "resources/nheko-512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "nheko.png") + install (FILES "resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") + + if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif() +endif() |