Commit 0d05d303 authored by eriksunden's avatar eriksunden Committed by Alexander Bock
Browse files

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
parent 6401f691
Showing with 157 additions and 24 deletions
+157 -24
......@@ -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)
apps/OpenSpace/openspace.ico

65.8 KB | W: 0px | H: 0px

apps/OpenSpace/openspace.ico

87.8 KB | W: 0px | H: 0px

apps/OpenSpace/openspace.ico
apps/OpenSpace/openspace.ico
apps/OpenSpace/openspace.ico
apps/OpenSpace/openspace.ico
  • 2-up
  • Swipe
  • Onion skin
apps/OpenSpace/openspace.png

61.2 KB | W: 0px | H: 0px

apps/OpenSpace/openspace.png

27.5 KB | W: 0px | H: 0px

apps/OpenSpace/openspace.png
apps/OpenSpace/openspace.png
apps/OpenSpace/openspace.png
apps/OpenSpace/openspace.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -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
......
#########################################################################################
# #
# 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)
\ No newline at end of file
......@@ -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 ()
\ No newline at end of file
endfunction ()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment