mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-15 07:01:18 +02:00
Add targets for packaging DMG and InnoSetup
Fixes configure.sh Fixes Windows code signing Fixes an issue with conan cache on windows Fixes build manual script Fixes build manual Remove unused props Use long options Yet another manual fix Fixes iss
This commit is contained in:
committed by
Dmitry Vedenko
parent
d21ee922e1
commit
6da25e1646
36
cmake-proxies/cmake-modules/AudacityCodeSigning.cmake
Normal file
36
cmake-proxies/cmake-modules/AudacityCodeSigning.cmake
Normal file
@@ -0,0 +1,36 @@
|
||||
# Code signing
|
||||
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||
# On windows, we expect WINDOWS_CERTIFICATE to be set
|
||||
# as a CMake variable or as an environment variable
|
||||
if( DEFINED WINDOWS_CERTIFICATE )
|
||||
install( CODE "set( WINDOWS_CERTIFICATE \"${WINDOWS_CERTIFICATE}\" )" )
|
||||
endif()
|
||||
|
||||
if( DEFINED WINDOWS_CERTIFICATE_PASSWORD )
|
||||
# To simplify the helper script - we push password to the environment
|
||||
install( CODE "set( ENV{WINDOWS_CERTIFICATE_PASSWORD} \"${WINDOWS_CERTIFICATE_PASSWORD}\") " )
|
||||
endif()
|
||||
|
||||
install( CODE "set( PFX_SIGN_PS_LOCATION \"${CMAKE_SOURCE_DIR}/scripts/build/windows/PfxSign.ps1\") " )
|
||||
install( SCRIPT "scripts/build/windows/PfxSign.cmake" )
|
||||
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set_from_env( APPLE_CODESIGN_IDENTITY )
|
||||
set_from_env( APPLE_NOTARIZATION_USER_NAME )
|
||||
set_from_env( APPLE_NOTARIZATION_PASSWORD )
|
||||
|
||||
# Pass arguments to cmake install script
|
||||
install( CODE "set( APPLE_CODESIGN_IDENTITY \"${APPLE_CODESIGN_IDENTITY}\" )" )
|
||||
install( CODE "set( APPLE_NOTARIZATION_USER_NAME \"${APPLE_NOTARIZATION_USER_NAME}\" )" )
|
||||
install( CODE "set( APPLE_NOTARIZATION_PASSWORD \"${APPLE_NOTARIZATION_PASSWORD}\" )" )
|
||||
|
||||
install( CODE "set( APP_IDENTIFIER \"org.audacityteam.audacity\" )" )
|
||||
install( CODE "get_filename_component( APP_LOCATION \${CMAKE_INSTALL_PREFIX}/Audacity.app ABSOLUTE )" )
|
||||
install( CODE "set( APPLE_CODESIGN_ENTITLEMENTS ${CMAKE_SOURCE_DIR}/mac/Audacity.entitlements )")
|
||||
|
||||
install( SCRIPT "scripts/build/macOS/SignMacos.cmake" )
|
||||
|
||||
if( ${_OPT}perform_notarization )
|
||||
install( SCRIPT "scripts/build/macOS/NotarizeMacos.cmake" )
|
||||
endif()
|
||||
endif()
|
39
cmake-proxies/cmake-modules/AudacityInnoSetup.cmake
Normal file
39
cmake-proxies/cmake-modules/AudacityInnoSetup.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
# Defines innosetup target
|
||||
# The target will be only generated if InnoSetup 6 is installed.
|
||||
|
||||
find_program(
|
||||
INNO_SETUP_COMPILER
|
||||
NAMES iscc ISCC
|
||||
HINTS
|
||||
"C:/Program Files (x86)/Inno Setup 6"
|
||||
"C:/Program Files/Inno Setup 6"
|
||||
)
|
||||
|
||||
if( INNO_SETUP_COMPILER )
|
||||
message(STATUS "Creating target innosetup...")
|
||||
|
||||
set( TEMP_PACKAGE_PATH "${CMAKE_BINARY_DIR}/innosetup" )
|
||||
|
||||
add_custom_target(
|
||||
innosetup
|
||||
COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
||||
-DOUTPUT_DIR=${TEMP_PACKAGE_PATH}
|
||||
-DINNO_SETUP_COMPILER=${INNO_SETUP_COMPILER}
|
||||
-DEMBED_MANUAL=${${_OPT}package_manual}
|
||||
-DBUILDING_64_BIT=${IS_64BIT}
|
||||
-DSIGN=${${_OPT}perform_codesign}
|
||||
-DWINDOWS_CERTIFICATE=${WINDOWS_CERTIFICATE}
|
||||
-D WINDOWS_CERTIFICATE_PASSWORD=${WINDOWS_CERTIFICATE_PASSWORD}
|
||||
-P "${CMAKE_SOURCE_DIR}/win/Inno_Setup_Wizard/BuildInnoSetupInstaller.cmake"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
if( ${_OPT}package_manual )
|
||||
add_dependencies( innosetup manual )
|
||||
endif()
|
||||
|
||||
set_target_properties( innosetup PROPERTIES FOLDER "packaging" )
|
||||
endif()
|
@@ -2,6 +2,8 @@
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${AUDACITY_VERSION}") # X
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${AUDACITY_RELEASE}") # Y
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${AUDACITY_REVISION}") # Z
|
||||
set(CPACK_PACKAGE_VENDOR "Audacity")
|
||||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://audacityteam.org")
|
||||
|
||||
# X.Y.Z-alpha-20210615
|
||||
set(CPACK_PACKAGE_VERSION "${AUDACITY_VERSION}.${AUDACITY_RELEASE}.${AUDACITY_REVISION}${AUDACITY_SUFFIX}")
|
||||
@@ -22,4 +24,22 @@ set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/package")
|
||||
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
|
||||
if( CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
|
||||
set( CPACK_GENERATOR DragNDrop )
|
||||
|
||||
set( CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/mac/Resources/Audacity-DMG-background.png")
|
||||
set( CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/scripts/build/macOS/DMGSetup.scpt")
|
||||
|
||||
if( ${_OPT}perform_codesign )
|
||||
set( CPACK_APPLE_CODESIGN_IDENTITY ${APPLE_CODESIGN_IDENTITY} )
|
||||
set( CPACK_APPLE_NOTARIZATION_USER_NAME ${APPLE_NOTARIZATION_USER_NAME} )
|
||||
set( CPACK_APPLE_NOTARIZATION_PASSWORD ${APPLE_NOTARIZATION_PASSWORD} )
|
||||
set( CPACK_APPLE_SIGN_SCRIPTS "${CMAKE_SOURCE_DIR}/scripts/build/macOS" )
|
||||
set( CPACK_PERFORM_NOTARIZATION ${${_OPT}perform_notarization} )
|
||||
|
||||
# CPACK_POST_BUILD_SCRIPTS was added in 3.19, but we only need it on macOS
|
||||
SET( CPACK_POST_BUILD_SCRIPTS "${CMAKE_SOURCE_DIR}/scripts/build/macOS/DMGSign.cmake" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CPack) # do this last
|
||||
|
Reference in New Issue
Block a user