Skip to content

Commit

Permalink
Refs #93. Updated Windows package for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Jan 12, 2024
1 parent 3c992f8 commit 43712be
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ add_custom_target(readme SOURCES README.md LICENSE.TXT)
install(FILES README.md LICENSE.TXT DESTINATION .)

# Package
# add_subdirectory(package)
add_subdirectory(package)
6 changes: 3 additions & 3 deletions client/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,14 @@ set_source_files_properties(${ICON_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION "Res
if (APPLE)
# Mac bundles...
# Install targets
install(TARGETS OpenTeraPlus DESTINATION .)
install(TARGETS OpenTeraPlus RUNTIME DESTINATION .)
# install(TARGETS opentera_messages DESTINATION .)

else(APPLE)
# Every other systems
# Install target to bin
install(TARGETS OpenTeraPlus DESTINATION bin)
install(TARGETS opentera_messages DESTINATION bin)
install(TARGETS OpenTeraPlus RUNTIME DESTINATION bin)
install(TARGETS opentera_messages RUNTIME DESTINATION bin)
endif(APPLE)


2 changes: 1 addition & 1 deletion external/webcamoid/Lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ target_link_libraries(AvKys Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Qml)
set(AVKYS_LIBS AvKys CACHE INTERNAL "doc string")
set(AVKYS_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src CACHE INTERNAL "doc string")

install(TARGETS AvKys DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS AvKys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

2 changes: 1 addition & 1 deletion external/webcamoid/Plugins/ACapsConvert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_library(${PLUGIN_NAME} SHARED ${plugin_srcs} ${plugin_headers} ${plugin_moc_
# qt5_use_modules(${PLUGIN_NAME} Core Concurrent Gui Qml)
target_link_libraries(${PLUGIN_NAME} ${AVKYS_PLUGIN_LIBRARIES})
target_link_libraries(${PLUGIN_NAME} Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Qml)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})
install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})

#submodule(s)
FILE(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH}/submodules/${PLUGIN_NAME})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ set_target_properties(${PLUGIN_NAME}_${SUBMMODULE_NAME} PROPERTIES OUTPUT_NAME "
#qt5_use_modules(${PLUGIN_NAME}_${SUBMMODULE_NAME} Core Concurrent Widgets Gui Qml)
target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} Qt6::Core Qt6::Concurrent Qt6::Widgets Qt6::Gui Qt6::Qml)
target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} ${AVKYS_PLUGIN_LIBRARIES} ${FFMPEG_LIBS})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})


4 changes: 1 addition & 3 deletions external/webcamoid/Plugins/DesktopCapture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ add_library(${PLUGIN_NAME} SHARED ${plugin_srcs} ${plugin_headers} ${plugin_moc_
# qt5_use_modules(${PLUGIN_NAME} Core Concurrent Gui Qml)
target_link_libraries(${PLUGIN_NAME} Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Qml)
target_link_libraries(${PLUGIN_NAME} ${AVKYS_PLUGIN_LIBRARIES})
install(TARGETS ${PLUGIN_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})


install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})

#submodule(s)
FILE(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH}/submodules/${PLUGIN_NAME})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ set_target_properties(${PLUGIN_NAME}_${SUBMMODULE_NAME} PROPERTIES OUTPUT_NAME "
target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} Qt6::Core Qt6::Concurrent Qt6::Widgets Qt6::Gui Qt6::Qml)

target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} ${AVKYS_PLUGIN_LIBRARIES})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})

2 changes: 1 addition & 1 deletion external/webcamoid/Plugins/MultiSrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ add_library(${PLUGIN_NAME} SHARED ${plugin_srcs} ${plugin_headers} ${plugin_moc_
# qt5_use_modules(${PLUGIN_NAME} Core Concurrent Gui Qml)
target_link_libraries(${PLUGIN_NAME} Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Qml)
target_link_libraries(${PLUGIN_NAME} ${AVKYS_PLUGIN_LIBRARIES})
install(TARGETS ${PLUGIN_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})
install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})

