summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-08 11:57:59 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-08 14:49:37 -0300
commit8e4b414844c66b07fdbd22d92d0261519f0edde5 (patch)
tree248f6ab06b640f855f05b2dd6025ad77db251de0 /cmake
parent9b3d0b2ef2899d88ec026d81b84c45e4b501a17b (diff)
downloadpyside-8e4b414844c66b07fdbd22d92d0261519f0edde5.tar.gz
pyside-8e4b414844c66b07fdbd22d92d0261519f0edde5.tar.xz
pyside-8e4b414844c66b07fdbd22d92d0261519f0edde5.zip
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 005e6e8..4476eb4 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)