<commit_before>project(pysidetest)
project(testbinding)

cmake_minimum_required(VERSION 2.6)
find_package(PythonLibs REQUIRED)

set(QT_USE_QTCORE 1)
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_SHARED)
add_definitions(-DRXX_ALLOCATOR_INIT_0)

set(pysidetest_SRC
testobject.cpp
testview.cpp
)

set(pysidetest_MOC_HEADERS
testobject.h
testview.h
)

qt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})

set(testbinding_SRC
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp
)

set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
add_custom_command(OUTPUT ${testbinding_SRC}
COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
        ${CMAKE_CURRENT_SOURCE_DIR}/global.h
        --include-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}
        --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}
        --output-directory=${CMAKE_CURRENT_BINARY_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pysidetest.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for test binding..."
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                    ${CMAKE_CURRENT_BINARY_DIR}
                    ${QT_INCLUDE_DIR}
                    ${QT_QTCORE_INCLUDE_DIR}
                    ${SHIBOKEN_INCLUDE_DIR}
                    ${QtCore_BINARY_DIR}/PySide/QtCore
                    ${libpyside_SOURCE_DIR}
                    ${PYTHON_INCLUDE_PATH})

add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC})
target_link_libraries(pysidetest ${QT_QTCORE_LIBRARY})

add_library(testbinding MODULE ${testbinding_SRC})
set_property(TARGET testbinding PROPERTY PREFIX "")
target_link_libraries(testbinding
                      pysidetest
                      pyside
                      ${PYTHON_LIBRARIES}
                      ${SHIBOKEN_LIBRARY}
                      ${QT_QTCORE_LIBRARY}
                      ${SBK_PYTHON_LIBRARIES})

add_dependencies(testbinding pyside QtCore libpyside pysidetest)


PYSIDE_TEST(homonymoussignalandmethod_test.py)
PYSIDE_TEST(modelview_test.py)
PYSIDE_TEST(version_test.py)
<commit_msg>Use .pyd extension for pysidetest module on Windows.<commit_after>project(pysidetest)
project(testbinding)

cmake_minimum_required(VERSION 2.6)
find_package(PythonLibs REQUIRED)

set(QT_USE_QTCORE 1)
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_SHARED)
add_definitions(-DRXX_ALLOCATOR_INIT_0)

set(pysidetest_SRC
testobject.cpp
testview.cpp
)

set(pysidetest_MOC_HEADERS
testobject.h
testview.h
)

qt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})

set(testbinding_SRC
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp
)

set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
add_custom_command(OUTPUT ${testbinding_SRC}
COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
        ${CMAKE_CURRENT_SOURCE_DIR}/global.h
        --include-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}
        --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}
        --output-directory=${CMAKE_CURRENT_BINARY_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pysidetest.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for test binding..."
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                    ${CMAKE_CURRENT_BINARY_DIR}
                    ${QT_INCLUDE_DIR}
                    ${QT_QTCORE_INCLUDE_DIR}
                    ${SHIBOKEN_INCLUDE_DIR}
                    ${QtCore_BINARY_DIR}/PySide/QtCore
                    ${libpyside_SOURCE_DIR}
                    ${PYTHON_INCLUDE_PATH})

add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC})
target_link_libraries(pysidetest ${QT_QTCORE_LIBRARY})

add_library(testbinding MODULE ${testbinding_SRC})
set_property(TARGET testbinding PROPERTY PREFIX "")
if(WIN32)
	set_target_properties(testbinding PROPERTIES SUFFIX ".pyd")
endif()
target_link_libraries(testbinding
                      pysidetest
                      pyside
                      ${PYTHON_LIBRARIES}
                      ${SHIBOKEN_LIBRARY}
                      ${QT_QTCORE_LIBRARY}
                      ${SBK_PYTHON_LIBRARIES})

add_dependencies(testbinding pyside QtCore libpyside pysidetest)


PYSIDE_TEST(homonymoussignalandmethod_test.py)
PYSIDE_TEST(modelview_test.py)
PYSIDE_TEST(version_test.py)

{'fraction_non_alphanumeric': 0.09426066161817458, 'fraction_numerical': 0.0023913909924272616, 'mean_word_length': 4.283157894736842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4017661', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1748, 'n_words': 179}