From f1e71e68512bc58f3f41ba4566f9d1574773d742 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Oct 2015 09:44:47 +0200 Subject: cmake: regen before making tarball Updates timestamp as it should. --- CMakeLists.txt | 9 +++++---- cmake/tarball.cmake | 8 ++++++++ make-tar.sh | 1 - 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 cmake/tarball.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 482bdb6c..78d9cab8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,10 +216,11 @@ set(filename_0 "${OPENTRACK_COMMIT}") string(TIMESTAMP filename_1 "%Y%m%d%H%M%S") set(filename "${CMAKE_BINARY_DIR}/${filename_0}-${filename_1}.zip") -add_custom_command(OUTPUT ${filename} COMMAND /usr/bin/env sh - "${CMAKE_SOURCE_DIR}/make-tar.sh" "${CMAKE_INSTALL_PREFIX}" - "${filename}" "${CMAKE_BINARY_DIR}") -add_custom_target(tarball DEPENDS "${filename}") +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) opentrack_module(opentrack-api opentrack) opentrack_qt(opentrack-api) diff --git a/cmake/tarball.cmake b/cmake/tarball.cmake new file mode 100644 index 00000000..5761e24a --- /dev/null +++ b/cmake/tarball.cmake @@ -0,0 +1,8 @@ +execute_process(COMMAND cmake ${CMAKE_BINARY_DIR} RESULT_VARIABLE ret) +if(NOT ret EQUAL 0) + message(FATAL_ERROR "can't regen") +endif() +execute_process(COMMAND cmake --build ${CMAKE_BINARY_DIR} --target tarball-real2) +if(NOT ret EQUAL 0) + message(FATAL_ERROR "can't make tarball") +endif() diff --git a/make-tar.sh b/make-tar.sh index 9d1af1f3..3e119d12 100644 --- a/make-tar.sh +++ b/make-tar.sh @@ -4,7 +4,6 @@ prefix="$1" filename="$2" bin="$3" -cmake "$bin" || exit 1 cmake --build "$bin" --target install || exit 1 if : && -- cgit v1.2.3