aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-08-13 22:46:19 +0200
committerAlex Neundorf <neundorf@kde.org>2012-08-13 22:46:19 +0200
commit926cce14a83f93a074ebb55b8d98e76b7ae16d2a (patch)
tree8c9b657e8eaf36e2a66d9de567c537acd4eab9be /modules
parent47b79ffd202700c0b0487a4576afe8e8ba546995 (diff)
downloadextra-cmake-modules-926cce14a83f93a074ebb55b8d98e76b7ae16d2a.tar.gz
extra-cmake-modules-926cce14a83f93a074ebb55b8d98e76b7ae16d2a.tar.bz2
-add function ecm_write_version_header(<outputfile>) which generates a foo_version.h
The plan is strip this out of ECMQtFramework.cmake, then ECMQtFramework.cmake will be basically only deal with those Config.cmake files. Alex
Diffstat (limited to 'modules')
-rw-r--r--modules/ECMWriteVersionHeader.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/ECMWriteVersionHeader.cmake b/modules/ECMWriteVersionHeader.cmake
new file mode 100644
index 00000000..4521cc3c
--- /dev/null
+++ b/modules/ECMWriteVersionHeader.cmake
@@ -0,0 +1,22 @@
+# - Function for generating a version.h file
+#
+# The ECM_WRITE_VERSION_HEADER() function is used write a simple version header
+# which contains macros for the major, minor and patch version numbers of the
+# project. This version header then is usually installed.
+# As version numbers the one set using ecm_version() is used.
+function(ECM_WRITE_VERSION_HEADER _filename)
+
+ string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
+
+ if(IS_ABSOLUTE "${_filename}")
+ set(absFilename "${_filename}")
+ else()
+ set(absFilename "${CMAKE_CURRENT_BINARY_DIR}/${_filename}")
+ endif()
+
+ configure_file(
+ "${ECM_MODULE_DIR}/ECMVersionHeader.h.in"
+ "${absFilename}"
+# "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_version.h"
+ )
+endfunction()