Skip to content

Commit

Permalink
Merge pull request #762 from byrnHDF/master-correct-creds
Browse files Browse the repository at this point in the history
Corect the path to the credentials file
  • Loading branch information
byrnHDF authored Sep 4, 2024
2 parents fb21361 + 46e39c8 commit 4a822df
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
uses: jsdaniell/create-json@v1.2.3
with:
name: "credentials.json"
dir: '${{ runner.workspace }}/hdf4/hdfsrc'
dir: 'hdfsrc'
json: '{"Endpoint": "${{ secrets.AZURE_ENDPOINT }}","CodeSigningAccountName": "${{ secrets.AZURE_CODE_SIGNING_NAME }}","CertificateProfileName": "${{ secrets.AZURE_CERT_PROFILE_NAME }}"}'
if: ${{ needs.check-secret.outputs.sign-state == 'exists' }}

Expand Down
1 change: 0 additions & 1 deletion CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ if (NOT HDF4_EXTERNALLY_CONFIGURED AND NOT HDF4_NO_PACKAGES)
list (APPEND CPACK_GENERATOR "STGZ")
set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
set (CPACK_PRE_BUILD_SCRIPTS ${CMAKE_SOURCE_DIR}/config/cmake/SignPackageFiles.cmake)

find_program (DPKGSHLIB_EXE dpkg-shlibdeps)
if (DPKGSHLIB_EXE)
Expand Down
1 change: 0 additions & 1 deletion config/cmake-presets/hidden-presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,4 +653,3 @@
}
]
}

2 changes: 1 addition & 1 deletion config/cmake/HDFMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ macro (HDF_README_PROPERTIES target_fortran)
elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.4.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2022")
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ???")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ????")
endif ()
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}")
Expand Down
43 changes: 12 additions & 31 deletions config/cmake/LIBAEC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,20 @@ if (NOT LIBAEC_EXPORTED_TARGETS)
set (LIBAEC_EXPORTED_TARGETS "libaec-targets")
endif ()

#-----------------------------------------------------------------------------
# To include a library in the list exported by the project AT BUILD TIME,
# add it to this variable. This is NOT used by Make Install, but for projects
# which include SZIP as a sub-project within their build tree
#-----------------------------------------------------------------------------
set_global_variable (LIBAEC_LIBRARIES_TO_EXPORT "")

