From eca318c34d0f166f28f69eaa227f779675c51810 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 12 Jun 2014 23:29:42 +0200 Subject: [PATCH] Make install paths relative to prepare for CPack --- cockatrice/CMakeLists.txt | 12 ++++++------ oracle/CMakeLists.txt | 12 ++++++------ servatrice/CMakeLists.txt | 41 ++++++--------------------------------- sounds/CMakeLists.txt | 6 +++--- zonebg/CMakeLists.txt | 6 +++--- 5 files changed, 24 insertions(+), 53 deletions(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index 38497e53..38df523e 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -159,13 +159,13 @@ TARGET_LINK_LIBRARIES(cockatrice cockatrice_common ${QT_LIBRARIES} ${QT_MOBILITY if(UNIX) if(APPLE) - INSTALL(TARGETS cockatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS cockatrice BUNDLE DESTINATION ./) else() # Assume linux - INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + INSTALL(TARGETS cockatrice RUNTIME DESTINATION bin/) endif() elseif(WIN32) - INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS cockatrice RUNTIME DESTINATION ./) endif() if (NOT WIN32 AND NOT APPLE) @@ -181,8 +181,8 @@ add_custom_command( ) if(APPLE) - set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Plugins) - set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Resources) + set(plugin_dest_dir ./cockatrice.app/Contents/Plugins) + set(qtconf_dest_dir ./cockatrice.app/Contents/Resources) # note: no codecs in qt5 # note: phonon_backend => mediaservice @@ -205,6 +205,6 @@ Plugins = Plugins\") file(GLOB_RECURSE QTPLUGINS \"${plugin_dest_dir}/*.dylib\") include(BundleUtilities) - fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") " COMPONENT Runtime) endif() diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 6ed1f327..340ce16a 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -29,13 +29,13 @@ TARGET_LINK_LIBRARIES(oracle ${QT_LIBRARIES}) if(UNIX) if(APPLE) - INSTALL(TARGETS oracle BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS oracle BUNDLE DESTINATION ./) else() # Assume linux - INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + INSTALL(TARGETS oracle RUNTIME DESTINATION bin/) endif() elseif(WIN32) - INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS oracle RUNTIME DESTINATION ./) endif() IF (NOT WIN32 AND NOT APPLE) @@ -43,8 +43,8 @@ IF (NOT WIN32 AND NOT APPLE) ENDIF (NOT WIN32 AND NOT APPLE) if(APPLE) - set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Plugins) - set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Resources) + set(plugin_dest_dir ./oracle.app/Contents/Plugins) + set(qtconf_dest_dir ./oracle.app/Contents/Resources) # note: no codecs in qt5 # note: phonon_backend => mediaservice @@ -67,6 +67,6 @@ Plugins = Plugins\") file(GLOB_RECURSE QTPLUGINS \"${plugin_dest_dir}/*.dylib\") include(BundleUtilities) - fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") " COMPONENT Runtime) endif() diff --git a/servatrice/CMakeLists.txt b/servatrice/CMakeLists.txt index 95f24e33..799cecbd 100644 --- a/servatrice/CMakeLists.txt +++ b/servatrice/CMakeLists.txt @@ -45,18 +45,18 @@ add_custom_command( # install rules if(UNIX) if(APPLE) - INSTALL(TARGETS servatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS servatrice BUNDLE DESTINATION ./) else() # Assume linux - INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + INSTALL(TARGETS servatrice RUNTIME DESTINATION bin/) endif() elseif(WIN32) - INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS servatrice RUNTIME DESTINATION ./) endif() if(APPLE) - set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Plugins) - set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Resources) + set(plugin_dest_dir ./servatrice.app/Contents/Plugins) + set(qtconf_dest_dir ./servatrice.app/Contents/Resources) # note: no codecs in qt5 # note: phonon_backend => mediaservice @@ -79,35 +79,6 @@ Plugins = Plugins\") file(GLOB_RECURSE QTPLUGINS \"${plugin_dest_dir}/*.dylib\") include(BundleUtilities) - fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") " COMPONENT Runtime) endif() - -if(APPLE) - set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Plugins) - set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Resources) - - # note: no codecs in qt5 - # note: phonon_backend => mediaservice - # note: needs platform on osx - - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") - else() - install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib") - endif() - - install(CODE " - file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths] -Plugins = Plugins\") - " COMPONENT Runtime) - - install(CODE " - file(GLOB_RECURSE QTPLUGINS - \"${plugin_dest_dir}/*.dylib\") - include(BundleUtilities) - fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") - " COMPONENT Runtime) -endif() \ No newline at end of file diff --git a/sounds/CMakeLists.txt b/sounds/CMakeLists.txt index 14b83b60..e38c9090 100644 --- a/sounds/CMakeLists.txt +++ b/sounds/CMakeLists.txt @@ -6,11 +6,11 @@ FILE(GLOB sounds "${CMAKE_CURRENT_SOURCE_DIR}/*.raw") if(UNIX) if(APPLE) - INSTALL(FILES ${sounds} DESTINATION ${CMAKE_INSTALL_PREFIX}/sounds) + INSTALL(FILES ${sounds} DESTINATION sounds/) else() # Assume linux - INSTALL(FILES ${sounds} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cockatrice/sounds) + INSTALL(FILES ${sounds} DESTINATION share/cockatrice/sounds/) endif() elseif(WIN32) - INSTALL(FILES ${sounds} DESTINATION ${CMAKE_INSTALL_PREFIX}/sounds) + INSTALL(FILES ${sounds} DESTINATION sounds/) endif() \ No newline at end of file diff --git a/zonebg/CMakeLists.txt b/zonebg/CMakeLists.txt index 4478238f..961c4e12 100644 --- a/zonebg/CMakeLists.txt +++ b/zonebg/CMakeLists.txt @@ -6,11 +6,11 @@ FILE(GLOB zonebg "${CMAKE_CURRENT_SOURCE_DIR}/*.*") if(UNIX) if(APPLE) - INSTALL(FILES ${zonebg} DESTINATION ${CMAKE_INSTALL_PREFIX}/zonebg) + INSTALL(FILES ${zonebg} DESTINATION zonebg/) else() # Assume linux - INSTALL(FILES ${zonebg} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cockatrice/zonebg) + INSTALL(FILES ${zonebg} DESTINATION share/cockatrice/zonebg/) endif() elseif(WIN32) - INSTALL(FILES ${zonebg} DESTINATION ${CMAKE_INSTALL_PREFIX}/zonebg) + INSTALL(FILES ${zonebg} DESTINATION zonebg/) endif() \ No newline at end of file