aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-08 11:57:59 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:55 -0300
commit811e37c378ee12dca738e57c640385c9e0546355 (patch)
tree2998eb37b505aaaa8de74031c52aa859595644f2 /cmake
parent9386dd0452eb72c0940f14756254c4e14ac76415 (diff)
Separated class typesystem from the main typesystem.
Remove class specification, detected during the compilation from the main typesystem to avoid errors during the generation. Fixes bug #661 Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Macros/PySideModules.cmake26
1 files changed, 22 insertions, 4 deletions
diff --git a/cmake/Macros/PySideModules.cmake b/cmake/Macros/PySideModules.cmake
index 44ea8ea15..2f695317f 100644
--- a/cmake/Macros/PySideModules.cmake
+++ b/cmake/Macros/PySideModules.cmake
@@ -43,19 +43,37 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
endmacro()
-#macro(check_qt_class_with_namespace module namespace class global_sources [namespace])
-macro(check_qt_class module class global_sources)
- if (${ARGC} GREATER 3)
+macro(append_class_xml commom_xml class_xml)
+ INCLUDE(FindPythonInterp)
+ set(REPLACE_PROGRAM "import string; \\
+ commomFile = open('${commom_xml}', 'r'); \\
+ commomData = commomFile.read(); \\
+ commomFile.close(); \\
+ objectFile = open('${class_xml}', 'r'); \\
+ objectData = objectFile.read(); \\
+ objectFile.close(); \\
+ commomData = string.replace(commomData, '</typesystem>', '%s\\n</typesystem>' % objectData); \\
+ commomFile = open('${commom_xml}', 'w'); \\
+ commomFile.write(commomData); \\
+ commomFile.close();")
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "${REPLACE_PROGRAM}")
+endmacro()
+
+#macro(check_qt_class_with_namespace module namespace class global_sources commom_xml class_xml [namespace] [module])
+macro(check_qt_class module class global_sources commom_xml)
+ if (${ARGC} GREATER 4)
set (namespace ${ARGV3})
string(TOLOWER ${namespace} _namespace)
else ()
set (namespace "")
endif ()
- if (${ARGC} GREATER 4)
+ if (${ARGC} GREATER 5)
set (include_file ${ARGV4})
else ()
set (include_file ${module})
endif ()
+ append_class_xml(${commom_xml} "${CMAKE_CURRENT_SOURCE_DIR}/optional/${class}.xml")
string(TOLOWER ${class} _class)
string(TOUPPER ${module} _module)
if (${namespace})