summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/cmakelibcpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-07-30 01:12:11 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-07-30 16:00:40 +0200
commitc7d308a9ba6c0ef1639b7b78848a3dd2117fde0a (patch)
tree3f5ac0754bc7bfdfab203ca0a7144eb808549139 /languages/cpp/app_templates/cmakelibcpp
parentfe44776673b28ca94338f23d8e7ac71593fa88ba (diff)
downloadtdevelop-c7d308a9ba6c0ef1639b7b78848a3dd2117fde0a.tar.gz
tdevelop-c7d308a9ba6c0ef1639b7b78848a3dd2117fde0a.zip
Use tde_create_tarball, which is ready for reproducible builds,
instead of calling 'tar' and requiring GNU extensions. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'languages/cpp/app_templates/cmakelibcpp')
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt24
1 files changed, 19 insertions, 5 deletions
diff --git a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt
index d2dec700..a434a860 100644
--- a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt
+++ b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt
@@ -9,11 +9,25 @@
#
#################################################
-add_custom_target( cmakelibcpp.tar.gz ALL
- COMMAND ${TAR} --transform \"flags=r\;s/cmakelibcpp-CMakeLists.txt/CMakeLists.txt/\"
- -zcf cmakelibcpp.tar.gz -C ${CMAKE_CURRENT_SOURCE_DIR}
- test.cpp lib.h lib.cpp cmakelibcpp.png
- cmakelibcpp-CMakeLists.txt CMakeLists.txt.src
+set( _tarball_files
+ test.cpp lib.h lib.cpp cmakelibcpp.png CMakeLists.txt.src
+)
+set( _tarball_content ${_tarball_files} CMakeLists.txt )
+list( SORT _tarball_content )
+
+file(
+ COPY ${_tarball_files} cmakelibcpp-CMakeLists.txt
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
+)
+file(
+ RENAME ${CMAKE_CURRENT_BINARY_DIR}/cmakelibcpp-CMakeLists.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/CMakeLists.txt
+)
+
+tde_create_tarball(
+ TARGET cmakelibcpp.tar.gz
+ SOURCEDIR ${CMAKE_CURRENT_BINARY_DIR}
+ FILES ${_tarball_content}
)