Skip to content

Commit

Permalink
build(cmake): s/CERTIFICATE_PASSWORD/PASSWORD for codesign
Browse files Browse the repository at this point in the history
There are no other passwords, saves some typing.
  • Loading branch information
trollixx committed Sep 11, 2023
1 parent f87563b commit 756c866
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ jobs:
- name: Package
if: matrix.config.publishArtifacts
run: cmake --build build --preset ${{ matrix.config.buildPreset }} --target package
env:
CODESIGN_CERTIFICATE: ${{ secrets.CODESIGN_CERTIFICATE }}
CODESIGN_PASSWORD: ${{ secrets.CODESIGN_PASSWORD }}

- name: Upload ZIP Artifacts
if: matrix.config.publishArtifacts
Expand Down
22 changes: 11 additions & 11 deletions cmake/CodeSign.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include_guard()
# [DESCRIPTION] <description-string>
# [URL] <url-string>
# [CERTIFICATE_FILE] <filename>
# [CERTIFICATE_PASSWORD] <password-string>
# [PASSWORD] <password-string>
# [TIMESTAMP_URL] <url-string>
# [QUIET]
# [VERBOSE]
Expand All @@ -22,9 +22,9 @@ function(codesign)
endif()

cmake_parse_arguments(_ARG
"QUIET;VERBOSE;DEBUG" # Options.
"DESCRIPTION;URL;CERTIFICATE_FILE;CERTIFICATE_PASSWORD;TIMESTAMP_URL" # Single-value keywords.
"FILES" # Multi-value keywords.
"QUIET;VERBOSE;DEBUG" # Options.
"DESCRIPTION;URL;CERTIFICATE_FILE;PASSWORD;TIMESTAMP_URL" # Single-value keywords.
"FILES" # Multi-value keywords.
${ARGN}
)

Expand Down Expand Up @@ -109,16 +109,16 @@ function(codesign)
list(APPEND _cmd_args "/f" ${_ARG_CERTIFICATE_FILE})

# Set password.
if(NOT _ARG_CERTIFICATE_PASSWORD)
if(CODESIGN_CERTIFICATE_PASSWORD)
set(_ARG_CERTIFICATE_PASSWORD ${CODESIGN_CERTIFICATE_PASSWORD})
elseif(DEFINED ENV{CODESIGN_CERTIFICATE_PASSWORD})
set(_ARG_CERTIFICATE_PASSWORD $ENV{CODESIGN_CERTIFICATE_PASSWORD})
if(NOT _ARG_PASSWORD)
if(CODESIGN_PASSWORD)
set(_ARG_PASSWORD ${CODESIGN_PASSWORD})
elseif(DEFINED ENV{CODESIGN_PASSWORD})
set(_ARG_PASSWORD $ENV{CODESIGN_PASSWORD})
endif()
endif()

if(_ARG_CERTIFICATE_PASSWORD)
list(APPEND _cmd_args "/p" ${_ARG_CERTIFICATE_PASSWORD})
if(_ARG_PASSWORD)
list(APPEND _cmd_args "/p" ${_ARG_PASSWORD})
endif()

# Set description.
Expand Down

0 comments on commit 756c866

Please sign in to comment.