Skip to content

Commit

Permalink
Merge pull request #890 from tgurr/shareinstall
Browse files Browse the repository at this point in the history
CMakeLists.txt: Use GNUInstallDirs to fix installing shared data
  • Loading branch information
abma committed Sep 24, 2018
2 parents 1fdbc01 + 807e21d commit 6ba6be2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ endif()
SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )


INCLUDE(compat_flags) INCLUDE(compat_flags)
INCLUDE(GNUInstallDirs)


#---------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------
# Load needed Modules # Load needed Modules
Expand All @@ -61,13 +62,11 @@ option( BUILD_SHARED_LIBS "Chooses whether to link dynamic or static libraries.






SET(SHARE_INSTALL_DIR "/share" CACHE PATH "Share directory name")

SET(SPRINGLOBBY_REV "${SPRINGLOBBY_REV}") SET(SPRINGLOBBY_REV "${SPRINGLOBBY_REV}")
if (WIN32) if (WIN32)
SET(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/locale") SET(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/locale")
else() else()
SET(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}${SHARE_INSTALL_DIR}/locale") SET(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale")
endif() endif()


IF( AUX_VERSION ) IF( AUX_VERSION )
Expand Down Expand Up @@ -134,10 +133,10 @@ INCLUDE(cmake/package_config.cmake)
IF(WIN32) IF(WIN32)
install(FILES AUTHORS COPYING README THANKS NEWS DESTINATION ${CMAKE_INSTALL_PREFIX}) install(FILES AUTHORS COPYING README THANKS NEWS DESTINATION ${CMAKE_INSTALL_PREFIX})
ELSE (WIN32) ELSE (WIN32)
install(FILES AUTHORS COPYING README THANKS NEWS DESTINATION "${CMAKE_INSTALL_PREFIX}${SHARE_INSTALL_DIR}/doc/springlobby") install(FILES AUTHORS COPYING README THANKS NEWS DESTINATION "${CMAKE_INSTALL_DOCDIR}")
install(FILES src/images/springlobby.svg DESTINATION "${CMAKE_INSTALL_PREFIX}${SHARE_INSTALL_DIR}/icons/hicolor/scalable/apps") install(FILES src/images/springlobby.svg DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons/hicolor/scalable/apps")
install(FILES src/springlobby.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}${SHARE_INSTALL_DIR}/applications") install(FILES src/springlobby.desktop DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications")
install(FILES share/freedesktop.org/springlobby.appdata.xml DESTINATION "${CMAKE_INSTALL_PREFIX}${SHARE_INSTALL_DIR}/metainfo") install(FILES share/freedesktop.org/springlobby.appdata.xml DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/metainfo")
ENDIF (WIN32) ENDIF (WIN32)


add_custom_target(pack ${CMAKE_MAKE_PROGRAM} package add_custom_target(pack ${CMAKE_MAKE_PROGRAM} package
Expand Down

0 comments on commit 6ba6be2

Please sign in to comment.