Commit a705121e authored by Mohcine Chraibi's avatar Mohcine Chraibi

cpack for windows

parent 6d23e1fb
Pipeline #13469 failed with stages
in 12 seconds
......@@ -84,7 +84,13 @@ if(APPLE AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
endif()
message(STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
if(CMAKE_VERSION GREATER_EQUAL "3.6")
if(WIN32)
if(MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT jpsvis)
endif()
endif()
endif()
#--------------------
if (NOT MSVC)
include(CheckCXXCompilerFlag)
......@@ -278,6 +284,13 @@ if(${QT4_INSTALLED})
TARGET_LINK_LIBRARIES( jpseditor ${QT_LIBRARIES})
elseif( ${QT5_INSTALLED})
message(STATUS "Working with Qt5")
get_target_property(QtCore_location Qt5::Core LOCATION)
get_target_property(QtWidgets_location Qt5::Widgets LOCATION)
get_target_property(QtGui_location Qt5::Gui LOCATION)
message(STATUS "QtCore_location: ${QtCore_location}")
message(STATUS "QtWidgets_location: ${QtWidgets_location}")
message(STATUS "QtGui_location: ${QtGui_location}")
# http://www.kdab.com/using-cmake-with-qt-5/
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}" )
......@@ -362,6 +375,18 @@ INSTALL(TARGETS jpseditor
# PERMISSIONS OWNER_EXECUTE 600
)
install(TARGETS jpseditor
DESTINATION bin
COMPONENT applications)
if(CMAKE_VERSION GREATER_EQUAL "3.6")
if(WIN32)
if(MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT jpseditor)
endif()
endif()
endif()
#--------------------------------------------------------------------------------
# Install needed Qt plugins by copying directories from the qt installation
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
......@@ -414,88 +439,115 @@ endif()
#================================================ APPLE Stuff ======================
set(DEMOS_DIR "examples")
set(DEMO1_DIR "${DEMOS_DIR}/1_tutorial")
set(DEMO2_DIR "${DEMOS_DIR}/2_mixedusage")
set(DEMO3_DIR "${DEMOS_DIR}/3_bottleneck")
file(GLOB CT_FILES "${CMAKE_SOURCE_DIR}/${DEMO1_DIR}/*")
file(GLOB CT_FILES2 "${CMAKE_SOURCE_DIR}/${DEMO2_DIR}/*")
file(GLOB CT_FILES3 "${CMAKE_SOURCE_DIR}/${DEMO3_DIR}/*")
install(TARGETS jpseditor
DESTINATION bin
COMPONENT applications)
install(DIRECTORY DESTINATION ${DEMO1_DIR})
install(DIRECTORY DESTINATION ${DEMO2_DIR})
install(FILES ${CT_FILES}
DESTINATION ${DEMO1_DIR}
COMPONENT demos)
install(FILES ${CT_FILES2}
DESTINATION ${DEMO2_DIR}
COMPONENT demos)
install(FILES ${SCRIPT_FILES}
DESTINATION ${DEMO3_DIR}
COMPONENT demos)
set(CPACK_BINARY_DRAGNDROP ON)
if(WIN32 AND NOT UNIX)
message(STATUS "Package generation ............................ Windows")
set(CPACK_GENERATOR "NSIS")
find_program(NSIS_PATH nsis PATH_SUFFIXES nsis)
if(NSIS_PATH)
set(CPACK_GENERATOR "${CPACK_GENERATOR};NSIS")
message(STATUS "NSIS .......................................... YES ")
else(NSIS_PATH)
message(STATUS "NSIS .......................................... NO ")
endif(NSIS_PATH)
#CPACK_NSIS_URL_INFO_ABOUT
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
#set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
# message(STATUS "System Dependencies: " ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION sys
COMPONENT applications)
install(FILES ${QtCore_location}
${QtXml_location}
${QtWidgets_location}
${QtNetwork_location}
${QtGui_location}
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/zlib1.dll"
Please register or sign in to reply
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/libpng16.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/harfbuzz.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/pcre2-16.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/double-conversion.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/glib-2.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/freetype.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/libbz2.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/libiconv.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/pcre.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/libintl.dll"
"C:/Users/chraibi/vcpkg/installed/x86-windows/bin/libcharset.dll"
DESTINATION bin
COMPONENT applications)
endif()
IF(APPLE)
# set how it shows up in the Info.plist file
SET(MACOSX_EDIT_ICON jupedsim.icns)
set_target_properties(jpseditor PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Info.plist.in)
SET(MACOSX_BUNDLE_COPYRIGHT "Copyright (c) 2015 Forschungszentrum Juelich. All rights reserved.")
SET(MACOSX_BUNDLE_BUNDLE_NAME "jpseditor")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${JPSEDITOR_VERSION}")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "version ${JPSEDITOR_VERSION}")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${JPSEDITOR_VERSION}")
SET(MACOSX_EDIT_COPYRIGHT "Copyright (c) 2015 Forschungszentrum Juelich. All rights reserved.")
SET(MACOSX_BUNDLE_EDIT_IDENTIFIER "www.jupedsim.org")
# set where in the bundle to put the icns file
ENDIF(APPLE)
# To Create a package, one can run "cpack -G DragNDrop CPackConfig.cmake" on Mac OS X
# where CPackConfig.cmake is created by including CPack
# And then there's ways to customize this as well
# https://github.com/mikemcquaid/Fabula
set(CPACK_BINARY_DRAGNDROP ON)
set(CPACK_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION_MAJOR "${JPSEDITOR_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${JPSEDITOR_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${JPSEDITOR_version_patch}")
set(CPACK_PACKAGE_VERSION "${JPSEDITOR_VERSION}")
set(CPACK_PACKAGE_VENDOR "${JPSEDITOR_VENDOR}")
set(CPACK_RESOURCE_FILE_README "${README_FILE}")
if(WIN32) # todo test this for windows
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME} ${JPSEDITOR_VERSION}")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/${LICENSE_FILE}")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "${BIN_INSTALL_DIR}")
#set(CPACK_NSIS_MUI_ICON "${PROJECT_ICONS_DIRECTORY}/NSIS.ico")
#set(CPACK_PACKAGE_ICON "${PROJECT_ICONS_DIRECTORY}\\\\NSISHeader.bmp")
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
# set(CPACK_NSIS_MENU_LINKS "${LICENSE_FILE}" "License" "${README_FILE}" "Readme")
# set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CPACK_NSIS_INSTALLED_ICON_NAME}")
elseif(APPLE) # todo test this for apple
set(CMAKE_INSTALL_PREFIX "/Applications/")
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME}")
set(CPACK_SYSTEM_NAME "OSX")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${JPSEDITOR_VERSION}")
#set(CPACK_PACKAGE_ICON "${ICONS_DIR}/DMG.icns")
#set(CPACK_DMG_DS_STORE "${ICONS_DIR}/DMGDSStore")
#set(CPACK_DMG_BACKGROUND_IMAGE "${ICONS_DIR}/DMGBackground.png")
elseif(UNIX)
# tested with success in
# Linux dhcppc5 3.2.0-4-686-pae #1 SMP Debian 3.2.68-1+deb7u2 i686 GNU/Linux
set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_DESCRIPTION "simulation core of JuPedSim")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Geometry editor of JuPedSim, a framework for simulation and analysis of pedestrian dynamics")
#SET(CPACK_PACKAGE_VENDOR "nowardev")
SET(CPACK_PACKAGE_CONTACT "m.chraibi@fz-juelich.de")
SET(CPACK_PACKAGE_VERSION_MAJOR "${JPSEDITOR_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${JPSEDITOR_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${JPSEDITOR_PATCH_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${JPSEDITOR_VERSION}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${JPSEDITOR_VERSION}")
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS " Boost (>= 1.59) ")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET( CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://jupedsim.org")
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS, "jpsvis, jpsreport, jpscor")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "science")
SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
endif()
include(CPack)
# message (STATUS "bin ins" ${BIN_INSTALL_DIR})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/icons/jpseditor.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/icons/jpseditor.ico")
SET(CPACK_RESOURCE_FILE_README "${README_FILE}")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_COMPONENTS_ALL applications demos Runtime)
set(CPACK_COMPONENT_CTDATA_GROUP "Samples")
set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "jpseditor")
set(CPACK_COMPONENT_GROUP_DATA_DESCRIPTION "demo files")
set(CPACK_COMPONENT_DATA_FILES_DESCRIPTION "demo files to get started")
SET(CPACK_PACKAGE_DESCRIPTION "Editor tool for JuPedSim")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The editor module of JuPedSim, a framework for simulation and analysis of pedestrian dynamics")
SET(CPACK_PACKAGE_VENDOR "Forschungszentrum Juelich GmbH")
SET(CPACK_PACKAGE_NAME "JPSeditor")
SET(CPACK_PACKAGE_CONTACT "m.chraibi@fz-juelich.de")
SET(CPACK_PACKAGE_VERSION_MAJOR "${JPSEDITOR_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${JPSEDITOR_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${JPSEDITOR_PATCH_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${JPSEDITOR_VERSION}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${JPSEDITOR_VERSION}")
#if(UNIX AND NOT APPLE)
# set(BIN_INSTALL_DIR "bin")
#else()
# set(BIN_INSTALL_DIR ".")
# set(DOC_INSTALL_DIR ".")
#endif()
#message (STATUS "bin install dir: " ${BIN_INSTALL_DIR})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_INSTALL_DIR}")
include(InstallRequiredSystemLibraries)
if(APPLE)
set(EXECUTABLE "${PROJECT_NAME}.app")
......@@ -505,13 +557,5 @@ else()
set(EXECUTABLE "${BIN_INSTALL_DIR}/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
endif()
# if(APPLE OR WIN32)
# if(${QT4_INSTALLED})
# include(DeployQt4)
# install_qt4_executable("${EXECUTABLE}" "qsqlite")
# elseif(${QT5_INSTALLED})
# include(DeployQt5)
# install_qt5_executable("${EXECUTABLE}" "qsqlite")
# endif()
# endif()
include(CPack)
Markdown is supported
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