Added a target to build an archive from git repo
authorRomain Forlot <romain.forlot@iot.bzh>
Fri, 9 Jun 2017 08:43:07 +0000 (10:43 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Fri, 9 Jun 2017 09:42:10 +0000 (11:42 +0200)
Change-Id: If6f491f7bf8e3e7a29b9c9db369126dc550318c3
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
cmake/common.cmake

index 941e721..d55f907 100644 (file)
@@ -406,5 +406,12 @@ macro(project_closing_msg)
        endif()
 endmacro()
 
-# Add RSYSTARGET
+# Add RSYNCTARGET
 remote_targets_populate()
+
+add_custom_command(OUTPUT ${PROJECT_PKG_ENTRY_POINT}/${PROJECT_NAME}_${PROJECT_VERSION}.orig.tar.gz
+DEPENDS ${PROJECT_TARGETS}
+ COMMAND git --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git archive --format=tar.gz --prefix=${PROJECT_NAME}-${PROJECT_VERSION}/ HEAD -o ${PROJECT_PKG_ENTRY_POINT}/${PROJECT_NAME}_${PROJECT_VERSION}.orig.tar.gz
+)
+
+add_custom_target(archive DEPENDS ${PROJECT_PKG_ENTRY_POINT}/${PROJECT_NAME}_${PROJECT_VERSION}.orig.tar.gz)