summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorManuel Bentele2020-10-27 13:51:35 +0100
committerManuel Bentele2020-10-27 13:51:35 +0100
commit7aeef0fef9d506bec53be5b9e660e41bae9b49c0 (patch)
treefaf7282d3f26cd8051fb0bd0da14796d68d6928b /cmake
parentRemove the build requirement for an unused C++ compiler (diff)
downloadxloop-7aeef0fef9d506bec53be5b9e660e41bae9b49c0.tar.gz
xloop-7aeef0fef9d506bec53be5b9e660e41bae9b49c0.tar.xz
xloop-7aeef0fef9d506bec53be5b9e660e41bae9b49c0.zip
Fix broken version header packaging for source packages
Diffstat (limited to 'cmake')
-rw-r--r--cmake/InstallVersionFile.cmake.in8
-rw-r--r--cmake/PostVersionPackaging.cmake9
-rw-r--r--cmake/PreVersionPackaging.cmake11
3 files changed, 20 insertions, 8 deletions
diff --git a/cmake/InstallVersionFile.cmake.in b/cmake/InstallVersionFile.cmake.in
deleted file mode 100644
index 8121c25..0000000
--- a/cmake/InstallVersionFile.cmake.in
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# AUTOGENERATED: DO NOT EDIT THIS FILE
-#
-
-if(CPACK_SOURCE_INSTALLED_DIRECTORIES AND EXISTS "@INCLUDE_VERSION_HEADER_GENERATE@")
- file(INSTALL "@INCLUDE_VERSION_HEADER_GENERATE@"
- DESTINATION "@INCLUDE_VERSION_HEADER_GENERATE_PREFIX@")
-endif(CPACK_SOURCE_INSTALLED_DIRECTORIES AND EXISTS "@INCLUDE_VERSION_HEADER_GENERATE@")
diff --git a/cmake/PostVersionPackaging.cmake b/cmake/PostVersionPackaging.cmake
new file mode 100644
index 0000000..877cd12
--- /dev/null
+++ b/cmake/PostVersionPackaging.cmake
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2020 Manuel Bentele <development@manuel-bentele.de>
+#
+
+if(EXISTS ${VERSION_HEADER_INPUT_FILE})
+ # remove version.h if generated version.h is available from a Git build
+ file(REMOVE ${VERSION_HEADER_OUTPUT_FILE})
+endif(EXISTS ${VERSION_HEADER_INPUT_FILE})
diff --git a/cmake/PreVersionPackaging.cmake b/cmake/PreVersionPackaging.cmake
new file mode 100644
index 0000000..e960155
--- /dev/null
+++ b/cmake/PreVersionPackaging.cmake
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2020 Manuel Bentele <development@manuel-bentele.de>
+#
+
+if(EXISTS ${VERSION_HEADER_INPUT_FILE})
+ # copy generated version.h into the source repository for packaging purposes
+ get_filename_component(VERSION_HEADER_OUTPUT_FILE_PATH ${VERSION_HEADER_OUTPUT_FILE} PATH)
+ file(COPY ${VERSION_HEADER_INPUT_FILE}
+ DESTINATION ${VERSION_HEADER_OUTPUT_FILE_PATH})
+endif(EXISTS ${VERSION_HEADER_INPUT_FILE})