mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-01 09:08:49 -06:00
Feature/packaging (#333)
* Added proper CPACK structure and added generation of openspace.h header to add verisoning information in CMake. * Packaging(ZIP on Windows, TGZ on UNIX) and installer creation(Windows Only via NSIS) is now working. * Fixes for packing an archive on OSX. * Add missing files in packaging Add install setting to the globebrowsing module to copy required gdal_data Update Credits * Updated application icon
This commit is contained in:
committed by
Alexander Bock
parent
6401f691b9
commit
0d05d30396
@@ -27,6 +27,11 @@ cmake_minimum_required (VERSION 3.4 FATAL_ERROR)
|
||||
project (OpenSpace)
|
||||
message(STATUS "Generating OpenSpace project")
|
||||
|
||||
set(OPENSPACE_VERSION_MAJOR 0)
|
||||
set(OPENSPACE_VERSION_MINOR 8)
|
||||
set(OPENSPACE_VERSION_PATCH 0)
|
||||
set(OPENSPACE_VERSION_STRING "prerelease-13 (Earth Day)")
|
||||
|
||||
set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}")
|
||||
set(OPENSPACE_APPS_DIR "${OPENSPACE_BASE_DIR}/apps")
|
||||
set(OPENSPACE_EXT_DIR "${OPENSPACE_BASE_DIR}/ext")
|
||||
@@ -59,3 +64,5 @@ handle_option_tests()
|
||||
|
||||
handle_internal_modules()
|
||||
copy_dynamic_libraries()
|
||||
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/packaging.cmake)
|
||||
|
||||
@@ -21,6 +21,8 @@ Rickard Lindtstedt
|
||||
Michael Sjöström
|
||||
Michael Novén
|
||||
Oskar Carlbaum
|
||||
Jonathas Bosson
|
||||
Klas Eskilson
|
||||
|
||||
Anteige
|
||||
noahdasanaike
|
||||
|
||||
@@ -65,12 +65,12 @@ target_link_libraries(${APPLICATION_NAME}
|
||||
Qt5::Network
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
INSTALL(CODE "
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"/Users/alex/Development/OpenSpace/bin/openspace/Debug/Launcher.app/Contents/MacOS/Launcher\" \"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
endif ()
|
||||
#if (APPLE)
|
||||
# INSTALL(CODE "
|
||||
# include(BundleUtilities)
|
||||
# fixup_bundle(\"${application_path}/bin/openspace/Debug/Launcher.app/Contents/MacOS/Launcher\" \"${application_path}/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
# " COMPONENT Runtime)
|
||||
#endif ()
|
||||
|
||||
# Libtorrent
|
||||
include_external_library(${APPLICATION_NAME} libtorrent ${application_path}/ext/libtorrent)
|
||||
|
||||
@@ -231,8 +231,8 @@ else()
|
||||
set(LIBDIR "lib")
|
||||
endif()
|
||||
|
||||
install(TARGETS libtorrent DESTINATION ${LIBDIR})
|
||||
install(DIRECTORY include/libtorrent
|
||||
DESTINATION include
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtorrent-rasterbar.pc DESTINATION ${LIBDIR}/pkgconfig)
|
||||
#install(TARGETS libtorrent DESTINATION ${LIBDIR})
|
||||
#install(DIRECTORY include/libtorrent
|
||||
# DESTINATION include
|
||||
# PATTERN ".svn" EXCLUDE)
|
||||
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtorrent-rasterbar.pc DESTINATION ${LIBDIR}/pkgconfig)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 88 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 28 KiB |
@@ -55,9 +55,9 @@ target_link_libraries(${APPLICATION_NAME}
|
||||
Qt5::Network
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
INSTALL(CODE "
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/MacOS/TimelineView\" \"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
endif ()
|
||||
#if (APPLE)
|
||||
# INSTALL(CODE "
|
||||
# include(BundleUtilities)
|
||||
# fixup_bundle(\"${application_path}/bin/openspace/Debug/Launcher.app/Contents/MacOS/Launcher\" \"${application_path}/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
# " COMPONENT Runtime)
|
||||
#endif ()
|
||||
|
||||
@@ -224,6 +224,8 @@ create_new_module(
|
||||
|
||||
option(OPENSPACE_MODULE_GLOBEBROWSING_USE_GDAL "Use GDAL" ON)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gdal_data DESTINATION modules/globebrowsing)
|
||||
|
||||
if (OPENSPACE_MODULE_GLOBEBROWSING_USE_GDAL)
|
||||
if (WIN32)
|
||||
target_include_directories(
|
||||
|
||||
@@ -164,7 +164,6 @@ set(OPENSPACE_SOURCE
|
||||
)
|
||||
|
||||
set(OPENSPACE_HEADER
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/openspace.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/documentation/core_registration.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/documentation/documentation.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/documentation/documentationengine.h
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
namespace openspace {
|
||||
|
||||
std::string licenseText();
|
||||
|
||||
const int OPENSPACE_VERSION_MAJOR = @OPENSPACE_VERSION_MAJOR@;
|
||||
const int OPENSPACE_VERSION_MINOR = @OPENSPACE_VERSION_MINOR@;
|
||||
const int OPENSPACE_VERSION_PATCH = @OPENSPACE_VERSION_PATCH@;
|
||||
|
||||
const int OPENSPACE_VERSION_MAJOR = 0;
|
||||
const int OPENSPACE_VERSION_MINOR = 8;
|
||||
const int OPENSPACE_VERSION_PATCH = 0;
|
||||
|
||||
const std::string OPENSPACE_VERSION_STRING = "prerelease-13 (Earth Day)";
|
||||
const std::string OPENSPACE_VERSION_STRING = "@OPENSPACE_VERSION_STRING@";
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
114
support/cmake/packaging.cmake
Normal file
114
support/cmake/packaging.cmake
Normal file
@@ -0,0 +1,114 @@
|
||||
#########################################################################################
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2017 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
# without restriction, including without limitation the rights to use, copy, modify, #
|
||||
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the following #
|
||||
# conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in all copies #
|
||||
# or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, #
|
||||
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A #
|
||||
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF #
|
||||
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE #
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
#########################################################################################
|
||||
|
||||
set(CPACK_MONOLITHIC_INSTALL TRUE)
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
set(CPACK_PACKAGE_NAME "OpenSpace")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${OPENSPACE_BASE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${OPENSPACE_BASE_DIR}/LICENSE.md")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${OPENSPACE_VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${OPENSPACE_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${OPENSPACE_VERSION_PATCH}")
|
||||
set(OPENSPACE_VERSION_NUMBER
|
||||
"${OPENSPACE_VERSION_MAJOR}.${OPENSPACE_VERSION_MINOR}.${OPENSPACE_VERSION_PATCH}"
|
||||
)
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenSpace ${OPENSPACE_VERSION_NUMBER}")
|
||||
set(CPACK_PACKAGE_FILE_NAME
|
||||
"${CPACK_PACKAGE_NAME} ${OPENSPACE_VERSION_NUMBER} ${OPENSPACE_VERSION_STRING}"
|
||||
)
|
||||
set(CPACK_STRIP_FILES 1)
|
||||
|
||||
install(DIRECTORY
|
||||
${OPENSPACE_BASE_DIR}/bin/openspace/${CMAKE_BUILD_TYPE}/
|
||||
DESTINATION bin
|
||||
USE_SOURCE_PERMISSIONS
|
||||
)
|
||||
install(DIRECTORY ${OPENSPACE_BASE_DIR}/config/ DESTINATION config)
|
||||
|
||||
install(DIRECTORY ${OPENSPACE_BASE_DIR}/data/ DESTINATION data)
|
||||
|
||||
install(DIRECTORY ${OPENSPACE_BASE_DIR}/modules/
|
||||
DESTINATION modules
|
||||
FILES_MATCHING
|
||||
PATTERN "*.glsl"
|
||||
PATTERN "*.hglsl"
|
||||
PATTERN "*.fs"
|
||||
PATTERN "*.vs"
|
||||
PATTERN "*.lua"
|
||||
)
|
||||
install(DIRECTORY ${OPENSPACE_BASE_DIR}/scripts/ DESTINATION scripts)
|
||||
install(DIRECTORY ${OPENSPACE_BASE_DIR}/shaders/ DESTINATION shaders)
|
||||
|
||||
install(FILES
|
||||
${OPENSPACE_BASE_DIR}/openspace.cfg
|
||||
${OPENSPACE_BASE_DIR}/CREDITS.md
|
||||
${OPENSPACE_BASE_DIR}/LICENSE.md
|
||||
${OPENSPACE_BASE_DIR}/README.md
|
||||
DESTINATION .
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
# Need backslash for correct subdirectory paths
|
||||
set(CPACK_PACKAGE_ICON "${OPENSPACE_BASE_DIR}\\\\apps\\\\OpenSpace\\\\openspace.png")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}\\\\${OPENSPACE_VERSION_NUMBER} ${OPENSPACE_VERSION_STRING}")
|
||||
else()
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
set(CPACK_PACKAGE_ICON "${OPENSPACE_BASE_DIR}/apps/OpenSpace/openspace.png")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}/${OPENSPACE_VERSION_NUMBER} ${OPENSPACE_VERSION_STRING}")
|
||||
endif()
|
||||
|
||||
option(OPENSPACE_CREATE_INSTALLER "Create an OpenSpace installer from the package" OFF)
|
||||
|
||||
if(OPENSPACE_CREATE_INSTALLER)
|
||||
set(CPACK_PACKAGE_EXECUTABLES "openspace;OpenSpace")
|
||||
if(WIN32)
|
||||
set(CPACK_GENERATOR "ZIP;NSIS")
|
||||
# OpenSpace does NOT seem to handle C:/Program Files/ without crashing
|
||||
set(CPACK_NSIS_INSTALL_ROOT "C:")
|
||||
# There is a bug in NSI that does not handle full unix paths properly. Make
|
||||
# sure there is at least one set of four (4) backlashes.
|
||||
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_FILE_NAME}")
|
||||
# Create the desktop link
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut '$DESKTOP\\\\${CPACK_NSIS_DISPLAY_NAME}.lnk' '$INSTDIR\\\\bin\\\\OpenSpace.exe' ")
|
||||
# Delete the desktop link
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete '$DESKTOP\\\\${CPACK_NSIS_DISPLAY_NAME}.lnk' ")
|
||||
# The icon to start the application.
|
||||
set(CPACK_NSIS_MUI_ICON "${OPENSPACE_BASE_DIR}\\\\apps\\\\OpenSpace\\\\openspace.ico")
|
||||
# Add a link to the application website in the startup menu.
|
||||
set(CPACK_NSIS_MENU_LINKS "http://openspaceproject.com/" "OpenSpace Homepage")
|
||||
# Set the icon for the application in the Add/Remove programs section.
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\OpenSpace.exe")
|
||||
# The mail address for the maintainer of the application in the Add/Remove programs section
|
||||
set(CPACK_NSIS_CONTACT alexander.bock@liu.se)
|
||||
# The url of the application in the Add/Remove programs section
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://openspaceproject.com/")
|
||||
# Help URL
|
||||
set(CPACK_NSIS_HELP_LINK "http://openspaceproject.com/")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
@@ -58,6 +58,12 @@ function (create_openspace_target)
|
||||
target_include_directories(libOpenSpace PUBLIC ${OPENSPACE_BASE_DIR})
|
||||
target_include_directories(libOpenSpace PUBLIC ${CMAKE_BINARY_DIR}/_generated/include)
|
||||
|
||||
configure_file(
|
||||
${OPENSPACE_CMAKE_EXT_DIR}/openspace_header.template
|
||||
${CMAKE_BINARY_DIR}/_generated/include/openspace/openspace.h
|
||||
@ONLY IMMEDIATE
|
||||
)
|
||||
|
||||
set_compile_settings(libOpenSpace)
|
||||
endfunction ()
|
||||
|
||||
@@ -355,6 +361,7 @@ function (handle_option_tests)
|
||||
endfunction ()
|
||||
|
||||
|
||||
|
||||
function (handle_internal_modules)
|
||||
# Get all modules in the correct order based on their dependencies
|
||||
file(GLOB moduleDirs RELATIVE ${OPENSPACE_MODULE_DIR} ${OPENSPACE_MODULE_DIR}/*)
|
||||
@@ -508,6 +515,8 @@ function (handle_internal_modules)
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
|
||||
|
||||
function (copy_dynamic_libraries)
|
||||
if (WIN32)
|
||||
ghl_copy_files(OpenSpace "${CURL_ROOT_DIR}/lib/libcurl.dll")
|
||||
@@ -519,4 +528,4 @@ function (copy_dynamic_libraries)
|
||||
ghl_copy_shared_libraries(OpenSpaceTest ${OPENSPACE_EXT_DIR}/ghoul)
|
||||
endif ()
|
||||
endif ()
|
||||
endfunction ()
|
||||
endfunction ()
|
||||
|
||||
Reference in New Issue
Block a user