From 811e37c378ee12dca738e57c640385c9e0546355 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 8 Feb 2011 11:57:59 -0300 Subject: 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 Hugo Parente Lima --- cmake/Macros/PySideModules.cmake | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'cmake/Macros/PySideModules.cmake') 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, '', '%s\\n' % 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}) -- cgit v1.2.3