Skip to content

added missing header and travis/osx #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: cpp

os: osx

sudo: required

before_install:
- brew update
- brew cask uninstall oclint
- brew install gcc qt5

script:
- cmake -DQt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5 -UQT_QMAKE_EXECUTABLE -DPythonQt_Wrap_QtAll=TRUE .
- make
- make install

install:
38 changes: 33 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ if(DEFINED Qt5_DIR AND DEFINED QT_QMAKE_EXECUTABLE)
To build with Qt4, specify QT_QMAKE_EXECUTABLE. To build with Qt5, specify Qt5_DIR.")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_64 TRUE)
else()
set(ARCH_64 FALSE)
endif()
if(MINGW AND ARCH_64)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wa,-mbig-obj")
endif()

# Set PythonQt_QT_VERSION
if(DEFINED Qt5_DIR)
message(STATUS "${PROJECT_NAME}: Setting PythonQt_QT_VERSION to 5 because Qt5_DIR is defined.")
Expand All @@ -35,7 +44,7 @@ else()
endif()

# Requirements
set(minimum_required_qt5_version "5.3.0")
set(minimum_required_qt5_version "5.2.0")
set(minimum_required_qt4_version "4.6.2")
set(minimum_required_qt_version ${minimum_required_qt${PythonQt_QT_VERSION}_version})

Expand All @@ -47,11 +56,19 @@ set(qtlibs ${qt${PythonQt_QT_VERSION}libs})
# Webkit need to be removed Qt >= 5.6
if(PythonQt_QT_VERSION MATCHES 5)
find_package(Qt5 ${minimum_required_qt5_version} COMPONENTS Core REQUIRED)
if(${Qt5Core_VERSION_MINOR} GREATER 5)
if(${Qt5Core_VERSION_MINOR} GREATER 5 OR ${Qt5Core_VERSION_MINOR} EQUAL 2)
list(REMOVE_ITEM qtlibs WebKitWidgets)
list(REMOVE_ITEM qt4libs webkit)
endif()

if(${Qt5Core_VERSION_MINOR} EQUAL 2)
list(APPEND qtlibs PrintSupport)
list(APPEND qt4libs printsupport)
endif()

endif()


#-----------------------------------------------------------------------------
# Python libraries

Expand Down Expand Up @@ -92,6 +109,8 @@ set(qt5_wrapped_lib_depends_gui Multimedia)

set(qtlib_to_wraplib_Widgets gui)
set(qtlib_to_wraplib_WebKitWidgets webkit)
set(qtlib_to_wraplib_PrintSupport printsupport)


# Define PythonQt_Wrap_Qt* options
option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
Expand Down Expand Up @@ -213,12 +232,17 @@ endif()
set(generated_cpp_suffix_46 _47)
set(generated_cpp_suffix_52 _50)
set(generated_cpp_suffix_51 _50)
set(generated_cpp_suffix_54 _54)
set(generated_cpp_suffix_55 _54)
set(generated_cpp_suffix_56 _54)
set(generated_cpp_suffix_57 _54)
set(generated_cpp_suffix_58 _58)

set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
if(DEFINED generated_cpp_suffix_${QT_VERSION_MAJOR}${QT_VERSION_MINOR})
set(generated_cpp_suffix "${generated_cpp_suffix_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}}")
elseif(${QT_VERSION_MAJOR}.${QT_VERSION_MINOR} VERSION_GREATER "5.4")
set(generated_cpp_suffix "_54")
elseif(${QT_VERSION_MAJOR}.${QT_VERSION_MINOR} VERSION_GREATER "5.8")
set(generated_cpp_suffix "_58")
endif()

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -320,7 +344,10 @@ foreach(qtlib ${qt_wrapped_libs})

endforeach()

list(APPEND sources ${file_prefix}_init.cpp)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}_init.cpp)
list(APPEND sources ${file_prefix}_init.cpp)
message( ${file_prefix}_init.cpp)
endif()

endif()
endforeach()
Expand Down Expand Up @@ -363,6 +390,7 @@ install(TARGETS PythonQt
LIBRARY DESTINATION ${PythonQt_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${PythonQt_INSTALL_ARCHIVE_DIR})
install(FILES ${headers} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR})
install(FILES src/gui/PythonQtScriptingConsole.h DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}/gui)

