8

I need to create installer for a product for Mac OS X using CPack with PackageMaker as the generator. I have done some small work, but I have many things that I want to find out.

set(CPACK_PACKAGE_NAME "MyApp")
  set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") 
  set(CMAKE_INSTALL_PREFIX /Applications)
  set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
  set(CPACK_RESOURCE_FILE_README "${PACKAGE_BINARY_DIR}/Readme.txt")
  set(CPACK_RESOURCE_FILE_LICENSE "${PACKAGE_BINARY_DIR}/EULA.txt")   
  set(CPACK_RESOURCE_FILE_WELCOME "${PACKAGE_BINARY_DIR}/Welcome.txt")
  set(CPACK_GENERATOR PackageMaker)

  install(DIRECTORY ${PACKAGE_BINARY_DIR}/my_app.app DESTINATION ${CMAKE_INSTALL_PREFIX}/)
  install(PROGRAMS ${PACKAGE_BINARY_DIR}/other_executable DESTINATION ${CMAKE_INSTALL_PREFIX}/my_app.app/Contents/MacOS/)
  install(FILES ${PACKAGE_BINARY_DIR}/com.my_app.my_app_daemon.plist DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)

Can you explain how to:

  1. How to add custom icon to my application (the one when you open Applications directory)?
  2. How to add a custom background to the visual installer?
  3. How to properly use the flags for post installer scripts so that the scripts will be working?
  4. What is the best way to add "other_executable" to my application?
  5. Am I using the proper way to install my_app.app?
  6. How to add shortcut (or whatever else is used, of my application to the Dock)?
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
nikolakoco
  • 1,343
  • 1
  • 12
  • 22
  • 1 and 2 are answered here, works fine; just got through properties: - [CPack module](https://cmake.org/cmake/help/v3.11/module/CPack.html#) and - [CPackPackageMaker](https://cmake.org/cmake/help/v3.11/module/CPackPackageMaker.html) – Ľubomír Carik Apr 23 '18 at 00:06

0 Answers0