Skip to content

Commit

Permalink
create nsis installer on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtazy committed Jul 15, 2020
1 parent b9d3676 commit 32b1a45
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
40 changes: 38 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ add_executable(conan-gui ${win_app_flag} src/main.cpp)
target_link_libraries(conan-gui PRIVATE conangui::core conangui::qt)

# Installation ##########################################
install(TARGETS conan-gui DESTINATION . )
install(TARGETS conan-gui DESTINATION . COMPONENT applications)

install(SCRIPT deploy/deploy_qt.cmake)
install(SCRIPT deploy/deploy_qt.cmake )
install(DIRECTORY ${CMAKE_BINARY_DIR}/qt_deploy/ DESTINATION . COMPONENT applications)

set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT applications)
include(InstallRequiredSystemLibraries)

# test ###################################################
Expand Down Expand Up @@ -70,3 +72,37 @@ conangui_add_test(
COV
src
interfaces)

#
# CPACK macros below here
#
set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
set (CPACK_PACKAGE_VENDOR "davidtazy")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "desktop interface on conan")
set (CPACK_PACKAGE_VERSION "0.0.0")
set (CPACK_PACKAGE_VERSION_MAJOR "0")
set (CPACK_PACKAGE_VERSION_MINOR "0")
set (CPACK_PACKAGE_VERSION_PATCH "0")
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/logo-conan.ico")

# Define components and their display names
set (CPACK_COMPONENTS_ALL applications )
set (CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "conan-gui Applications")

# Human readable component descriptions
set (CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
"desktop interface on conan")

# Define groups
set(CPACK_COMPONENT_APPLICATIONS_GROUP "Runtime")


# Define NSIS installation types
set(CPACK_ALL_INSTALL_TYPES Full )
set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)

# Must be after the last CPACK macros
include(CPack)
4 changes: 2 additions & 2 deletions deploy/deploy_qt.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
message("deploy qt binaries to ${CMAKE_INSTALL_PREFIX}")
message("deploy qt binaries to ${CMAKE_BINARY_DIR}/qt_deploy")

find_package(PythonInterp REQUIRED)

execute_process(COMMAND
${PYTHON_EXECUTABLE} deploy.py ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}
${PYTHON_EXECUTABLE} deploy.py ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/qt_deploy
WORKING_DIRECTORY
${CMAKE_CURRENT_LIST_DIR})

0 comments on commit 32b1a45

Please sign in to comment.