Skip to content
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

Fix minor typo. #56

Open
wants to merge 567 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
567 commits
Select commit Hold shift + click to select a range
15b9f58
Only use qRegisterMetaType for Value types.
May 6, 2011
af55e97
Small fix to number protocol code generation.
May 3, 2011
a043e84
Improved the SbkDbg to avoid throwing exceptions when showing an object.
May 10, 2011
6030cdc
Don't set the tp_init when there are no public constructors available.
hugopl May 10, 2011
e0c2442
Replaced "isUserType" test for the correct "hasCppWrapper" before met…
May 11, 2011
9aa6887
Don't segfault when running with Qt4.5.
hugopl May 12, 2011
5236112
Improved garbage collector handling of Shiboken types.
May 3, 2011
35cf10c
Added tests for conversion operator that returns a constant reference…
Apr 8, 2011
b1d8ab3
Merge branch 'casttoreference' into havegcflag-hell
May 13, 2011
233cb64
Unit test for bug 851 - "Shiboken recognizes dereference operator ove…
hugopl May 16, 2011
b07004d
Just use else if's instead of a sequence of if's.
hugopl May 16, 2011
cc42eed
Implemented keep-reference action 'add'.
May 13, 2011
3112f6a
Fixed keep reference funcion.
May 13, 2011
ae2296c
Added a new test binding called 'minimal'.
May 16, 2011
f68e878
Added an unit test that puts an attribute on a Shiboken generated class.
May 17, 2011
b56f78f
Defined Shiboken.ObjectType tp_setattro to PyObject_GenericSetAttr.
May 17, 2011
8c1ef18
Use right argument variable name on keep reference when inside constr…
hugopl May 17, 2011
937dc0d
Whitespace removal
hugopl May 17, 2011
0764d6b
Removed unused variables/functions.
hugopl May 17, 2011
728fb48
Generate code using the new pyside class DestroyListener.
May 23, 2011
e4b141c
Updated generatorrunner dependency version.
May 25, 2011
2ddeb1b
Fix error arg types in error messages.
hugopl May 30, 2011
596d924
Created the function 'removeReference', used to remove a specific
May 31, 2011
6711904
Updated generator to use removeReference function.
May 31, 2011
26e9c71
optimized keepreference function.
Jun 1, 2011
924868f
Added Shiboken buffer interface.
hugopl May 25, 2011
9869164
Created Shiboken::warning function.
Jun 2, 2011
45692a4
Make use of Shiboken::warning on virtual function.
Jun 2, 2011
cf08f16
Updated necessary unit tests to handle with exceptions.
Jun 2, 2011
92b36ce
Fix bug 862 - "Problems when printing objects"
hugopl Jun 2, 2011
0d0beee
Fix bug 827 - "Anchor sign for headers to copy links for sections"
hugopl Jun 2, 2011
ce418b3
Test for bug 291 - "Generator ignores inject code for rich comparison…
hugopl Jun 2, 2011
fa1c63f
Expanded the minimal example and tests to better deal with virtual me…
May 28, 2011
53bbb95
Added class to be treated as a specific (bool, in this case) primitiv…
May 28, 2011
d11359b
Added the basic cases for container conversions.
May 28, 2011
cfdd773
Test for bug 464 - "Can't create target lang package and namespace wi…
hugopl Jun 2, 2011
3b95cbd
Removed warning about possible use of uninitialized variable.
hugopl Jun 6, 2011
122f188
Fix bug 501 - "Shiboken generator doesn't use full qualified name (wi…
hugopl Jun 3, 2011
4da5644
Update javascript files used in sphinx generated documentation.
hugopl Jun 6, 2011
53c642c
Show perm links only when the mouse hover on title.
hugopl Jun 6, 2011
1785414
Fix overload decisor on rich-compare function.
Jun 6, 2011
58b1484
Created unit test for add function rich-compare function.
Jun 6, 2011
689fcda
Fixed injected code processing to avoid infinite recursion in virtual…
May 31, 2011
527efde
Fixed substitution of method calls from user custom code for Qt's met…
Jun 9, 2011
eb0606c
Added two new type system variables: %ISCONVERTIBLE and %CHECKTYPE.
Jun 15, 2011
418a9ee
Fixed python debug likage.
Jun 16, 2011
2ca9a8b
Implemented support to qt_metacast function on qobjects.
Jun 20, 2011
7acb84f
Version bumped to 1.0.4.
Jun 22, 2011
48f7173
Version bump to 1.0.5.
hugopl Jun 22, 2011
3ae2d6f
Recognize more types on error messages pretty printing them.
hugopl Jun 21, 2011
3cc77de
Removed random unreadable comment.
hugopl Jun 21, 2011
6756102
Dealloc Python object before calling the C++ destructor.
hugopl Jun 22, 2011
fd78564
Fix object wrapper deletion.
Jun 28, 2011
cc52b6b
Fix refleak during the parent c++ object destruction.
Jun 17, 2011
b55e12a
Cleared cptr data during the cpp object destruction.
Jul 1, 2011
81d9cac
Now the generated code stores the enum cpp name on the PyThon type.
Jul 5, 2011
f9ec504
Created unit test for bug #886.
Jul 5, 2011
1873e12
Move meta object creation afeter type register.
Jul 6, 2011
3fc2ae3
Make sure register QMetaObject before QObject.
Jul 6, 2011
fa5bda9
Fix enum qMetaType register.
Jul 11, 2011
476b3e9
Fix samplebinding warnings suppresions.
hugopl Jul 11, 2011
2e6ca9c
Write type indexes in an ABI safe way.
hugopl Jul 11, 2011
77f72e3
Fix bug 929 - "pkg-config files do not know about Python version tags"
hugopl Jul 14, 2011
eb05f98
Propagate default args modification during the overload data descisor.
Jul 14, 2011
74ef914
Replaced trailing space by a period in documentation comment.
Jul 16, 2011
87ea32d
Improved minimal binding test passing a None value where an object ty…
Jul 18, 2011
52344c1
Improved code readability in CppGenerator::writeVirtualMethodNative.
Jul 18, 2011
79e7e20
Improved documentation on ObjectType's cast related functions.
Jul 18, 2011
fabb686
Fixed typo in generated code.
Jul 18, 2011
14411da
Added convenience functions to improve code readability.
Jul 18, 2011
2c2f420
More convenience functions added. More refactoring. Code more readable.
Jul 18, 2011
47f2a1f
Check if need to use placement new for types that inherits QObject du…
hugopl Jul 20, 2011
a4e259e
Added a build option to compile and run only the minimal set of tests.
Jul 20, 2011
02d16c7
Fix bug 939 - "Shiboken::importModule must verify if PyImport_ImportM…
hugopl Jul 21, 2011
d8a09e2
Used SignalManager function to retrieve MetaObject
Jul 19, 2011
d3dfd18
Updated apiextractor version dependecy.
Jul 22, 2011
a83d609
Check for PYTHONVERBOSE enviroment var to print debug message on binding
Jul 27, 2011
d8173ec
Fix bug 941 - "Signals with QtCore.Qt types as arguments has invalid …
hugopl Jul 27, 2011
15754a7
std::auto_ptr is safer than relying in an if clause at the end of the…
Jul 21, 2011
dcf9382
Moved some type system variable replacement to their own methods.
Jul 27, 2011
bd2b580
Moved an enum tag on 'sample' test binding to a better position.
Jul 24, 2011
51fa9bb
Fixes ShibokenGenerator::isCString(type).
Jul 24, 2011
293cd5f
Moved the methods isObjectType() and isPointer() from ShibokenGenerat…
Jul 21, 2011
16eb935
Moved writeMinimalConstructorCallArguments() functionality to Generat…
Jul 21, 2011
20161b1
Added test for a typedef to a primitive numerical type.
Jul 25, 2011
07587cf
Introduces new API to create and import Python modules.
Jul 16, 2011
e28a839
Added a function to initialize a new wrapper type and add it to a mod…
Jul 16, 2011
8c7253e
Removed unused parameter from writeInvalidCppObjectCheck().
Jul 28, 2011
2143093
Removed signatures without definition from CppGenerator header.
Jul 28, 2011
5e356a6
Improved CppGenerator::writeCppSelfDefinition() method and its use.
Jul 28, 2011
e901eca
Improved readability of CppGenerator::writeCopyFunction() method.
Jul 28, 2011
9b1d852
Improved writeInvalidPyObjectCheck() method and updated generator to …
Jul 28, 2011
590b96a
More readable code on CppGenerator::writeVirtualMethodNative() method.
Jul 28, 2011
e87c3af
All Python to C++ conversions were moved to CppGenerator::writePython…
Jul 28, 2011
a88e536
Fixed writeBaseConversion method to handle references to C++ primitives.
Jul 28, 2011
644a32c
Created a method to generate method wrapper variable initialization c…
Jul 28, 2011
8745f32
Centralized the generation of global and class enums in one method.
Jul 28, 2011
3804e1f
Renamed argument of ShibokenGenerator's getTypeIndexVariableName() me…
Jul 28, 2011
ce79861
AbstractMetaType builder now calls the metatype's own 'decideUsagePat…
Jul 29, 2011
975abf9
Improved the code of two code generation functions for better readabi…
Jul 29, 2011
114a4b5
Added a method to retrieve a function's argument type
Jul 29, 2011
27b352e
Improved coding style in the terrible writeStdListWrapperMethods method.
Jul 29, 2011
d9c6bb6
Modified the generation of 'nb_bool' functions to use standard functi…
Jul 29, 2011
9373358
Sanitized CppGenerator's writeToPythonFunction() method.
Jul 29, 2011
c2425e5
Moved the generation of Python result error checking to a single func…
Jul 29, 2011
e90bb35
Added the ErrorCode helper class to handle the current error code value.
Jul 29, 2011
0a4a478
Added functions to provide a cleaner enum and flags initialization.
Jul 22, 2011
0911ae4
The rich comparison function writer now makes use of the C++ self var…
Jul 29, 2011
9918209
I rewrote generator functions of type checking strings in ShibokenGen…
Jul 29, 2011
2a2a256
Revamped the virtual method writer.
Aug 1, 2011
ea5bfb5
Moved many variables names used in generated code to macros.
Aug 1, 2011
7954431
Improved and fixed the setter and getter writer functions.
Aug 1, 2011
2651e5e
Removed unnecessary indentation from generated overload selector switch.
Aug 2, 2011
cd6d609
Added test for removed pointer out argument.
Aug 2, 2011
511ce49
Added compilation test for value type argument in a lshift operator.
Aug 2, 2011
58e41b5
Disassembled ShibokenGenerator's writeCodeSnips method.
Aug 2, 2011
94b2ba3
Small visual improvements on writeArgumentNames().
Aug 3, 2011
86b4d9c
Fixed type system variable replacement for arguments removed with con…
Aug 3, 2011
079e0ce
Removed huge if block to ease the code readbility.
hugopl Aug 3, 2011
b0462e4
Check if the directory exists before writing C++ module definition file.
hugopl Aug 3, 2011
844d8ca
Don't abort header generator if no classes were found.
hugopl Aug 3, 2011
b54328b
Added tests for custom conversion and buffer protocol.
Aug 4, 2011
f4d596e
Included tests for added function signatures very similar to already …
Aug 4, 2011
7ce80ca
Improved guessCPythonCheckFunction method to produce an AbstractMetaT…
Aug 5, 2011
00c669a
Added a test dealing with a reference to an Object Type passed to Pyt…
Aug 6, 2011
2c9dc4e
The result of rich comparisons are stored in a return variable before…
Aug 6, 2011
7e9b858
Test's names now have their module as prefix.
Aug 6, 2011
426e2f5
Added an unit test to check if derived type destructors are freeing m…
Aug 6, 2011
6b65862
The type checking now pays attention to the <no-null-pointer/> tag.
Aug 6, 2011
c5fe0bf
Added tests for classes that are typedefs that implement a template c…
Aug 7, 2011
50c7ab7
Improved the generation of type indexes written to the generated modu…
Aug 7, 2011
ff44534
Added tests for a class that its only constructor is the copy one.
Aug 6, 2011
86b2588
Method buildAbstractMetaTypeFromString now uses a cache for the types…
Aug 8, 2011
ef0c747
Moved functionality from a couple of write function to ones that retu…
Aug 9, 2011
899cd90
The type system converter variable replacement was moved to a single …
Aug 9, 2011
ea7a4dc
Drop superflous .directory file.
OdyX Aug 8, 2011
9e40c0f
Update pysidedocs theme to rely more on sphinx's base theme:
OdyX Aug 8, 2011
bac56d4
Removed last js files.
hugopl Aug 10, 2011
4ce6ce5
CppGenerator's writeHashFunction now uses writeCppSelfDefinition.
Aug 9, 2011
b88c637
Improved type system converter variable usage in the sample test bind…
Aug 9, 2011
ddb207f
Improved the generation of argument conversion in modified functions.
Aug 10, 2011
2cc1d4b
Functions marked as deprecated will raises a python warning.
Aug 10, 2011
7127501
Implemented unit test for deprecated functions.
Aug 10, 2011
5b6b8df
Check for python debug enviroment to print debug messages on
Aug 11, 2011
f6514c3
Mark deprecated functions as deprecated.
hugopl Aug 10, 2011
11f3321
Check for NULL pointer on transferOwnership function.
Aug 12, 2011
68b8452
CppGenerator's method writeReprFunction now uses writeCppSelfDefinition.
Aug 10, 2011
b094c65
CppGenerator's writeCopyFunction method now uses cpythonToPythonConve…
Aug 11, 2011
7356be2
Added a method modification test dealing with code injection and user…
Aug 13, 2011
88a682e
Added test for implicit conversion with user's primitive type.
Aug 13, 2011
78d9aee
Added test for user defined primitive type used as public class field.
Aug 15, 2011
3e3aa8f
Added test for typedef of unsigned short.
Aug 15, 2011
df96bc2
Added a test for an user defined primitive type from a required module.
Aug 16, 2011
b84f601
Added a test case for a bit-field structure member.
Aug 18, 2011
59d6aae
Fixed generator to consider conversion rules for the return type of w…
Aug 18, 2011
9538c40
Creates type registers for enums in createScopedEnum and createGlobal…
Aug 19, 2011
9a50f10
Centralized the place where the TypeResolver creation is written.
Aug 19, 2011
f99cda5
Not print warning if the typedef used on signal is QFlags.
Aug 22, 2011
c40d5e3
Version Bump.
Aug 22, 2011
f225c0c
Implmented support to q_metacall function modification.
Aug 26, 2011
bc8448d
Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken functionali…
hugopl Aug 4, 2011
52d637f
Documentation for shiboken module.
hugopl Aug 5, 2011
2abcac2
Fiexed default __repr__ function generation.
Aug 30, 2011
ba42e6d
Fixed cyclic dependency resolution.
Aug 30, 2011
51007e4
Created unit test for cyclic dependency.
Aug 30, 2011
d7e69fd
Safer type index define line generation.
Aug 30, 2011
158b857
Use internal dynamic metaobject insted of created by pyside.
Sep 8, 2011
b7bb6b2
Fix bug 995 - "QDeclarativeView.itemAt returns faulty reference. (lea…
hugopl Sep 13, 2011
547e2b7
Revert "Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken fun…
hugopl Sep 16, 2011
4856d7e
Fixed invalidate function in objects with refereces to other objects.
Sep 20, 2011
d0ff673
Version bumped.
Sep 21, 2011
ac577dd
Replaced all PyString_* by PyBytes_* as preparation for a Python 3.x …
hugopl Sep 14, 2011
f098a6a
Added sbkpython.h to deal with conflicts and missing symbols between…
hugopl Sep 14, 2011
f4bbc39
Using Py_TYPE macro instead of direct access to ob_type to work with …
hugopl Sep 15, 2011
dede04c
Use PyVarObject_HEAD_INIT instead of PyObject_HEAD_INIT.
hugopl Sep 15, 2011
52759b7
Use PyModuleCreate to create modules under Python3.
hugopl Sep 15, 2011
863b2fc
Port Shiboken buffer interface to Python3.
hugopl Sep 15, 2011
d9e4a36
Port libsample typesystem and glue codes to Python 3.
hugopl Sep 16, 2011
acb7b31
Use ErrorCode class when writing enums.
hugopl Sep 16, 2011
3b1f89d
Use PyBytes instead of PyString on generated code.
hugopl Sep 16, 2011
98a6eaf
Port module initialization to Python3.
hugopl Sep 16, 2011
9affd6c
Fix SbkDbg() << PyObject on Python 3.x
hugopl Sep 20, 2011
69c0d0f
Fix converter of std::map.
hugopl Sep 21, 2011
6f1389a
Correctly prints the return type of virtual functions instead of a C+…
hugopl Sep 21, 2011
481e479
Added SBK_PyString_FromCString and SBK_PyString_FromFormat as helper …
hugopl Sep 20, 2011
37c37e5
Fix getattro function on Python3.
hugopl Sep 21, 2011
d916549
Added py3kcompat.py to test suite to make tests pass on Python3.x and…
hugopl Sep 20, 2011
cca32ba
Create SHIBOKEN MODULE INIT macro.
Sep 23, 2011
3660b32
Updated CMake to find for python3.
Sep 14, 2011
07542d5
Fixed duck punch unti test to work with Python3.
hugopl Sep 23, 2011
c2fd169
Fix CMake FinPython3 script.
Sep 28, 2011
52b690c
Created Shiboken::String API to support py3k.
Sep 28, 2011
0263907
Update string usage to new Shiboken::String API.
Sep 28, 2011
a576d27
Updated enum_test for support py3k.
Sep 28, 2011
83fd02a
Implemented support to py3k on Shiboken::Enum.
Sep 28, 2011
e352ed2
Updated Shiboken::Buffer API to Py3k.
Sep 28, 2011
d2acdea
Create Module macro compatible with python 2.x and 3.x.
Sep 28, 2011
de0c621
created py3k file to make tests compatible with python3.x and python2.x
Sep 28, 2011
112c289
Fixed regressions caused on python2.x.
Sep 28, 2011
b1c58ba
Fixed tests to work with python3.x and python2.x
Sep 28, 2011
b9e359d
Update enum implemantation.
Oct 4, 2011
a31b700
Replaced use of PyBytes_AS_STRING to Shiboken::String functions.
Oct 4, 2011
5075faa
Updated Shiboken::String functions.
Oct 4, 2011
f5f97fa
Fixed Shiboken::Buffer implementation for python 3.
Oct 4, 2011
7fc77e4
Updated Shiboken python version compat header.
Oct 4, 2011
24ae33e
Updated char conversion for works with python3 unicodes.
Oct 4, 2011
b4a7b16
Updated shiboken generator to works with python3 code.
Oct 4, 2011
380e2a6
fix string class.
Oct 5, 2011
a295d27
fix shiboken enum.
Oct 5, 2011
51603a2
Fix python 2.x generation.
Oct 5, 2011
61830f0
Fixed compat header.
Oct 5, 2011
d24dc4c
Updated str test to work with both python 2.x and 3.x
Oct 5, 2011
7a15e5c
Fixed shiboken buffer to work with python 3.x
Oct 5, 2011
20461c9
Fixed object destruction.
Oct 5, 2011
6b8ff87
Fixed char conversion to work with both python 3.x and 2.x
Oct 5, 2011
2564403
Fix string.
Oct 6, 2011
0cde603
Removed invalid test.
Oct 6, 2011
b2af41a
Fix detection of Python2 on system where "python" means "python2".
hugopl Oct 6, 2011
1fbc44d
Avoid string variable to be used unitialized.
hugopl Oct 6, 2011
9861730
Add macros to kept python 2.5 compatibility.
hugopl Oct 6, 2011
342059a
Use sbkpython instead of Python.h.
hugopl Oct 6, 2011
56849f3
Small changes to sbkstring.cpp.
hugopl Oct 6, 2011
3428c83
Added new line to end of shibokenbuffer.h.
hugopl Oct 6, 2011
0a84cb5
String::convertible renamed to String::isConvertible.
hugopl Oct 6, 2011
d034778
Removes printfs and fixes str test.
Oct 10, 2011
74cdaf8
Fix PySide compilation with Python 2.5.
hugopl Oct 10, 2011
60807a3
Made SbkChar_Check macro safer with parenthesis.
Oct 11, 2011
4ec9ca5
Fixed regression that made enums not hashable.
hugopl Oct 14, 2011
5ee637f
Fixed code style on sbkenum.cpp
hugopl Oct 14, 2011
db044d2
Fixes writeReturnValueHeuristics to not mess with constructors.
Oct 17, 2011
ce79f75
Add constructor overload AutoDecRef(SbkObject*).
hugopl Oct 17, 2011
6a174ec
Don't delete parentInfo when it seens to be useless to avoid crash on…
hugopl Oct 17, 2011
64850d9
Version bump to 1.0.8.
hugopl Oct 20, 2011
70e8fa5
Fix ABI break and link error on MS Windows.
hugopl Oct 20, 2011
e6f2a2f
Fix regression with enums.
lauromoura Oct 20, 2011
980b4a9
Bump version to 1.0.9.
hugopl Oct 20, 2011
a91c6cb
Version bump to 1.0.10.
hugopl Oct 27, 2011
a2d89af
Fix bug 1010 - "Shiboken Cygwin patch."
yselkowitz Oct 27, 2011
3a774ef
Fix bug 1013 - "connect to QSqlTableModel.primeInsert() causes crash"
hugopl Oct 28, 2011
82ea7fe
Fix bug 1033 - "QDialog.DialogCode instances and return value from QD…
hugopl Oct 28, 2011
e12e73d
Create qflags at runtime.
hugopl Oct 28, 2011
49d4a9d
Fix bug 1037 - "shiboken fails to build against python 3.2 (both norm…
hugopl Oct 31, 2011
76eeb63
basewrapper: cleanups
Nov 15, 2011
9f110f8
Fix BUG #1057
Nov 23, 2011
43b58d6
generator: function must return a value
Dec 1, 2011
7590044
Fix bug 1010 - "Shiboken Cygwin patch"
hugopl Dec 2, 2011
00c3a19
Remove missuse of m_traverse function.
hugopl Dec 6, 2011
ca34e36
Implemented PSEP 0106.
hugopl Dec 9, 2011
c3a53de
Fix Windows build of shiboken module.
hugopl Dec 9, 2011
5ced35d
Fix minor typo.
techtonik Dec 14, 2011
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ build
.preprocessed.tmp
.*.swp
*.kdev4
doc/_build
127 changes: 56 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
include(icecc.cmake)
Include(icecc.cmake)
project(shiboken)

