Copy "cmake/" subdirectory from OpenCoarrays
parent
9ad92e0a55
commit
c889077272
@ -0,0 +1,14 @@
|
||||
macro(add_installation_script_test name path)
|
||||
|
||||
# Copy the source to the binary tree
|
||||
file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${path}"
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}-usage" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${path}"
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
add_test(NAME test-${name} COMMAND "${CMAKE_BINARY_DIR}/${path}/${name}")
|
||||
set_property(TEST test-${name} PROPERTY WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${path}")
|
||||
set_property(TEST test-${name} PROPERTY ENVIRONMENT "OPENCOARRAYS_SRC_DIR=${CMAKE_SOURCE_DIR}")
|
||||
endmacro(add_installation_script_test)
|
||||
@ -0,0 +1,79 @@
|
||||
# CMake file to be called in script mode (${CMAKE_COMMAND} -P <file>) to
|
||||
# Generate a source archive release asset from add_custom_command
|
||||
#
|
||||
# See SourceDistTarget.cmake
|
||||
|
||||
if(NOT CMAKE_ARGV3)
|
||||
message(FATAL_ERROR "Must pass the top level src dir to ${CMAKE_ARGV2} as the first argument")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_ARGV4)
|
||||
message(FATAL_ERROR "Must pass the top level src dir to ${CMAKE_ARGV2} as the second argument")
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(NOT GIT_FOUND)
|
||||
message( FATAL_ERROR "You can't create a source archive release asset without git!")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --always
|
||||
RESULT_VARIABLE git_status
|
||||
OUTPUT_VARIABLE git_version
|
||||
WORKING_DIRECTORY "${CMAKE_ARGV3}"
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT (git_status STREQUAL "0"))
|
||||
message( FATAL_ERROR "git describe --always failed with exit status: ${git_status} and message:
|
||||
${git_version}")
|
||||
endif()
|
||||
|
||||
set(archive "OpenCoarrays-${git_version}")
|
||||
set(l_archive "opencoarrays-${git_version}")
|
||||
set(release_asset "${CMAKE_ARGV4}/${archive}.tar.gz")
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" archive "--prefix=${archive}/" -o "${release_asset}" "${git_version}"
|
||||
RESULT_VARIABLE git_status
|
||||
OUTPUT_VARIABLE git_output
|
||||
WORKING_DIRECTORY "${CMAKE_ARGV3}"
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT (git_status STREQUAL "0"))
|
||||
message( FATAL_ERROR "git archive ... failed with exit status: ${git_status} and message:
|
||||
${git_output}")
|
||||
else()
|
||||
message( STATUS "Source code release asset created from `git archive`: ${release_asset}")
|
||||
endif()
|
||||
|
||||
file(SHA256 "${release_asset}" tarball_sha256)
|
||||
set(sha256_checksum "${tarball_sha256} ${archive}.tar.gz")
|
||||
configure_file("${CMAKE_ARGV3}/cmake/opencoarrays-VER-SHA256.txt.in"
|
||||
"${CMAKE_ARGV4}/${l_archive}-SHA256.txt"
|
||||
@ONLY)
|
||||
message( STATUS
|
||||
"SHA 256 checksum of release tarball written out as: ${CMAKE_ARGV4}/${l_archive}-SHA256.txt" )
|
||||
|
||||
find_program(GPG_EXECUTABLE
|
||||
gpg
|
||||
DOC "Location of GnuPG (gpg) executable")
|
||||
|
||||
if(GPG_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${GPG_EXECUTABLE}" --armor --detach-sign --comment "@gpg_comment@" "${CMAKE_ARGV4}/${l_archive}-SHA256.txt"
|
||||
RESULT_VARIABLE gpg_status
|
||||
OUTPUT_VARIABLE gpg_output
|
||||
WORKING_DIRECTORY "${CMAKE_ARGV4}")
|
||||
if(NOT (gpg_status STREQUAL "0"))
|
||||
message( WARNING "GPG signing of ${CMAKE_ARGV4}/${l_archive}-SHA256.txt appears to have failed
|
||||
with status: ${gpg_status} and output: ${gpg_output}")
|
||||
else()
|
||||
configure_file("${CMAKE_ARGV3}/cmake/opencoarrays-VER-SHA256.txt.asc.in"
|
||||
"${CMAKE_ARGV4}/${l_archive}-GPG.comment"
|
||||
@ONLY)
|
||||
file(READ "${CMAKE_ARGV4}/${l_archive}-GPG.comment" gpg_comment)
|
||||
configure_file("${CMAKE_ARGV4}/${l_archive}-SHA256.txt.asc"
|
||||
"${CMAKE_ARGV4}/${l_archive}-SHA256.txt.asc.out"
|
||||
@ONLY)
|
||||
file(RENAME "${CMAKE_ARGV4}/${l_archive}-SHA256.txt.asc.out"
|
||||
"${CMAKE_ARGV4}/${l_archive}-SHA256.txt.asc")
|
||||
message(STATUS "GPG signed SHA256 checksum created: ${CMAKE_ARGV4}/${l_archive}-SHA256.txt.asc")
|
||||
endif()
|
||||
endif()
|
||||
@ -0,0 +1,12 @@
|
||||
Mac users can use GPGTools - https://gpgtools.org
|
||||
Comment: Download Izaak Beekman's GPG public key from your
|
||||
Comment: trusted key server or from
|
||||
Comment: https://izaakbeekman.com/izaak.pubkey.txt
|
||||
Comment: Next add it to your GPG keyring, e.g.,
|
||||
Comment: `curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import`
|
||||
Comment: Make sure you have verified that the release archive's
|
||||
Comment: SHA256 checksum matches the provided
|
||||
Comment: opencoarrays-@git_version@-SHA256.txt and ensure that this file
|
||||
Comment: and it's signature are in the same directory. Then
|
||||
Comment: verify with:
|
||||
Comment: `gpg --verify opencoarrays-@git_version@-SHA256.txt.asc`
|
||||
@ -0,0 +1,3 @@
|
||||
# To verify cryptographic checksums `shasum -c opencoarrays-@git_version@-SHA256.txt` on Mac OS X, or
|
||||
# `sha256sum -c opencoarrays-@git_version@-SHA256.txt` on Linux.
|
||||
@sha256_checksum@
|
||||
@ -0,0 +1 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/OpenCoarraysTargets.cmake")
|
||||
@ -0,0 +1,23 @@
|
||||
# Adapted from http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F May 1, 2014
|
||||
|
||||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif(NOT "${rm_retval}" STREQUAL 0)
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
Loading…
Reference in New Issue