mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
base cpack configuaration using install commands
This commit is contained in:
parent
e6ccce6a38
commit
0463e008cf
6 changed files with 55 additions and 54 deletions
|
@ -211,6 +211,9 @@ endif()
|
||||||
|
|
||||||
set_packaging_parameters()
|
set_packaging_parameters()
|
||||||
|
|
||||||
|
# setup component categories for installer
|
||||||
|
set(APP_COMPONENT Runtime)
|
||||||
|
|
||||||
# add subdirectories for all targets
|
# add subdirectories for all targets
|
||||||
if (NOT ANDROID)
|
if (NOT ANDROID)
|
||||||
add_subdirectory(assignment-client)
|
add_subdirectory(assignment-client)
|
||||||
|
|
|
@ -10,23 +10,40 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
macro(GENERATE_INSTALLERS)
|
macro(GENERATE_INSTALLERS)
|
||||||
if (DEPLOY_PACKAGE AND WIN32)
|
include(CPackComponent)
|
||||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/package-bundle")
|
|
||||||
find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS])
|
|
||||||
if (NOT MAKENSIS_COMMAND)
|
|
||||||
message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)")
|
|
||||||
endif ()
|
|
||||||
add_custom_target(
|
|
||||||
build-package ALL
|
|
||||||
DEPENDS interface assignment-client domain-server stack-manager
|
|
||||||
COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/package-bundle
|
|
||||||
COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME}
|
|
||||||
COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples
|
|
||||||
COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY}
|
|
||||||
COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY}
|
|
||||||
COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi"
|
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties(build-package PROPERTIES EXCLUDE_FROM_ALL TRUE FOLDER "Installer")
|
if (APPLE)
|
||||||
|
install(TARGETS ${CLIENT_TARGET} BUNDLE DESTINATION bin COMPONENT ${APP_COMPONENT})
|
||||||
|
else ()
|
||||||
|
install(TARGETS ${CLIENT_TARGET} RUNTIME DESTINATION bin COMPONENT ${APP_COMPONENT})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
cpack_add_component(${APP_COMPONENT}
|
||||||
|
DISPLAY_NAME "Applications"
|
||||||
|
Description "The High Fidelity Applications"
|
||||||
|
GROUP "Runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
cpack_add_component_group(Runtime)
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
|
# if (DEPLOY_PACKAGE AND WIN32)
|
||||||
|
# file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/package-bundle")
|
||||||
|
# find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS])
|
||||||
|
# if (NOT MAKENSIS_COMMAND)
|
||||||
|
# message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)")
|
||||||
|
# endif ()
|
||||||
|
# add_custom_target(
|
||||||
|
# build-package ALL
|
||||||
|
# DEPENDS interface assignment-client domain-server stack-manager
|
||||||
|
# COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/package-bundle
|
||||||
|
# COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME}
|
||||||
|
# COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples
|
||||||
|
# COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY}
|
||||||
|
# COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY}
|
||||||
|
# COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi"
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# set_target_properties(build-package PROPERTIES EXCLUDE_FROM_ALL TRUE FOLDER "Installer")
|
||||||
|
# endif ()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
#
|
#
|
||||||
# PackageLibrariesForDeployment.cmake
|
# PackageLibrariesForDeployment.cmake
|
||||||
# cmake/macros
|
# cmake/macros
|
||||||
#
|
#
|
||||||
# Copyright 2015 High Fidelity, Inc.
|
# Copyright 2015 High Fidelity, Inc.
|
||||||
# Created by Stephen Birarda on February 17, 2014
|
# Created by Stephen Birarda on February 17, 2014
|
||||||
#
|
#
|
||||||
# Distributed under the Apache License, Version 2.0.
|
# Distributed under the Apache License, Version 2.0.
|
||||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
#
|
#
|
||||||
|
|
||||||
macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT)
|
macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
configure_file(
|
configure_file(
|
||||||
${HIFI_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in
|
${HIFI_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PLUGIN_PATH "plugins")
|
set(PLUGIN_PATH "plugins")
|
||||||
|
|
||||||
# add a post-build command to copy DLLs beside the executable
|
# add a post-build command to copy DLLs beside the executable
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${TARGET_NAME}
|
TARGET ${TARGET_NAME}
|
||||||
|
@ -29,31 +29,18 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT)
|
||||||
-DBUNDLE_PLUGIN_DIR=$<TARGET_FILE_DIR:${TARGET_NAME}>/${PLUGIN_PATH}
|
-DBUNDLE_PLUGIN_DIR=$<TARGET_FILE_DIR:${TARGET_NAME}>/${PLUGIN_PATH}
|
||||||
-P ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake
|
-P ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake
|
||||||
)
|
)
|
||||||
|
|
||||||
find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH)
|
find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH)
|
||||||
|
|
||||||
if (NOT WINDEPLOYQT_COMMAND)
|
if (NOT WINDEPLOYQT_COMMAND)
|
||||||
message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.")
|
message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# add a post-build command to call windeployqt to copy Qt plugins
|
# add a post-build command to call windeployqt to copy Qt plugins
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${TARGET_NAME}
|
TARGET ${TARGET_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND CMD /C "SET PATH=%PATH%;${QT_DIR}/bin && ${WINDEPLOYQT_COMMAND} ${EXTRA_DEPLOY_OPTIONS} $<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>,$<CONFIG:RelWithDebInfo>>:--release> $<TARGET_FILE:${TARGET_NAME}>"
|
COMMAND CMD /C "SET PATH=%PATH%;${QT_DIR}/bin && ${WINDEPLOYQT_COMMAND} ${EXTRA_DEPLOY_OPTIONS} $<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>,$<CONFIG:RelWithDebInfo>>:--release> $<TARGET_FILE:${TARGET_NAME}>"
|
||||||
)
|
)
|
||||||
elseif (DEFINED BUILD_BUNDLE AND BUILD_BUNDLE AND APPLE)
|
|
||||||
find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
if (NOT MACDEPLOYQT_COMMAND)
|
|
||||||
message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin. macdeployqt is required.")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# add a post-build command to call macdeployqt to copy Qt plugins
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${TARGET_NAME}
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND ${MACDEPLOYQT_COMMAND} ${CMAKE_CURRENT_BINARY_DIR}/\${CONFIGURATION}/${TARGET_NAME}.app -verbose 0
|
|
||||||
)
|
|
||||||
endif ()
|
endif ()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -22,11 +22,7 @@ macro(SETUP_HIFI_PROJECT)
|
||||||
endif ()
|
endif ()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if (DEFINED BUILD_BUNDLE AND BUILD_BUNDLE AND APPLE)
|
add_executable(${TARGET_NAME} ${TARGET_SRCS} ${AUTOMTC_SRC} ${AUTOSCRIBE_SHADER_LIB_SRC})
|
||||||
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${TARGET_SRCS} ${AUTOMTC_SRC} ${AUTOSCRIBE_SHADER_LIB_SRC})
|
|
||||||
else ()
|
|
||||||
add_executable(${TARGET_NAME} ${TARGET_SRCS} ${AUTOMTC_SRC} ${AUTOSCRIBE_SHADER_LIB_SRC})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include the generated application version header
|
# include the generated application version header
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/includes")
|
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/includes")
|
||||||
|
|
|
@ -5,7 +5,7 @@ if (BUILD_TAGGED_BETA)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# add a target that will package the console
|
# add a target that will package the console
|
||||||
add_custom_target(${TARGET_NAME}
|
add_custom_target(${TARGET_NAME} ALL
|
||||||
COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${BETA_OPTION}
|
COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${BETA_OPTION}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
@ -19,6 +19,6 @@ elseif (UNIX)
|
||||||
set(PACKAGED_CONSOLE_FOLDER "server-console-linux-x64")
|
set(PACKAGED_CONSOLE_FOLDER "server-console-linux-x64")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE FOLDER "Installer")
|
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/Server Console.app" DESTINATION bin COMPONENT ${APP_COMPONENT})
|
||||||
|
|
||||||
consolidate_installer_components()
|
consolidate_installer_components()
|
||||||
|
|
|
@ -203,11 +203,8 @@ if (APPLE)
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} ${OpenGL} ${AppKit})
|
target_link_libraries(${TARGET_NAME} ${OpenGL} ${AppKit})
|
||||||
|
|
||||||
# install command for OS X bundle
|
# setup install of OS X interface bundle
|
||||||
INSTALL(TARGETS ${TARGET_NAME}
|
install(TARGETS ${TARGET_NAME} BUNDLE DESTINATION bin COMPONENT ${APP_COMPONENT})
|
||||||
BUNDLE DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime
|
|
||||||
RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime
|
|
||||||
)
|
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
# copy the resources files beside the executable
|
# copy the resources files beside the executable
|
||||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||||
|
@ -219,11 +216,12 @@ else (APPLE)
|
||||||
$<TARGET_FILE_DIR:${TARGET_NAME}>/scripts
|
$<TARGET_FILE_DIR:${TARGET_NAME}>/scripts
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# setup install of interface target
|
||||||
|
install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin COMPONENT ${APP_COMPONENT})
|
||||||
|
|
||||||
# link target to external libraries
|
# link target to external libraries
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(${TARGET_NAME} wsock32.lib Winmm.lib)
|
target_link_libraries(${TARGET_NAME} wsock32.lib Winmm.lib)
|
||||||
else (WIN32)
|
|
||||||
# Nothing else required on linux apparently
|
|
||||||
endif()
|
endif()
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue