Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cmake, templates: Remove code signing integration #938

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "cmake/clang"]
path = cmake/clang
url = https://github.com/Xaymar/cmake-clang.git
[submodule "cmake/codesign"]
path = cmake/codesign
url = https://github.com/Xaymar/cmake-codesign.git
[submodule "cmake/version"]
path = cmake/version
url = https://github.com/Xaymar/cmake-version.git
Expand Down
82 changes: 4 additions & 78 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ endif()
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/codesign"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/version"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
Expand Down Expand Up @@ -350,7 +349,6 @@ set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.")

## Code Related
set(${PREFIX}ENABLE_CLANG OFF CACHE BOOL "Enable Clang integration for supported compilers.")
set(${PREFIX}ENABLE_CODESIGN OFF CACHE BOOL "Enable Code Signing integration for supported environments.")
set(${PREFIX}ENABLE_PROFILING OFF CACHE BOOL "Enable CPU and GPU performance tracking, which has a non-zero overhead at all times. Do not enable this for release builds.")

## Compile/Link Related
Expand Down Expand Up @@ -390,35 +388,6 @@ if(${PREFIX}ENABLE_CLANG AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang/Cl
set(HAVE_CLANG ON)
endif()

################################################################################
# Codesign
################################################################################

if(${PREFIX}ENABLE_CODESIGN AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/codesign/CodeSign.cmake"))
include("cmake/codesign/CodeSign.cmake")
set(HAVE_CODESIGN ON)

set(${PREFIX}CODESIGN_FILE "" CACHE FILEPATH "Path to Code-Signing certificate.")
if(WIN32)
set(${PREFIX}CODESIGN_NAME "" CACHE STRING "Name of Code-Signing certificate in Windows's certificate storage.")
endif()
set(${PREFIX}CODESIGN_PASS "" CACHE STRING "Password for Code-Signing certificate.")
set(${PREFIX}CODESIGN_TIMESTAMPS ON CACHE BOOL "Should the resulting binary be timestamped?")

set(_CODESIGN_FILE "$ENV{${PREFIX}CODESIGN_FILE}")
if(${PREFIX}CODESIGN_FILE)
set(_CODESIGN_FILE "${${PREFIX}CODESIGN_FILE}")
endif()
set(_CODESIGN_NAME "$ENV{${PREFIX}CODESIGN_NAME}")
if(${PREFIX}CODESIGN_NAME)
set(_CODESIGN_NAME "${${PREFIX}CODESIGN_NAME}")
endif()
set(_CODESIGN_PASS "$ENV{${PREFIX}CODESIGN_PASS}")
if(${PREFIX}CODESIGN_PASS)
set(_CODESIGN_PASS "${${PREFIX}CODESIGN_PASS}")
endif()
endif()

################################################################################
# Component search paths
################################################################################
Expand Down Expand Up @@ -2083,21 +2052,6 @@ if(T_CHECK AND HAVE_CLANG)
)
endif()

# Code Sign
if(HAVE_CODESIGN)
set(_CODESIGN_TIMESTAMP "")
if(${PREFIX}CODESIGN_TIMESTAMPS)
set(_CODESIGN_TIMESTAMP "TIMESTAMPS")
endif()
codesign(
TARGETS ${PROJECT_NAME}
CERTIFICATE_FILE "${_CODESIGN_FILE}"
CERTIFICATE_NAME "${_CODESIGN_NAME}"
CERTIFICATE_PASS "${_CODESIGN_PASS}"
${_CODESIGN_TIMESTAMP}
)
endif()

################################################################################
# Installation
################################################################################
Expand Down Expand Up @@ -2314,38 +2268,10 @@ if(STANDALONE)
get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH)

if(HAVE_CODESIGN)
codesign_command_win32(
SHA1
RETURN_BIN ISS_CODESIGN_BIN_SHA1
RETURN_ARGS ISS_CODESIGN_CMD_SHA1
CERTIFICATE_FILE "${_CODESIGN_FILE}"
CERTIFICATE_NAME "${_CODESIGN_NAME}"
CERTIFICATE_PASS "${_CODESIGN_PASS}"
${_CODESIGN_TIMESTAMP}
)
codesign_command_win32(
SHA2 APPEND
RETURN_BIN ISS_CODESIGN_BIN_SHA2
RETURN_ARGS ISS_CODESIGN_CMD_SHA2
CERTIFICATE_FILE "${_CODESIGN_FILE}"
CERTIFICATE_NAME "${_CODESIGN_NAME}"
CERTIFICATE_PASS "${_CODESIGN_PASS}"
${_CODESIGN_TIMESTAMP}
)
list(JOIN ISS_CODESIGN_CMD_SHA1 " " ISS_CODESIGN_CMD_SHA1)
list(JOIN ISS_CODESIGN_CMD_SHA2 " " ISS_CODESIGN_CMD_SHA2)

configure_file(
"templates/windows/installer-signed.iss.in"
"installer.iss"
)
else()
configure_file(
"templates/windows/installer.iss.in"
"installer.iss"
)
endif()
configure_file(
"templates/windows/installer.iss.in"
"installer.iss"
)
endif()

# Apple MacOS
Expand Down
1 change: 0 additions & 1 deletion cmake/codesign
Submodule codesign deleted from d02ee9
Loading