#submodule(s)
FILE(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH}/submodules/${PLUGIN_NAME})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ add_library(${SUBMMODULE_NAME} SHARED ${submodule_srcs} ${submodule_headers} ${s
# qt5_use_modules(${SUBMMODULE_NAME} Core Concurrent Widgets Gui Qml)
target_link_libraries(${SUBMMODULE_NAME} Qt6::Core Qt6::Concurrent Qt6::Widgets Qt6::Gui Qt6::Qml)
target_link_libraries(${SUBMMODULE_NAME} ${AVKYS_PLUGIN_LIBRARIES} ${FFMPEG_LIBS})
install(TARGETS ${SUBMMODULE_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
install(TARGETS ${SUBMMODULE_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})


2 changes: 1 addition & 1 deletion external/webcamoid/Plugins/VirtualCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_library(${PLUGIN_NAME} SHARED ${plugin_srcs} ${plugin_headers} ${plugin_moc_
# qt5_use_modules(${PLUGIN_NAME} Core Concurrent Gui Qml)
target_link_libraries(${PLUGIN_NAME} Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Qml)
target_link_libraries(${PLUGIN_NAME} ${AVKYS_PLUGIN_LIBRARIES})
install(TARGETS ${PLUGIN_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})
install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH})

#submodule(s)
FILE(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH}/submodules/${PLUGIN_NAME})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ add_library(${SUBMMODULE_NAME} SHARED ${submodule_srcs} ${submodule_headers} ${s
# qt5_use_modules(${SUBMMODULE_NAME} Core Concurrent Widgets Gui Qml)
target_link_libraries(${SUBMMODULE_NAME} Qt6::Core Qt6::Concurrent Qt6::Widgets Qt6::Gui Qt6::Qml)
target_link_libraries(${SUBMMODULE_NAME} ${AVKYS_PLUGIN_LIBRARIES} ${dshow_additional_libs} ipc)
install(TARGETS ${SUBMMODULE_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
install(TARGETS ${SUBMMODULE_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ set_target_properties(${PLUGIN_NAME}_${SUBMMODULE_NAME} PROPERTIES OUTPUT_NAME "
# qt5_use_modules(${PLUGIN_NAME}_${SUBMMODULE_NAME} Core Concurrent Widgets Gui Qml)
target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} Qt6::Core Qt6::Concurrent Qt6::Widgets Qt6::Gui Qt6::Qml)
target_link_libraries(${PLUGIN_NAME}_${SUBMMODULE_NAME} ${AVKYS_PLUGIN_LIBRARIES} ${FFMPEG_LIBS})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})
install(TARGETS ${PLUGIN_NAME}_${SUBMMODULE_NAME} RUNTIME DESTINATION ${AVKYS_LIBRARY_INSTALL_PATH}/submodules/${PLUGIN_NAME})



42 changes: 25 additions & 17 deletions package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ execute_process(

message(STATUS "Testing package ${_qt6_qmake_location} ${qt6_install_prefix}")

# Pre-build script, used to clean up unneeded files for example
set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/cpack-prebuild.cmake)

if (APPLE)
cmake_policy(SET CMP0087 NEW) # Enable generator expressions in INSTALL(CODE

Expand Down Expand Up @@ -68,7 +71,7 @@ if (WIN32)
add_custom_target(windows_deploy_qt
# Collect and copy required dependencies
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/qtdeploy
COMMAND ${qt6_install_prefix}/bin/windeployqt6 "$<TARGET_FILE_DIR:OpenTeraPlus>/OpenTeraPlus.exe" --release --dir "${CMAKE_INSTALL_PREFIX}/qtdeploy"
COMMAND ${qt6_install_prefix}/bin/windeployqt6 "$<TARGET_FILE_DIR:OpenTeraPlus>/OpenTeraPlus.exe" --release --dir "${CMAKE_INSTALL_PREFIX}/qtdeploy" --no-quick-import --no-compiler-runtime
COMMENT "Running windeployqt6 ..."
)

Expand All @@ -87,10 +90,10 @@ if (WIN32)
set(CPACK_COMPONENT_OPENTERAPLUS_DEPENDS libprotobuf qt_dist_component openssl)
set(CPACK_COMPONENT_OPENTERAPLUS_REQUIRED ON)

set(CPACK_COMPONENT_QT_DIST_COMPONENT_DISPLAY_NAME "Librairies Qt")
set(CPACK_COMPONENT_QT_DIST_COMPONENT_DISPLAY_NAME "Qt")
set(CPACK_COMPONENT_QT_DIST_COMPONENT_REQUIRED ON)

set(CPACK_COMPONENT_LIBPROTOBUF_DISPLAY_NAME "Librairies Protobuf")
set(CPACK_COMPONENT_LIBPROTOBUF_DISPLAY_NAME "Protobuf")
set(CPACK_COMPONENT_LIBPROTOBUF_REQUIRED ON)

set(CPACK_COMPONENT_OPENSSL_DISPLAY_NAME "OpenSSL")
Expand All @@ -100,34 +103,39 @@ if (WIN32)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config/OpenTeraPlus.json")
# The components that will be packaged
set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} special_configuration)
set(CPACK_COMPONENT_SPECIAL_CONFIGURATION_DISPLAY_NAME "Fichier de configuration")
set(CPACK_COMPONENT_SPECIAL_CONFIGURATION_DISPLAY_NAME "Configuration")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config/OpenTeraPlus.json DESTINATION bin/config COMPONENT special_configuration)
endif()

# Virtual camera driver
# list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'cmd /c $INSTDIR\\\\bin\\\\installDriver.exe'")
# list(APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'cmd /c $INSTDIR\\\\bin\\\\uninstallDriver.exe'")


# add SSL librariesOpenSSL\Win_x64\bin
# file(GLOB OPENSSL_LIBRARIES "${qt6_install_prefix}/../../Tools/OpenSSL/Win_x64/bin/*.dll")
file(GLOB OPENSSL_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/openssl/64bits/*.dll")
message(STATUS "******************* ${OPENSSL_LIBRARIES} ${qt6_install_prefix} ${CPACK_PACKAGING_INSTALL_PREFIX}")
install(FILES ${OPENSSL_LIBRARIES} DESTINATION bin COMPONENT openssl)


# Uses NSIS packaging system on Windows
SET(CPACK_SOURCE_GENERATOR "NSIS")


# SET(CPACK_NSIS_INSTALL_ROOT "C:\\\\INTER")
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenTeraPlus")
SET(CPACK_NSIS_PACKAGE_NAME "OpenTeraPlus")
SET(CPACK_NSIS_MODIFY_PATH OFF)
SET(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "bin\\\\OpenTeraPlus.exe")

set(CPACK_NSIS_CREATE_ICONS_EXTRA
"CreateShortCut '$DESKTOP\\\\OpenTeraPlus.lnk' '$INSTDIR\\\\bin\\\\OpenTeraPlus.exe'"
)
set(CPACK_NSIS_DELETE_ICONS_EXTRA
"Delete '$DESKTOP\\\\OpenTeraPlus.lnk'"
)

# Removed run after install option, as this caused issue with config file (will run as admin!)
# SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "bin\\\\OpenTeraPlus.exe")

SET(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/introlab/openteraplus")
SET(CPACK_NSIS_CONTACT "[email protected]")
Expand All @@ -147,11 +155,16 @@ if (WIN32)
VIAddVersionKey ProductVersion ${CPACK_PACKAGE_VERSION}")


include(CPack REQUIRED)
# Run VC++ redistributable
list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\bin\\\\vc_redist.x64.exe\\\" /install /passive /norestart'")

# The trick is to deploy Qt to a directory and then install the directory in the bin folder
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/qtdeploy/ DESTINATION bin COMPONENT qt_dist_component)

# Deploy before packaging
add_custom_target(nsis-package DEPENDS windows_deploy_qt package)

# Run VC++ redistributable
list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'cmd /c $INSTDIR\\\\bin\\\\VC_redist.x64.exe /install /passive /norestart'")
include(CPack REQUIRED)

# Set files to install - everything in deploy folder
#install(
Expand All @@ -163,11 +176,6 @@ if (WIN32)

# install(CODE " ")

# The trick is to deploy Qt to a directory and then install the directory in the bin folder
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/qtdeploy/ DESTINATION bin COMPONENT qt_dist_component)

# Deploy before packaging
add_custom_target(nsis-package DEPENDS windows_deploy_qt package)


endif (WIN32)
6 changes: 6 additions & 0 deletions package/cpack-prebuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if(WIN32)
message("Cleaning unneeded files for package...")
file(REMOVE_RECURSE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/libprotobuf/lib)
file(REMOVE_RECURSE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/openteraplus/lib)
file(REMOVE_RECURSE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/openteraplus/include)
endif(WIN32)
Binary file removed package/openssl/64bits/libcrypto-1_1-x64.dll
Binary file not shown.
Binary file added package/openssl/64bits/libcrypto-3-x64.dll
Binary file not shown.
Binary file removed package/openssl/64bits/libssl-1_1-x64.dll
Binary file not shown.
Binary file added package/openssl/64bits/libssl-3-x64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion shared/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ endif(MSVC)


# Install target
install(TARGETS opentera_shared DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS opentera_shared RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

set(OPENTERA_SHARED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/data CACHE INTERNAL "doc string")
set(OPENTERA_SHARED_LIBS "opentera_shared" CACHE INTERNAL "doc string")
Expand Down

0 comments on commit 43712be

Please sign in to comment.