summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/Dist.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/modules/Dist.cmake b/cmake/modules/Dist.cmake
new file mode 100644
index 0000000000..7c0b3bb105
--- /dev/null
+++ b/cmake/modules/Dist.cmake
@@ -0,0 +1,11 @@
+message("Copying source files from ${PROJECT_SOURCE_DIR} to ${WS_SOURCE_DIR}")
+
+# create destination dir
+file(MAKE_DIRECTORY "${WS_SOURCE_DIR}")
+
+# Copy all files in the state *as known by git*, respecting export-ignore in .gitattributes
+execute_process(COMMAND "${GIT_EXECUTABLE}" checkout-index -a -f --prefix "${WS_SOURCE_DIR}/" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
+
+# Generate the version.conf and put it in brand new source dir
+execute_process(COMMAND "${GIT_EXECUTABLE}" describe WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE GIT_DESCRIBE)
+file(WRITE "${WS_SOURCE_DIR}/version.conf" "git_description=${GIT_DESCRIBE}")