cmake_minimum_required(VERSION 2.6)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})

find_package(Qt4 4.5.0 REQUIRED)
find_package(ApiExtractor 0.8 REQUIRED)
find_package(GeneratorRunner 0.6.1 REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
find_package(Qt4 4.5.0)
find_package(ApiExtractor 0.10.9 REQUIRED)
find_package(GeneratorRunner 0.6.15 REQUIRED)

add_definitions(${QT_DEFINITIONS})

option(AVOID_PROTECTED_HACK "Avoid protected hack on generated bindings." FALSE)
set(shiboken_MAJOR_VERSION "1")
set(shiboken_MINOR_VERSION "0")
set(shiboken_MICRO_VERSION "10")
set(shiboken_VERSION "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}.${shiboken_MICRO_VERSION}")

option(BUILD_TESTS "Build tests." TRUE)
option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
option(USE_PYTHON3 "Use python3 libraries to build shiboken." FALSE)

if (USE_PYTHON3)
find_package(Python3Libs)
find_package(Python3InterpWithDebug)
#use commom vars
set(PYTHONLIBS_FOUND ${PYTHON3LIBS_FOUND})
set(PYTHON_LIBRARIES ${PYTHON3_LIBRARIES})
set(PYTHON_INCLUDE_DIRS ${PYTHON3_INCLUDE_DIRS})
set(PYTHON_DEBUG_LIBRARIES ${PYTHON3_DEBUG_LIBRARIES})
set(PYTHONINTERP_FOUND ${PYTHON3INTERP_FOUND})
set(PYTHON_EXECUTABLE ${PYTHON3_EXECUTABLE})
else()
find_package(PythonLibs 2.6)
find_package(PythonInterpWithDebug)
endif()


if(MSVC)
set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS")
else()
if(CMAKE_HOST_UNIX)
if(CMAKE_HOST_UNIX AND NOT CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
Expand All @@ -35,98 +53,69 @@ else()
endif()
endif()

if (WIN32)
set(PATH_SEP "\;")
else()
set(PATH_SEP ":")
endif()

if(WIN32 OR AVOID_PROTECTED_HACK)
message(STATUS "Avoiding protected hack!")
add_definitions("-DAVOID_PROTECTED_HACK")
else()
message(STATUS "Using protected hack!")
endif()

set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)

set(shiboken_MAJOR_VERSION "0")
set(shiboken_MINOR_VERSION "5")
set(shiboken_MICRO_VERSION "0")
set(shiboken_VERSION "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}.${shiboken_MICRO_VERSION}")
if(ENABLE_VERSION_SUFFIX)
set(shiboken_SUFFIX "-${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}")
if (WIN32)
set(PATH_SEP "\;")
else()
set(shiboken_SUFFIX "")
set(PATH_SEP ":")
endif()

set(shiboken_SRC
cppgenerator.cpp
headergenerator.cpp
overloaddata.cpp
shiboken.cpp
shibokengenerator.cpp
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${APIEXTRACTOR_INCLUDE_DIR}
${GENERATORRUNNER_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR})

add_library(shiboken_generator SHARED ${shiboken_SRC})
set_property(TARGET shiboken_generator PROPERTY PREFIX "")

target_link_libraries(shiboken_generator
${APIEXTRACTOR_LIBRARY}
${GENERATORRUNNER_LIBRARY}
${QT_QTCORE_LIBRARY})

add_executable(shiboken main.cpp)
set_target_properties(shiboken PROPERTIES OUTPUT_NAME shiboken${shiboken_SUFFIX})
target_link_libraries(shiboken ${QT_QTCORE_LIBRARY})

# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall "${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

# Detect if the python libs were compiled in debug mode
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
print sysconfig.get_config_var('Py_DEBUG')"
OUTPUT_VARIABLE PY_DEBUG
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(SHIBOKEN_BUILD_TYPE "Release")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(NOT PYTHON_DEBUG_LIBRARIES)
message(FATAL_ERROR "Python debug library not found. Try compile shiboken with -DCMAKE_BUILD_TYPE=Release")
endif()
if(NOT PY_DEBUG)
if(NOT PYTHON_WITH_DEBUG)
message(WARNING "Compiling shiboken with debug enabled, but the python executable was not compiled with debug support.")
else()
add_definitions("-DPy_DEBUG")
set(SBK_ADD_PY_DEBUG_DEFINITION "add_definitions(\"-DPy_DEBUG\")")
set(SBK_PKG_CONFIG_PY_DEBUG_DEFINITION " -DPy_DEBUG")
endif()
set(SBK_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
set(SHIBOKEN_BUILD_TYPE "Debug")
else()
set(SBK_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})
add_definitions("-DNDEBUG")
endif()
if(APPLE)
set(SBK_PYTHON_LIBRARIES "-undefined dynamic_lookup")
endif()

if (BUILD_TESTS)
enable_testing()
if(CMAKE_VERSION VERSION_LESS 2.8)
set(SBK_PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_PATH})
else()
set(SBK_PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIRS})
endif()

add_subdirectory(libshiboken)
add_subdirectory(doc)

if (BUILD_TESTS)
add_subdirectory(tests)
# deps found, compile the generator.
if (QT4_FOUND AND ApiExtractor_FOUND AND GeneratorRunner_FOUND AND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
add_subdirectory(generator)
add_subdirectory(shibokenmodule)

if (BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
else()
message(WARNING "Some dependencies were not found, shiboken generator compilation disabled!")
endif()

add_subdirectory(data)

# dist target
set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${shiboken_VERSION})
add_custom_target(dist
COMMAND mkdir -p "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}" &&
Expand All @@ -137,8 +126,4 @@ add_custom_target(dist
echo "Source package created at ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2.\n"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

add_dependencies(shiboken shiboken_generator)

install(TARGETS shiboken_generator DESTINATION "${GENERATORRUNNER_PLUGIN_DIR}")
install(TARGETS shiboken DESTINATION bin)

Loading