Skip to content

Commit

Permalink
Set new cpack var to source dir
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Sep 4, 2024
1 parent 4a822df commit 86a495c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@ if (NOT HDF4_EXTERNALLY_CONFIGURED AND NOT HDF4_NO_PACKAGES)
endif ()
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_DIR}/hdf.bmp")

set (CPACK_EXPORT_LIBRARIES ${HDF4_LIBRARIES_TO_EXPORT})
set (CPACK_EXPORT_UTILS ${HDF4_UTILS_TO_EXPORT})
set (CPACK_ORIG_SOURCE_DIR ${CMAKE_SOURCE_DIR})
if ("$ENV{BINSIGN}" STREQUAL "exists")
set (CPACK_PRE_BUILD_SCRIPTS ${CMAKE_SOURCE_DIR}/config/cmake/SignPackageFiles.cmake)
endif ()
Expand Down
8 changes: 4 additions & 4 deletions config/cmake/SignPackageFiles.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This script signs the targets for the package
message(STATUS "Signing script for ${CPACK_EXPORT_LIBRARIES} in ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message(STATUS "Signing script in ${CPACK_TEMPORARY_INSTALL_DIRECTORY} and ${CPACK_PACKAGE_INSTALL_DIRECTORY}")

# RPM needs ALL_COMPONENTS_IN_ONE added to path between ${CPACK_TEMPORARY_INSTALL_DIRECTORY} and ${CPACK_PACKAGE_INSTALL_DIRECTORY}
if (CPACK_GENERATOR MATCHES "RPM")
Expand All @@ -11,13 +11,13 @@ elseif (CPACK_GENERATOR MATCHES "ZIP")
else ()
set (CPACK_TARGET_FILE_DIRECTORY "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
endif ()
file (GLOB target_list LIST_DIRECTORIES false "${CPACK_TARGET_FILE_DIRECTORY}/lib/*.*" "${CPACK_TARGET_FILE_DIRECTORY}/bin/*.*")
file (GLOB target_list LIST_DIRECTORIES false "${CPACK_TARGET_FILE_DIRECTORY}/lib/*" "${CPACK_TARGET_FILE_DIRECTORY}/bin/*")
foreach (targetfile IN LISTS target_list)
if (WIN32)
# Sign the targets
execute_process (COMMAND $ENV{SIGNTOOLDIR}/signtool
sign /v /debug /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256
/dlib "Microsoft.Trusted.Signing.Client/bin/x64/Azure.CodeSigning.Dlib.dll" /dmdf ${CMAKE_CURRENT_SOURCE_DIR}/credentials.json
/dlib "Microsoft.Trusted.Signing.Client/bin/x64/Azure.CodeSigning.Dlib.dll" /dmdf ${CPACK_ORIG_SOURCE_DIR}/credentials.json
${targetfile}
)
execute_process (
Expand All @@ -26,7 +26,7 @@ foreach (targetfile IN LISTS target_list)
elseif (APPLE)
# Sign the targets
execute_process (COMMAND codesign
--force --timestamp --options runtime --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/config/cmake/distribution.entitlements
--force --timestamp --options runtime --entitlements ${CPACK_ORIG_SOURCE_DIR}/config/cmake/distribution.entitlements
--verbose=4 --strict --sign "$ENV{SIGNER}"
${targetfile}
)
Expand Down

0 comments on commit 86a495c

Please sign in to comment.