#-----------------------------------------------------------------------------
# Testing
Expand Down
16 changes: 8 additions & 8 deletions build/python.prf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# profile to include and link Python

# Change this variable to your python version (2.6, 2.7, 3.3, ...)
win32:PYTHON_VERSION=26
unix:PYTHON_VERSION=2.6
# profile to include and link Python
# Change this variable to your python version (2.6, 2.7, 3.3, ...)
win32:PYTHON_VERSION=2.7
unix:PYTHON_VERSION=2.7

macx {
# for macx you need to have the Python development kit installed as framework
Expand Down Expand Up @@ -30,12 +30,12 @@ macx {
DEBUG_EXT =
}

win32:INCLUDEPATH += $$(PYTHON_PATH)/PC $$(PYTHON_PATH)/include
win32:LIBS += $$(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
win32:INCLUDEPATH += $$(PYTHON_PATH) $$(PYTHON_PATH)/include/python2.7
win32:LIBS += -L$$(PYTHON_PATH)/lib -lpython2.7
} else:unix {
# on linux, python-config is used to autodetect Python.
# make sure that you have installed a matching python-dev package.

unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
}
58 changes: 58 additions & 0 deletions generated_cpp_58/PythonQt_QtBindings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#include "PythonQt_QtBindings.h"

#include "PythonQt.h"

void PythonQt_init_QtGui(PyObject*);
void PythonQt_init_QtSvg(PyObject*);
void PythonQt_init_QtSql(PyObject*);
void PythonQt_init_QtNetwork(PyObject*);
void PythonQt_init_QtCore(PyObject*);
void PythonQt_init_QtWebKit(PyObject*);
void PythonQt_init_QtOpenGL(PyObject*);
void PythonQt_init_QtXml(PyObject*);
void PythonQt_init_QtXmlPatterns(PyObject*);
void PythonQt_init_QtUiTools(PyObject*);

PYTHONQT_EXPORT void PythonQt_init_QtBindings()
{
#ifdef PYTHONQT_WRAP_Qtcore
PythonQt_init_QtCore(0);
#endif

#ifdef PYTHONQT_WRAP_Qtgui
PythonQt_init_QtGui(0);
#endif

#ifdef PYTHONQT_WRAP_Qtnetwork
PythonQt_init_QtNetwork(0);
#endif

#ifdef PYTHONQT_WRAP_Qtopengl
PythonQt_init_QtOpenGL(0);
#endif

#ifdef PYTHONQT_WRAP_Qtsql
PythonQt_init_QtSql(0);
#endif

#ifdef PYTHONQT_WRAP_Qtsvg
PythonQt_init_QtSvg(0);
#endif

#ifdef PYTHONQT_WRAP_Qtuitools
PythonQt_init_QtUiTools(0);
#endif

#ifdef PYTHONQT_WRAP_Qtwebkit
PythonQt_init_QtWebKit(0);
#endif

#ifdef PYTHONQT_WRAP_Qtxml
PythonQt_init_QtXml(0);
#endif

#ifdef PYTHONQT_WRAP_Qtxmlpatterns
PythonQt_init_QtXmlPatterns(0);
#endif
};
10 changes: 10 additions & 0 deletions generated_cpp_58/PythonQt_QtBindings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef _PYTHONQT_QTBINDINGS_H
#define _PYTHONQT_QTBINDINGS_H

#include "PythonQtSystem.h"

/// Initialize Qt bindings enabled at configuration time
PYTHONQT_EXPORT void PythonQt_init_QtBindings();

#endif

12 changes: 12 additions & 0 deletions generated_cpp_58/com_trolltech_qt_core/com_trolltech_qt_core.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HEADERS += \
$$PWD/com_trolltech_qt_core0.h \
$$PWD/com_trolltech_qt_core1.h \
$$PWD/com_trolltech_qt_core2.h \
$$PWD/com_trolltech_qt_core3.h \

SOURCES += \
$$PWD/com_trolltech_qt_core0.cpp \
$$PWD/com_trolltech_qt_core1.cpp \
$$PWD/com_trolltech_qt_core2.cpp \
$$PWD/com_trolltech_qt_core3.cpp \
$$PWD/com_trolltech_qt_core_init.cpp
Loading