From 4c2c4b7c6d7d9b0ff0c6c1af3039ce0a105524d0 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 27 Dec 2011 03:17:37 +0100 Subject: [PATCH] Remove hardcoded install paths, port over to CMAKE_INSTALL_*DIR --- CMakeLists.txt | 3 +++ src/CMakeLists.linux.txt | 6 +++--- src/CMakeLists.txt | 6 +++--- src/breakpad/CrashReporter/CMakeLists.txt | 2 +- src/libtomahawk/CMakeLists.txt | 6 +++--- src/sip/jabber/CMakeLists.txt | 2 +- src/sip/jabber/googlewrapper/CMakeLists.txt | 2 +- src/sip/twitter/CMakeLists.txt | 2 +- src/sip/zeroconf/CMakeLists.txt | 2 +- thirdparty/libportfwd/CMakeLists.txt | 5 +++-- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1ca859c9..35d99dfd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,9 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) +# make predefined install dirs available everywhere +INCLUDE(GNUInstallDirs) + # installer creation INCLUDE( TomahawkCPack.cmake ) diff --git a/src/CMakeLists.linux.txt b/src/CMakeLists.linux.txt index ae108e4d5..e3e207fa1 100644 --- a/src/CMakeLists.linux.txt +++ b/src/CMakeLists.linux.txt @@ -2,9 +2,9 @@ FILE( GLOB _icons "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" ) FOREACH( _file ${_icons} ) STRING( REPLACE "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-" "" _res ${_file} ) STRING( REPLACE ".png" "" _res ${_res} ) - INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION share/icons/hicolor/${_res}/apps ) + INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_res}/apps ) ENDFOREACH( _file ) -INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION share/icons/hicolor/scalable/apps ) +INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps ) -INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION share/applications ) +INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38ff88e48..49162d4e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -270,12 +270,12 @@ IF( APPLE ) ENDIF(HAVE_SPARKLE) ENDIF( APPLE ) -INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION bin ) +INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install protocol file FILE( READ ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.protocol protocol ) STRING( REPLACE "/path/to/binary" # match this - "${CMAKE_INSTALL_PREFIX}/bin/tomahawk" # this is linux (kde) so pretty safe I think + "${CMAKE_INSTALL_FULL_BINDIR}/tomahawk" # this is linux (kde) so pretty safe I think edited_protocol # save in this variable "${protocol}" # from the contents of this var ) @@ -283,7 +283,7 @@ IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install IF( ${SERVICES_INSTALL_DIR} ) SET( PROTOCOL_INSTALL_DIR ${SERVICES_INSTALL_DIR} ) ELSE() - SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/kde4/services" ) + SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/kde4/services" ) ENDIF() INSTALL( FILES ${CMAKE_BINARY_DIR}/tomahawk.protocol DESTINATION ${PROTOCOL_INSTALL_DIR} ) ENDIF() diff --git a/src/breakpad/CrashReporter/CMakeLists.txt b/src/breakpad/CrashReporter/CMakeLists.txt index 5040838ef..d1944bfcc 100644 --- a/src/breakpad/CrashReporter/CMakeLists.txt +++ b/src/breakpad/CrashReporter/CMakeLists.txt @@ -22,4 +22,4 @@ ADD_EXECUTABLE( tomahawk_crash_reporter WIN32 ${crashreporter_SOURCES} ${crashre TARGET_LINK_LIBRARIES( tomahawk_crash_reporter ${QT_LIBRARIES} tomahawklib ) INCLUDE(GNUInstallDirs) -install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) +install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR}) diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index f463f62c1..ad97c6527 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -669,7 +669,7 @@ TARGET_LINK_LIBRARIES( tomahawklib ) INSTALL( TARGETS tomahawklib - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/src/sip/jabber/CMakeLists.txt b/src/sip/jabber/CMakeLists.txt index 5e5294f22..3332dea97 100644 --- a/src/sip/jabber/CMakeLists.txt +++ b/src/sip/jabber/CMakeLists.txt @@ -64,7 +64,7 @@ IF( APPLE ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) ENDIF( APPLE ) -install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} ) +install( TARGETS tomahawk_sipjabber DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if(BUILD_GUI) add_subdirectory(googlewrapper) diff --git a/src/sip/jabber/googlewrapper/CMakeLists.txt b/src/sip/jabber/googlewrapper/CMakeLists.txt index 6f9e310c7..ba0e11b55 100644 --- a/src/sip/jabber/googlewrapper/CMakeLists.txt +++ b/src/sip/jabber/googlewrapper/CMakeLists.txt @@ -29,4 +29,4 @@ target_link_libraries( tomahawk_sipgoogle tomahawklib ) -install( TARGETS tomahawk_sipgoogle DESTINATION lib${LIB_SUFFIX} ) +install( TARGETS tomahawk_sipgoogle DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/src/sip/twitter/CMakeLists.txt b/src/sip/twitter/CMakeLists.txt index f5f0e7fd4..fc6037fb2 100644 --- a/src/sip/twitter/CMakeLists.txt +++ b/src/sip/twitter/CMakeLists.txt @@ -51,4 +51,4 @@ IF( APPLE ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) ENDIF( APPLE ) -install( TARGETS tomahawk_siptwitter DESTINATION lib${LIB_SUFFIX} ) +install( TARGETS tomahawk_siptwitter DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/src/sip/zeroconf/CMakeLists.txt b/src/sip/zeroconf/CMakeLists.txt index c346cfa22..3a33cc577 100644 --- a/src/sip/zeroconf/CMakeLists.txt +++ b/src/sip/zeroconf/CMakeLists.txt @@ -42,4 +42,4 @@ IF( APPLE ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) ENDIF( APPLE ) -install( TARGETS tomahawk_sipzeroconf DESTINATION lib${LIB_SUFFIX} ) +install( TARGETS tomahawk_sipzeroconf DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/thirdparty/libportfwd/CMakeLists.txt b/thirdparty/libportfwd/CMakeLists.txt index 7c53626fc..d97f14ee8 100644 --- a/thirdparty/libportfwd/CMakeLists.txt +++ b/thirdparty/libportfwd/CMakeLists.txt @@ -48,10 +48,11 @@ ENDIF() INSTALL( TARGETS tomahawk_portfwd RUNTIME DESTINATION bin - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} BUNDLE DESTINATION library ) + #INSTALL(FILES include/portfwd/portfwddllmacro.h include/portfwd/portfwd.h DESTINATION include/portfwd) #ADD_EXECUTABLE(portfwd-demo