CPackConfiguration.cmake 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plex Media Player")
  2. set(CPACK_PACKAGE_VENDOR "Plex")
  3. set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
  4. set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
  5. set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_NANO})
  6. if(APPLE)
  7. set(CPACK_SYSTEM_NAME "macosx-x86_64")
  8. elseif(WIN32)
  9. set(CPACK_SYSTEM_NAME "windows-x86_64")
  10. else()
  11. set(CPACK_SYSTEM_NAME linux-${CMAKE_HOST_SYSTEM_PROCESSOR})
  12. endif()
  13. set(CPACK_PACKAGE_FILE_NAME "PlexMediaPlayer-${VERSION_STRING}-${CPACK_SYSTEM_NAME}")
  14. set(CPACK_SOURCE_PACKAGE_FILE_NAME "PlexMediaPlayer-${VERSION_STRING}-src")
  15. set(CPACK_PACKAGE_INSTALL_DIRECTORY "PlexMediaPlayer")
  16. set(CPACK_STRIP_FILES 1)
  17. set(CPACK_GENERATOR "ZIP")
  18. if(WIN32)
  19. list(APPEND CPACK_GENERATOR "IFW")
  20. endif(WIN32)
  21. # config IFW
  22. set(CPACK_IFW_FRAMEWORK_VERSION 2.0.1)
  23. set(CPACK_IFW_PACKAGE_NAME "Plex Media Player")
  24. set(CPACK_IFW_PACKAGE_START_MENU_DIRECTORY "Plex Media Player")
  25. set(CPACK_IFW_PACKAGE_TITLE "Plex Media Player Installer")
  26. set(CPACK_IFW_PACKAGE_PUBLISHER "Plex")
  27. set(CPACK_IFW_PRODUCT_URL "https://plex.tv")
  28. set(CPACK_IFW_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/bundle/win/Plex.ico)
  29. set(CPACK_IFW_PACKAGE_WINDOW_ICON ${CMAKE_SOURCE_DIR}/resources/images/icon.png)
  30. set(CPACK_IFW_TARGET_DIRECTORY "C:/Program Files/PlexMediaPlayer")
  31. if(APPLE)
  32. set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
  33. endif(APPLE)
  34. configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/CPackGeneratedConfig.cmake.in ${CMAKE_BINARY_DIR}/CPackGeneratedConfig.cmake)
  35. set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackGeneratedConfig.cmake)
  36. include(CPack)
  37. cpack_add_component(Core DISPLAY_NAME "Plex Media Player" DESCRIPTION "Plex Media Player (Core Application)" REQUIRED)
  38. # borrowed from https://github.com/peersafe/PeerSafe/blob/master/cmake_modules/package.cmake
  39. if(WIN32)
  40. string(REPLACE "." "" VCVER $ENV{VisualStudioVersion})
  41. if(MSVC)
  42. if(CMAKE_CL_64)
  43. set(VC_RUNTIME_DIR "$ENV{VCInstallDir}/redist/x64/Microsoft.VC${VCVER}.CRT")
  44. else()
  45. set(VC_RUNTIME_DIR "$ENV{VCInstallDir}/redist/x86/Microsoft.VC${VCVER}.CRT")
  46. endif()
  47. find_file(MSVCP NAMES msvcp${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
  48. #find_file(MSVCR NAMES msvcr${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
  49. find_file(VCCORLIB NAMES vccorlib${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
  50. if(NOT MSVCP)
  51. set(ERROR_MESSAGE "\nCould not find library msvcp${VCVER}.dll.\nRun cmake from a Visual Studio Command Prompt.")
  52. message(FATAL_ERROR "${ERROR_MESSAGE}")
  53. endif()
  54. endif()
  55. install(FILES ${MSVCP} ${VCCORLIB} DESTINATION .)
  56. endif()
  57. if(WIN32 AND DEFINED DEPENDENCY_ROOT)
  58. install(FILES ${CMAKE_SOURCE_DIR}/bundle/win/qt.conf DESTINATION .)
  59. #add_custom_command(TARGET package POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd ${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.exe WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
  60. # group/component configuration
  61. include(CPackIFW)
  62. cpack_ifw_configure_component(Core PRIORITY 1 SCRIPT ${CMAKE_SOURCE_DIR}/bundle/win/shortcut.qs)
  63. endif(WIN32 AND DEFINED DEPENDENCY_ROOT)