#-----------------------------------------------------------------------------
# Mac OS X Options
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
if (LIBAEC_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS)
set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
endif ()
set_directory_properties (PROPERTIES INCLUDE_DIRECTORIES
"${LIBAEC_BINARY_DIR};${LIBAEC_SOURCE_DIR}/src;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

set (CMAKE_POSITION_INDEPENDENT_CODE ON)
if (MSVC)
set (CMAKE_MFC_FLAG 0)
set(CMAKE_DEBUG_POSTFIX "d")
endif ()

#-----------------------------------------------------------------------------
# When building utility executables that generate other (source) files :
# we make use of the following variables defined in the root CMakeLists.
# Certain systems may add /Debug or /Release to output paths
# and we need to call the executable from inside the CMake configuration
#-----------------------------------------------------------------------------
set (EXE_EXT "")
if (WIN32)
set (EXE_EXT ".exe")
Expand All @@ -129,10 +121,6 @@ if (WIN32)
add_compile_definitions (_CONSOLE)
endif ()

if (MSVC)
set (CMAKE_MFC_FLAG 0)
endif ()

#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
Expand All @@ -158,34 +146,27 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/libaec.h")

#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
# Define LIBAEC Library
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${LIBAEC_BINARY_DIR};${LIBAEC_SOURCE_DIR}/src;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"

set (LIBAEC_PUBLIC_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/libaec.h
)

#-----------------------------------------------------------------------------
# Define LIBAEC Library
#-----------------------------------------------------------------------------
set(LIBAEC_SRCS
${LIBAEC_SRC_DIR}/encode.c
${LIBAEC_SRC_DIR}/encode_accessors.c
${LIBAEC_SRC_DIR}/decode.c
${LIBAEC_SRC_DIR}/vector.c
)

set (LIBAEC_PUBLIC_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/libaec.h
)

add_library (${LIBAEC_LIB_TARGET} STATIC ${LIBAEC_SRCS} ${LIBAEC_PUBLIC_HEADERS})
target_include_directories (${LIBAEC_LIB_TARGET} PUBLIC
"$<BUILD_INTERFACE:${LIBAEC_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${LIBAEC_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>"
"$<INSTALL_INTERFACE:include>")
TARGET_C_PROPERTIES (${LIBAEC_LIB_TARGET} STATIC)
target_link_libraries (${LIBAEC_LIB_TARGET} PRIVATE ${LINK_LIBS})
H4_SET_LIB_OPTIONS (${LIBAEC_LIB_TARGET} ${LIBAEC_LIB_NAME} STATIC 0)
set_target_properties (${LIBAEC_LIB_TARGET} PROPERTIES
VERSION 0.0.12 SOVERSION 0
Expand Down
62 changes: 26 additions & 36 deletions config/cmake/SignPackageFiles.cmake
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
# This script signs the targets for the package
message(STATUS "Signing script for ${CPACK_EXPORT_LIBRARIES} and ${CPACK_EXPORT_UTILS}")
foreach (target "${CPACK_EXPORT_LIBRARIES}")
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
$<TARGET_FILE:${target}>
WORKING_DIRECTORY ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/lib
)
message(STATUS "Signing the target ${target}")
elseif (APPLE)
# Sign the targets
execute_process(COMMAND codesign
--force --timestamp --options runtime --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/config/cmake/distribution.entitlements
--verbose=4 --strict --sign "$ENV{SIGNER}"
$<TARGET_FILE:${target}>
WORKING_DIRECTORY ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/lib
)
message(STATUS "Signing the target ${target}")
else ()
set (target_path ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/lib)
message(STATUS "Signing the target ${target} using ${target_path}")
endif ()
endforeach ()
message(STATUS "Signing script for ${CPACK_EXPORT_LIBRARIES} in ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${CPACK_PACKAGE_INSTALL_DIRECTORY}")

foreach (target "${CPACK_EXPORT_UTILS}")
# RPM needs ALL_COMPONENTS_IN_ONE added to path between ${CPACK_TEMPORARY_INSTALL_DIRECTORY} and ${CPACK_PACKAGE_INSTALL_DIRECTORY}
if (CPACK_GENERATOR MATCHES "RPM")
set (CPACK_TARGET_FILE_DIRECTORY "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
elseif (CPACK_GENERATOR MATCHES "WIX" OR CPACK_GENERATOR MATCHES "NSIS")
set (CPACK_TARGET_FILE_DIRECTORY "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/libraries")
elseif (CPACK_GENERATOR MATCHES "ZIP")
set (CPACK_TARGET_FILE_DIRECTORY "${CPACK_TEMPORARY_INSTALL_DIRECTORY}")
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/*.*")
foreach (targetfile IN LISTS target_list)
if (WIN32)
# Sign the targets
execute_process(COMMAND $ENV{SIGNTOOLDIR}/signtool
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
$<TARGET_FILE:${target}>
WORKING_DIRECTORY ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/bin
${targetfile}
)
execute_process (
COMMAND ${CMAKE_COMMAND} -E echo "Signing the target ${targetfile}"
)
message(STATUS "Signing the target ${target}")
elseif (APPLE)
# Sign the targets
execute_process(COMMAND codesign
execute_process (COMMAND codesign
--force --timestamp --options runtime --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/config/cmake/distribution.entitlements
--verbose=4 --strict --sign "$ENV{SIGNER}"
$<TARGET_FILE:${target}>
WORKING_DIRECTORY ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/bin
${targetfile}
)
execute_process (
COMMAND ${CMAKE_COMMAND} -E echo "Signing the target ${targetfile}"
)
message(STATUS "Signing the target ${target}")
else ()
set (target_path ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_COMPONENTS_IN_ONE/${CPACK_PACKAGE_INSTALL_DIRECTORY}/bin)
message(DEBUG "Signing the target ${target} using ${target_path}")
execute_process (
COMMAND ${CMAKE_COMMAND} -E echo "Signing the target ${targetfile}"
)
endif ()
endforeach ()
2 changes: 1 addition & 1 deletion config/toolchain/mingw64.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set (TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set (CMAKE_SYSTEM_NAME Windows)
set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
Expand Down

0 comments on commit 4a822df

Please sign in to comment.