summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-10-23 08:06:52 +0200
committerMichal Minar <miminar@redhat.com>2013-10-24 10:28:30 +0200
commit82c2688adeda9286de8819a254c7d0ca1ef0669f (patch)
tree8d2628262c4f9b268d204eefae62a30158ba7a69 /src/CMakeLists.txt
parent74068b042909f529d878daa6a3cd85eee7ca4f8c (diff)
downloadopenlmi-providers-82c2688adeda9286de8819a254c7d0ca1ef0669f.tar.gz
openlmi-providers-82c2688adeda9286de8819a254c7d0ca1ef0669f.tar.xz
openlmi-providers-82c2688adeda9286de8819a254c7d0ca1ef0669f.zip
python: let's not hardcode version in setups
Let's write openlmi version to the main __init__ module of each python egg at build time. This version information is easily accessible from setup scripts.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5101e76..e2317ed 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -59,3 +59,11 @@ endif (WITH-SOFTWARE)
if (WITH-JOURNALD)
add_subdirectory(journald)
endif (WITH-JOURNALD)
+
+file(GLOB INIT_SKELS "*/lmi/*/__init__.skel")
+foreach(SKEL ${INIT_SKELS})
+ #TODO: find a way how to do it in cmake
+ execute_process(COMMAND dirname ${SKEL} OUTPUT_VARIABLE SKEL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ configure_file(${SKEL} "${SKEL_DIR}/__init__.py" @ONLY)
+ message(STATUS "Written ${SKEL_DIR}/__init__.py module.")
+endforeach(SKEL)