Implemented SO detection support.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
101a3f0e33
commit
b830e66966
4 changed files with 48 additions and 14 deletions
|
|
@ -40,6 +40,32 @@ if (${QTVERSION} VERSION_LESS 4.5.0)
|
||||||
message(FATAL_ERROR "You need Qt4.5, found ${QTVERSION}.")
|
message(FATAL_ERROR "You need Qt4.5, found ${QTVERSION}.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Configure OS support
|
||||||
|
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")
|
||||||
|
else()
|
||||||
|
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")
|
||||||
|
elseif(Q_WS_WIN)
|
||||||
|
set(ENABLE_X11 "0")
|
||||||
|
set(ENABLE_MAC "0")
|
||||||
|
set(ENABLE_WIN "1")
|
||||||
|
set(AUTO_OS "WIN")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "OS not supported")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Detected OS: ${AUTO_OS}")
|
||||||
|
|
||||||
set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})
|
set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})
|
||||||
find_program(GENERATOR generatorrunner REQUIRED)
|
find_program(GENERATOR generatorrunner REQUIRED)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
|
||||||
macro(execute_generator module sources typesystem_path)
|
macro(execute_generator module sources typesystem_path)
|
||||||
add_custom_command(OUTPUT ${${sources}}
|
add_custom_command(OUTPUT ${${sources}}
|
||||||
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
|
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
|
||||||
${pyside_SOURCE_DIR}/global.h
|
${CMAKE_BINARY_DIR}/PySide/global.h
|
||||||
--include-paths=${pyside_SOURCE_DIR}:${QT_INCLUDE_DIR}
|
--include-paths=${pyside_SOURCE_DIR}:${QT_INCLUDE_DIR}
|
||||||
--typesystem-paths=${pyside_SOURCE_DIR}:${typesystem_path}
|
--typesystem-paths=${pyside_SOURCE_DIR}:${typesystem_path}
|
||||||
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
|
@ -16,6 +16,11 @@ COMMENT "Running generator for ${module}..."
|
||||||
)
|
)
|
||||||
endmacro(execute_generator)
|
endmacro(execute_generator)
|
||||||
|
|
||||||
|
# Configure include based on platform
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/global.h" @ONLY)
|
||||||
|
|
||||||
|
|
||||||
# Only add subdirectory if the associated Qt module is found.
|
# Only add subdirectory if the associated Qt module is found.
|
||||||
macro(HAS_QT_MODULE var name)
|
macro(HAS_QT_MODULE var name)
|
||||||
if (DISABLE_${name})
|
if (DISABLE_${name})
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,7 @@ macro(CHECK_QT_GUI_MACRO macro_display_name qt_macro module_sources global_sourc
|
||||||
endif()
|
endif()
|
||||||
endmacro(CHECK_QT_GUI_MACRO)
|
endmacro(CHECK_QT_GUI_MACRO)
|
||||||
|
|
||||||
if(Q_WS_X11)
|
if(ENABLE_X11)
|
||||||
set(AUTO_OS "X11")
|
|
||||||
set(MODULE_NAME "x11")
|
set(MODULE_NAME "x11")
|
||||||
set(SPECIFIC_OS_FILES
|
set(SPECIFIC_OS_FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
|
||||||
|
|
@ -49,16 +48,12 @@ if(Q_WS_X11)
|
||||||
)
|
)
|
||||||
endif(Q_WS_MAEMO_5)
|
endif(Q_WS_MAEMO_5)
|
||||||
|
|
||||||
elseif(Q_WS_MAC)
|
elseif(ENABLE_MAC)
|
||||||
set(AUTO_OS "MAC")
|
|
||||||
set(MODULE_NAME "mac")
|
set(MODULE_NAME "mac")
|
||||||
set(SPECIFIC_OS_FILES
|
set(SPECIFIC_OS_FILES
|
||||||
)
|
)
|
||||||
else()
|
endif(ENABLE_X11)
|
||||||
message(FATAL_ERROR "OS not supported")
|
|
||||||
endif(Q_WS_X11)
|
|
||||||
|
|
||||||
message(STATUS "Detected OS: ${AUTO_OS}")
|
|
||||||
|
|
||||||
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
|
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
|
||||||
set (QtGui_46_SRC )
|
set (QtGui_46_SRC )
|
||||||
|
|
|
||||||
|
|
@ -330,20 +330,28 @@ QT_END_NAMESPACE
|
||||||
|
|
||||||
QT_END_HEADER
|
QT_END_HEADER
|
||||||
|
|
||||||
//#define Q_QDOC
|
|
||||||
#define qdoc
|
#define qdoc
|
||||||
//#undef Q_MOC_RUN
|
|
||||||
|
|
||||||
//Export X11 related functions
|
#if @ENABLE_X11@
|
||||||
#define Q_WS_X11
|
#define Q_WS_X11
|
||||||
|
#elif @ENABLE_MAC@
|
||||||
|
#define Q_WS_MAC
|
||||||
|
#elif @ENABLE_WIN@
|
||||||
|
#define Q_WS_WIN
|
||||||
|
#endif
|
||||||
|
|
||||||
// There are symbols in Qt that exist in Debug but
|
// There are symbols in Qt that exist in Debug but
|
||||||
// not in release
|
// not in release
|
||||||
#define QT_NO_DEBUG
|
#define QT_NO_DEBUG
|
||||||
|
|
||||||
#include <QtCore/QtCore>
|
#include <QtCore/QtCore>
|
||||||
|
#if @ENABLE_MAC@
|
||||||
|
#undef qdoc
|
||||||
|
#endif
|
||||||
#include <QtGui/QtGui>
|
#include <QtGui/QtGui>
|
||||||
#include <QtGui/QX11Info>
|
#if @ENABLE_X11@
|
||||||
|
#include <QtGui/QX11Info>
|
||||||
|
#endif
|
||||||
#include <QtXml/QtXml>
|
#include <QtXml/QtXml>
|
||||||
#include <QtUiTools/QtUiTools>
|
#include <QtUiTools/QtUiTools>
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue