aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2007-05-01 00:08:34 +0000
committerLaurent Montel <montel@kde.org>2007-05-01 00:08:34 +0000
commit108f7675a6eb802d97a985238ab2ded3bf86683b (patch)
tree9a58e7eee59b571b3a78bf22d98743e56f384cc4 /modules
parent8e07947a840d119cf81e081e89e89606403792b4 (diff)
downloadextra-cmake-modules-108f7675a6eb802d97a985238ab2ded3bf86683b.tar.gz
extra-cmake-modules-108f7675a6eb802d97a985238ab2ded3bf86683b.tar.bz2
not necessary to have a cmake directory here.
adapt FindKMetaData.cmake move KMetaDataMacros.cmake into cmake/modules remove FindKNEpomuk (already into kdebase) svn path=/trunk/KDE/kdelibs/; revision=659887
Diffstat (limited to 'modules')
-rw-r--r--modules/FindKMetaData.cmake1
-rw-r--r--modules/KMetaDataMacros.cmake49
2 files changed, 50 insertions, 0 deletions
diff --git a/modules/FindKMetaData.cmake b/modules/FindKMetaData.cmake
index 3355d60f..1cdb801b 100644
--- a/modules/FindKMetaData.cmake
+++ b/modules/FindKMetaData.cmake
@@ -19,6 +19,7 @@ FIND_PATH(KMETADATA_INCLUDE_DIR
FIND_LIBRARY(KMETADATA_LIBRARIES
NAMES
kmetadata
+ kmetadatatools
PATHS
/usr/lib
/usr/local/lib
diff --git a/modules/KMetaDataMacros.cmake b/modules/KMetaDataMacros.cmake
new file mode 100644
index 00000000..7e4215e9
--- /dev/null
+++ b/modules/KMetaDataMacros.cmake
@@ -0,0 +1,49 @@
+# This file contains the following macros:
+#
+# KMETADATA_GENERATE_FROM_ONTOLOGY
+#
+
+
+#
+# KMETADATA_GENERATE_FROM_ONTOLOGY
+# (C) 2007 Sebastian Trueg <trueg@kde.org>
+#
+# Parameters:
+# ontofile - Path to the NRL ontology defining the resources to be generated.
+# targetdir - Folder to which the generated sources should be written.
+# out_headers - Variable which will be filled with the names of all generated headers.
+# out_sources - Variable which will be filled with the names of all generated sources.
+# out_includes - Variable which will be filled with complete include statements of all
+# generated resource classes.
+#
+# In addition to the parameters an arbitrary number of template filenames can be set as arguments
+#
+macro(KMETADATA_GENERATE_FROM_ONTOLOGY ontofile targetdir out_headers out_sources out_includes)
+
+ FIND_PROGRAM(RCGEN kmetadata_rcgen PATHS ${BIN_INSTALL_DIR})
+ if(RCGEN-NOTFOUND)
+ message( FATAL_ERROR "Failed to find the KMetaData source generator" )
+ endif(RCGEN-NOTFOUND)
+
+ FILE(TO_NATIVE_PATH ${RCGEN} RCGEN)
+
+ execute_process(
+ COMMAND ${RCGEN} --listheaders --prefix ${targetdir}/ ${ontofile}
+ OUTPUT_VARIABLE ${out_headers}
+ )
+
+ execute_process(
+ COMMAND ${RCGEN} --listsources --prefix ${targetdir}/ ${ontofile}
+ OUTPUT_VARIABLE ${out_sources}
+ )
+
+ execute_process(
+ COMMAND ${RCGEN} --listincludes ${ontofile}
+ OUTPUT_VARIABLE ${out_includes}
+ )
+
+ execute_process(
+ COMMAND ${RCGEN} --writeall --templates ${ARGN} ${targetdir}/ ${ontofile}
+ )
+
+endmacro(KMETADATA_GENERATE_FROM_ONTOLOGY)