diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 07:37:41 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 08:39:32 +0100 |
commit | aa066bdd4622d4f6824fee864f6be6806813f04d (patch) | |
tree | 3df328b8b364cba2373a85827191b259bd78d546 /cmake/opentrack-tarball.cmake | |
parent | d6a54431d178632a2bf466c9904f74abd143afe6 (diff) |
move to subdirectory-based build system
Closes #224
Diffstat (limited to 'cmake/opentrack-tarball.cmake')
-rw-r--r-- | cmake/opentrack-tarball.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/opentrack-tarball.cmake b/cmake/opentrack-tarball.cmake new file mode 100644 index 00000000..6b40081b --- /dev/null +++ b/cmake/opentrack-tarball.cmake @@ -0,0 +1,23 @@ +string(TIMESTAMP filename-date "%Y%m%d") +set(filename-ostype ${CMAKE_SYSTEM_NAME}) +get_git_head_revision(filename-branch_0 filename-hash_0) +if(filename-hash_0) + string(SUBSTRING "${filename-hash_0}" 0 7 filename-hash) +endif() +string(REPLACE "refs/heads/" "" filename-branch_1 "${filename-branch_0}") +string(REPLACE "/" "-" filename-branch "${filename-branch_1}") +set(filename_0 "${OPENTRACK_COMMIT}") +set(filename_1) +if (NOT OPENTRACK_TAG_EXACT STREQUAL OPENTRACK_COMMIT) + string(TIMESTAMP filename_1 "-%Y%m%d%H%M%S") +endif() +set(filename "${CMAKE_BINARY_DIR}/${filename_0}${filename_1}.zip") + +add_custom_target(tarball-real) +add_custom_target(tarball-real2) +add_custom_command(TARGET tarball-real COMMAND cmake -P ${CMAKE_SOURCE_DIR}/cmake/tarball.cmake) + +add_custom_command(TARGET tarball-real2 COMMAND /usr/bin/env sh + "${CMAKE_SOURCE_DIR}/make-tar.sh" "${CMAKE_INSTALL_PREFIX}" + "${filename}" "${CMAKE_BINARY_DIR}") +add_custom_target(tarball DEPENDS tarball-real) |