Make install paths relative to prepare for CPack

This commit is contained in:
Fabio Bas 2014-06-12 23:29:42 +02:00
parent dfdfe60202
commit eca318c34d
5 changed files with 24 additions and 53 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()