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

[#1139] Fixes crash at exit due to thread state (tstate) == NULL #63

Open
wants to merge 639 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
639 commits
Select commit Hold shift + click to select a range
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
443e74d
Added an enum test to libminimal.
Oct 4, 2011
a3f655e
Implemented new type converters, but only for wrapper types.
Aug 8, 2011
3783e1c
New converters for user added primitive types.
Aug 11, 2011
11eda54
New converters for C++ primitive types.
Aug 16, 2011
cda2c51
Converter can be registered and retrieved for string representations …
Aug 23, 2011
11a09fe
New conversions for containers.
Aug 25, 2011
6b7ed14
Added test for instantiated container type used as primitive-type.
Sep 2, 2011
07e0cf7
Added test for implicit conversion with primitive type.
Sep 13, 2011
7ab63c4
SbkConverter's copyToPython function now returns Python None for C++ …
Sep 15, 2011
cd5b034
Shiboken exits with error for not handled pointers to primitive types.
Sep 13, 2011
e6ffa14
Do not attribute a value for container variables, except when they ha…
Sep 22, 2011
2f4836f
Moved some methods from ShibokenGenerator to GeneratorRunner.
Sep 23, 2011
4da9bcb
Fixed generation when avoiding to use the protected hack.
Oct 11, 2011
d986958
Fixes win32 symbol exporting for instantiated template classes.
Oct 11, 2011
34fd7b9
Fixed Python 2.5 compatibility header for PyLong_FromSize_t and PyLon…
Oct 11, 2011
cd2cc94
Added a test for a typedef of a pointer to a struct.
Oct 13, 2011
9bc3d8b
Shiboken's enums now have converters.
Oct 11, 2011
1b32cda
Updates creation of QFlags types at runtime.
hugopl Oct 14, 2011
2c89e5f
Don't call PyTypeReady on QFlags types in createEnum function, this i…
hugopl Oct 14, 2011
7edc244
Stores C++ enum type names on enum types itself instead of yet anothe…
hugopl Oct 14, 2011
102c78d
Added unit test for bug 969.
hugopl Oct 11, 2011
0a4440b
Fixed code generation for functions returning object types as values.
Oct 14, 2011
a27ca79
Created convenience method to tell if an object type is used as value.
Oct 14, 2011
1588c12
Fixed code generation for functions arguments that use object types a…
Oct 14, 2011
c392df6
Added SBK_CONVERTER, a macro to get the type converter whatever the t…
hugopl Oct 17, 2011
e0adb1f
Modifies HANDLE test to fix win32 linking problem.
Oct 17, 2011
6d0df0c
Accept inject code as a way to deal with primitive type pointers.
hugopl Oct 18, 2011
0f162af
Updated custom code for ByteArray's read/write buffer protocol.
Oct 18, 2011
3a89431
Updates std::list methods writer to use the new converters.
Oct 18, 2011
333703f
New converters for C++ enum and qflags types.
Oct 18, 2011
3522a20
Fixes SBK_CONVERTER macro and SbkEnumType structure.
Oct 21, 2011
04546e2
Fix crash in PySequence converters.
hugopl Oct 21, 2011
b757d81
Make converter branch work on a Python3.2 setup.
hugopl Oct 20, 2011
dc09869
Added the API exporting macro to the protected test classes.
Oct 24, 2011
67d5293
Fixed generation for enum arguments with default values when avoiding…
Oct 24, 2011
ead1f6c
Register type converters by name.
Oct 28, 2011
a1936ce
Fixes code generation for typedefs of C++ primitive types.
Oct 28, 2011
fd34818
Container types now register their converters by name.
Oct 28, 2011
d427000
Added functions to the new converters API to check if a type is value…
Oct 31, 2011
da38f96
Added some setting and converting functions to the new converter's API.
Nov 1, 2011
fa1a61a
Register enum converters by name.
Nov 1, 2011
741142d
Added a "to Python" converter function that gets a SbkConverter object.
Nov 1, 2011
d25db29
Added adapter class SpecificConverter to provide type conversion base…
Nov 4, 2011
59b142c
Added a convenience method to check if a converter belongs to a wrapp…
Nov 15, 2011
2a696b3
Removed useless register type writer function for enums.
Nov 18, 2011
5ca5e94
Remove occurrences of Shiboken::makeTuple from test bindings.
Dec 1, 2011
a94bfb9
Removed type resolver related generator functions.
Dec 1, 2011
16a117c
Fixed dynamic building of AbstractMetaTypes.
Dec 6, 2011
8aa89b6
Fixed CMake configuration of sbkversion.h header.
Dec 10, 2011
604daf6
Fix conversion for HANDLE type.
hugopl Dec 12, 2011
b8aabc8
Removed the last pieces of code generation that uses the old template…
Dec 12, 2011
14a8ac8
Removed commented section of test file.
Dec 13, 2011
3d76e13
Fixed/refactored Shiboken::warning function.
Dec 13, 2011
2e5b7e1
Cast enums to int, not long.
hugopl Dec 13, 2011
fce2dc4
nb_long and nb_nonzero functions for QFlags now use C's int instead o…
Dec 16, 2011
16a6e23
Register the correct names for QFlags.
Dec 16, 2011
9f40693
Simplified the conversions of the arguments in a QFlags binary operat…
Dec 16, 2011
faf9f94
Fix BUG #1097 - "QtGui.QShortcut.setKey requires QKeySequence"
Dec 22, 2011
9e92dee
Added a compilation test for containers of object types used as values.
Dec 20, 2011
5d94d77
Improved error message for %CONVERT... macros replacement.
Dec 21, 2011
d40c7f6
Declares Python types using the new "<custom-type>" tag.
Dec 23, 2011
d382a25
Added a generation/compilation test for container types.
Dec 26, 2011
bed02f7
Updated documentation for type converters.
Dec 29, 2011
84603db
Version bump to 1.1.0.
Dec 30, 2011
ea7bc94
Version bump to 1.1.1.
Dec 30, 2011
22dffb3
Fix BUG #1092 - "shiboken names itself a 'generator'"
Jan 5, 2012
92221e8
Bump dependencies.
hugopl Jan 5, 2012
fa103c2
Added missing pictures in converter documentation.
Jan 2, 2012
7ae059f
Fix BUG #1105 - "Spyder fails with HEAD"
Jan 9, 2012
f79304b
Fix BUG #1113 - "Instantiating QObject in user-defined QML element's
Jan 18, 2012
de86825
On Fedora systems we usually have the binary of the Python interpreter
Jan 19, 2012
2c198ea
Remove ambiguous constructor from libsample's HandleHolder.
Jan 23, 2012
1b9513c
[#1139] Binding manager's static destructor is triggered after the Py…
Feb 9, 2012
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.11 REQUIRED)
find_package(GeneratorRunner 0.6.17 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 "1")
set(shiboken_MICRO_VERSION "1")
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