Skip to content

Commit

Permalink
Merge pull request #749 from openstudiocoalition/improve_installer
Browse files Browse the repository at this point in the history
Improve installer
  • Loading branch information
jmarrec authored Sep 5, 2024
2 parents c658cda + 53e271e commit fee5274
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,20 @@ endif()
# Leaving it
set(CPACK_IFW_VERBOSE ON)

set(CPACK_PACKAGE_VENDOR "OpenStudio Coalition")
set(CPACK_PACKAGE_VENDOR "OpenStudio Coalition") # CPACK_IFW_PACKAGE_PUBLISHER is set from this

# These are ok, even if we have a prerelease tag
set(CPACK_PACKAGE_VERSION_MAJOR ${OpenStudioApplication_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${OpenStudioApplication_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${OpenStudioApplication_VERSION_PATCH})

# CPACK_DEBIAN_PACKAGE_DESCRIPTION defaults to this one too. dpkg-deb -I xxx.deb will show this description
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenStudioApplication ${OpenStudioApplication_VERSION}, based on openstudio (core) ${OPENSTUDIO_VERSION}. OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenStudioApplication ${OpenStudioApplication_VERSION} is a Graphical User Interface for OpenStudio")
set(CPACK_PACKAGE_DESCRIPTION "OpenStudioApplication ${OpenStudioApplication_VERSION}, based on openstudio (core) ${OPENSTUDIO_VERSION}. OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance")

set(CPACK_IFW_PACKAGE_TITLE "OpenStudioApplication ${OpenStudioApplication_VERSION}")
set(CPACK_IFW_PRODUCT_URL "https://openstudiocoalition.org")
set(CPACK_IFW_PACKAGE_WINDOW_ICON "${PROJECT_SOURCE_DIR}/icons/os_32.png")

# The actual package file name on disk
if(APPLE)
Expand All @@ -836,13 +842,21 @@ endif()

set(CPACK_PACKAGE_CONTACT "[email protected]")

# Install additional Documents, such as release notes
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_GPL_3_0.txt" DESTINATION .)
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_LGPL_3_0.txt" DESTINATION .)
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION .)
# Install additional Documents, such as release notes
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_GPL_3_0.txt" DESTINATION . COMPONENT Licenses)
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_LGPL_3_0.txt" DESTINATION . COMPONENT Licenses)
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION . COMPONENT Licenses)

# Not sure whether we want a "Accept license" box in the IFW installer or not...
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.md")
# set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/release/readme.html")

if (APPLE)
set(CPACK_IFW_TARGET_DIRECTORY /Applications/OpenStudioApplication-${OpenStudioApplication_VERSION}/)
# Custom installer icon. Has to be .icns on mac, .ico on windows, not supported on Unix
set(CPACK_IFW_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icons/os.icns")
# Launch OpenStudioApp at end of install
set(CPACK_IFW_PACKAGE_RUN_PROGRAM "@TargetDir@/OpenStudioApp.app/Contents/MacOS/OpenStudioApp")
elseif(UNIX)

# For debug
Expand Down Expand Up @@ -932,6 +946,12 @@ elseif(WIN32)
set(CPACK_IFW_TARGET_DIRECTORY "C:/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
set(CPACK_BINARY_IFW ON CACHE BOOL "Enable to build IFW packages")
set(CPACK_BINARY_NSIS OFF CACHE BOOL "Enable to build NSIS packages")

# Custom installer icon. Has to be .icns on mac, .ico on windows, not supported on Unix
set(CPACK_IFW_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icons/os.ico")

# Launch OpenStudioApp at end of install
set(CPACK_IFW_PACKAGE_RUN_PROGRAM "@TargetDir@/bin/OpenStudioApp")
endif()


Expand Down Expand Up @@ -988,6 +1008,7 @@ cpack_add_component(Resources
cpack_add_component(OpenStudioApp
DISPLAY_NAME "OpenStudio Application"
DESCRIPTION "OpenStudio Application"
REQUIRED
)

cpack_ifw_configure_component(Resources
Expand Down Expand Up @@ -1017,6 +1038,19 @@ cpack_add_component(RubyAPI
DESCRIPTION "The Ruby openstudio modeleditor for Sketchup"
)

cpack_add_component(
Licenses
DISPLAY_NAME "Licenses"
DESCRIPTION "License files for OpenStudio Application"
REQUIRED
HIDDEN
)

cpack_ifw_configure_component(Licenses
FORCED_INSTALLATION
LICENSES "OpenStudio Application" ${CPACK_RESOURCE_FILE_LICENSE}
)

add_custom_target(PACKAGE_DEBUG
COMMAND ${CMAKE_CPACK_COMMAND} --debug --verbose --config CPackConfig.cmake
COMMENTS "Build package with debug and verbose output"
Expand Down

0 comments on commit fee5274

Please sign in to comment.