summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-18 09:44:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-18 10:05:52 +0200
commitf1e71e68512bc58f3f41ba4566f9d1574773d742 (patch)
treeda6e7c1f8769354678a75781be950d5f910b9c08
parent14d27dd0998b18a2eb13d30c8680701a9b619a08 (diff)
cmake: regen before making tarball
Updates timestamp as it should.
-rw-r--r--CMakeLists.txt9
-rw-r--r--cmake/tarball.cmake8
-rw-r--r--make-tar.sh1
3 files changed, 13 insertions, 5 deletions
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 : &&