diff options
| author | Laurent Montel <montel@kde.org> | 2007-05-01 00:08:34 +0000 | 
|---|---|---|
| committer | Laurent Montel <montel@kde.org> | 2007-05-01 00:08:34 +0000 | 
| commit | 108f7675a6eb802d97a985238ab2ded3bf86683b (patch) | |
| tree | 9a58e7eee59b571b3a78bf22d98743e56f384cc4 /modules/KMetaDataMacros.cmake | |
| parent | 8e07947a840d119cf81e081e89e89606403792b4 (diff) | |
| download | extra-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/KMetaDataMacros.cmake')
| -rw-r--r-- | modules/KMetaDataMacros.cmake | 49 | 
1 files changed, 49 insertions, 0 deletions
| 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) | 
