diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2010-08-13 22:32:07 -0400 |
---|---|---|
committer | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2010-08-26 11:04:58 -0400 |
commit | 3c36d444729ee9285bb4ab0252968057bf904a8d (patch) | |
tree | bc5790e5afa2bf2cf1589b7f2fd182f471e4bbee | |
parent | 2593f9fccc71a200c5a802b2e05717910885e864 (diff) |
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 <luciano.wolf@openbossa.org>
Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | PySide/CMakeLists.txt | 6 | ||||
-rw-r--r-- | PySide/QtGui/CMakeLists.txt | 20 | ||||
-rw-r--r-- | PySide/QtGui/typesystem_gui.xml.in | 2 | ||||
-rw-r--r-- | PySide/QtMaemo5/CMakeLists.txt | 4 | ||||
-rw-r--r-- | PySide/QtNetwork/CMakeLists.txt | 5 | ||||
-rw-r--r-- | PySide/QtSvg/CMakeLists.txt | 10 | ||||
-rw-r--r-- | PySide/QtTest/CMakeLists.txt | 1 | ||||
-rw-r--r-- | PySide/QtWebKit/CMakeLists.txt | 3 | ||||
-rw-r--r-- | doc/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 4 |
11 files changed, 27 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5dc7e07..244e5586a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,25 +72,22 @@ if (${QTVERSION} VERSION_LESS 4.5.0) endif() # Configure OS support +set(ENABLE_X11 "0") +set(ENABLE_MAC "0") +set(ENABLE_WIN "0") if(Q_WS_X11) set(ENABLE_X11 "1") - set(ENABLE_MAC "0") - set(ENABLE_WIN "0") if(Q_WS_MAEMO_5) - set(AUTO_OS "MAEMO 5") + set(AUTO_OS "maemo") else() - set(AUTO_OS "X11") + set(AUTO_OS "x11") endif() elseif(Q_WS_MAC) - set(ENABLE_X11 "0") set(ENABLE_MAC "1") - set(ENABLE_WIN "0") - set(AUTO_OS "MAC") + set(AUTO_OS "mac") elseif(Q_WS_WIN) - set(ENABLE_X11 "0") - set(ENABLE_MAC "0") set(ENABLE_WIN "1") - set(AUTO_OS "WIN") + set(AUTO_OS "win") else() message(FATAL_ERROR "OS not supported") endif() 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 @@ <?xml version="1.0"?> <typesystem package="PySide.QtGui"> <load-typesystem name="typesystem_core.xml" generate="no"/> - <load-typesystem name="typesystem_gui_@MODULE_NAME@.xml" generate="yes"/> + <load-typesystem name="typesystem_gui_@AUTO_OS@.xml" generate="yes"/> </typesystem> 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} ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 7bad422df..37dc8d63c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -43,7 +43,7 @@ COMMENT "Running generator to generate documentation of ${module}..." ) add_dependencies("${module}-apidoc" qdoc3) add_dependencies(apidoc "${module}-apidoc") -endmacro(create_doc module) +endmacro() create_doc(QtCore "") create_doc(QtGui "${QtCore_SOURCE_DIR}") @@ -79,11 +79,11 @@ add_custom_target(apidocinstall add_dependencies(apidocinstall apidevhelp) -else (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND) +else () message(STATUS "Missing graphviz tool (dot), apidoc generation targets disabled.") -endif (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND) +endif () -else (QT_SRC_DIR) +else () message(STATUS "QT_SRC_DIR variable not set, apidoc generation targets disabled.") -endif (QT_SRC_DIR) +endif () diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ce457965e..4cacd140a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ else() if(NOT DISABLE_${name} AND ${var}) add_subdirectory(${name}) endif() - endmacro(TEST_QT_MODULE) + endmacro() macro(PYSIDE_TEST) string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" ) @@ -43,7 +43,7 @@ else() TIMEOUT ${CTEST_TESTING_TIMEOUT} WILL_FAIL ${EXPECT_TO_FAIL} ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}") - endmacro(PYSIDE_TEST) + endmacro() # Try to find QtMultimedia # TODO: Remove this hack when cmake support QtMultimedia module |