From 3c36d444729ee9285bb4ab0252968057bf904a8d Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Fri, 13 Aug 2010 22:32:07 -0400 Subject: Various cleanups to CMakeLists.txt files * Simplify endmacro(), endif() and else() statements * Remove unused and redundant code * Use AUTO_OS for holding the typesystem suffix (instead of MODULE_NAME) Reviewed-by: Luciano Wolf Reviewed-by: Hugo Parente Lima --- PySide/CMakeLists.txt | 6 +++--- PySide/QtGui/CMakeLists.txt | 20 ++++---------------- PySide/QtGui/typesystem_gui.xml.in | 2 +- PySide/QtMaemo5/CMakeLists.txt | 4 ++-- PySide/QtNetwork/CMakeLists.txt | 5 ++--- PySide/QtSvg/CMakeLists.txt | 10 ---------- PySide/QtTest/CMakeLists.txt | 1 - PySide/QtWebKit/CMakeLists.txt | 3 +-- 8 files changed, 13 insertions(+), 38 deletions(-) (limited to 'PySide') diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt index 10e0bc71b..d823019f6 100644 --- a/PySide/CMakeLists.txt +++ b/PySide/CMakeLists.txt @@ -4,7 +4,7 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" macro(execute_generator module sources typesystem_path) message("Running generator for ${module}...") -endmacro(execute_generator) +endmacro() macro(create_pyside_module module_name typesystem_file module_include_dir module_libraries module_deps module_typesystem_path module_sources) add_custom_command(OUTPUT ${${module_sources}} @@ -42,7 +42,7 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module DESTINATION include/PySide/${module_name}/) install(FILES ${typesystem_file} DESTINATION share/PySide/typesystems) -endmacro(create_pyside_module) +endmacro() # Configure include based on platform @@ -61,7 +61,7 @@ else() message(STATUS "${name} NOT found. ${name} support disabled.") endif() endif() -endmacro(HAS_QT_MODULE) +endmacro() execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_BINARY_DIR}/PySide/__init__.py") diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt index 9d2b89704..a848b65e0 100644 --- a/PySide/QtGui/CMakeLists.txt +++ b/PySide/QtGui/CMakeLists.txt @@ -31,32 +31,20 @@ macro(CHECK_QT_GUI_MACRO macro_display_name qt_macro module_sources global_sourc message(STATUS "Testing support to ${macro_display_name} -- disabled") endif() endif() -endmacro(CHECK_QT_GUI_MACRO) +endmacro() if(ENABLE_X11) - set(MODULE_NAME "x11") set(SPECIFIC_OS_FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp ) if(Q_WS_MAEMO_5) - set(AUTO_OS "MAEMO 5") - set(MODULE_NAME "maemo") set(SPECIFIC_OS_FILES ${SPECIFIC_OS_FILES} ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractkineticscroller_wrapper.cpp ) - endif(Q_WS_MAEMO_5) - -elseif(ENABLE_MAC) - set(MODULE_NAME "mac") - set(SPECIFIC_OS_FILES - ) -elseif(ENABLE_WIN) - set(MODULE_NAME "win") - set(SPECIFIC_OS_FILES - ) -endif(ENABLE_X11) + endif() +endif() if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) @@ -98,7 +86,7 @@ else() ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector3d_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector4d_wrapper.cpp ) -endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) +endif () set(QtGui_SRC ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractbutton_wrapper.cpp diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in index 2dc967626..3ef63d9c9 100644 --- a/PySide/QtGui/typesystem_gui.xml.in +++ b/PySide/QtGui/typesystem_gui.xml.in @@ -1,5 +1,5 @@ - + diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt index fbcf75f08..4eb236405 100644 --- a/PySide/QtMaemo5/CMakeLists.txt +++ b/PySide/QtMaemo5/CMakeLists.txt @@ -17,11 +17,11 @@ set(QtMaemo5_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:$ if(NOT QT_QTMAEMO5_INCLUDE_DIR) FIND_PATH(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5 PATHS ${QT_HEADERS_DIR}/QtMaemo5 NO_DEFAULT_PATH) -endif(NOT QT_QTMAEMO5_INCLUDE_DIR) +endif() if(NOT QT_QTMAEMO5_LIBRARY) FIND_LIBRARY(QT_QTMAEMO5_LIBRARY QtMaemo5 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) -endif(NOT QT_QTMAEMO5_LIBRARY) +endif() set(QtMaemo5_include_dirs ${CMAKE_CURRENT_SOURCE_DIR} ${QT_QTCORE_INCLUDE_DIR} diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt index 15504990d..0d89e2869 100644 --- a/PySide/QtNetwork/CMakeLists.txt +++ b/PySide/QtNetwork/CMakeLists.txt @@ -31,8 +31,7 @@ macro(CHECK_QT_NETWORK_MACRO macro_display_name qt_macro module_sources global_s message(STATUS "Testing support to ${macro_display_name} -- disabled") endif() endif() -endmacro(CHECK_QT_NETWORK_MACRO) - +endmacro() if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6) set (QtNetwork_47_SRC @@ -71,7 +70,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtcpsocket_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtnetwork_module_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qudpsocket_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp -${SPECIFIC_OS_FILES} + ${QtNetwork_47_SRC} ) diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt index a56ee3382..bd675366b 100644 --- a/PySide/QtSvg/CMakeLists.txt +++ b/PySide/QtSvg/CMakeLists.txt @@ -1,21 +1,11 @@ project(QtSvg) -if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) - set (QtSvg_46_SRC ) -else () - set(QtSvg_46_SRC - ) -endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) - set(QtSvg_SRC ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qgraphicssvgitem_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvggenerator_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgrenderer_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp - -${SPECIFIC_OS_FILES} -${QtSvg_46_SRC} ) set(QtSvg_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}") diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt index 4bf0bca25..cb9e4d5c1 100644 --- a/PySide/QtTest/CMakeLists.txt +++ b/PySide/QtTest/CMakeLists.txt @@ -3,7 +3,6 @@ project(QtTest) set(QtTest_SRC ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp -${SPECIFIC_OS_FILES} ) set(QtTest_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}") diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt index 9039835b4..f2ca036f3 100644 --- a/PySide/QtWebKit/CMakeLists.txt +++ b/PySide/QtWebKit/CMakeLists.txt @@ -9,7 +9,7 @@ else () ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebinspector_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qgraphicswebview_wrapper.cpp ) -endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) +endif () set(QtWebKit_SRC ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qtwebkit_module_wrapper.cpp @@ -28,7 +28,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebsettings_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebview_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp -${SPECIFIC_OS_FILES} ${QtWebKit_46_SRC} ) -- cgit v1.2.3