<commit_before>project(OgrePython)

find_package(SWIG)
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_PATH})
find_package(PythonInterp)

if(NOT PYTHONLIBS_FOUND OR NOT SWIG_FOUND)
    return()
endif()

include(${SWIG_USE_FILE})

set(PYTHON_SITE_PACKAGES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages/)

set(CMAKE_SWIG_FLAGS -w401,314 -builtin)

add_definitions(-Wno-cast-qual -Wno-shadow -Wno-maybe-uninitialized)
set_source_files_properties(../../OgreMain/include/Ogre.i PROPERTIES CPLUSPLUS ON)
swig_add_module(Ogre python ../../OgreMain/include/Ogre.i)
swig_link_libraries(Ogre OgreMain ${PYTHON_LIBRARIES})
set_target_properties(${SWIG_MODULE_Ogre_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
install(TARGETS ${SWIG_MODULE_Ogre_REAL_NAME} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES})
install(FILES ${CMAKE_BINARY_DIR}/Components/Python/Ogre.py DESTINATION ${PYTHON_SITE_PACKAGES})

if(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM)
    ogre_add_component_include_dir(RTShaderSystem)
    set_source_files_properties(../RTShaderSystem/include/OgreRTShader.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreRTShader python ../RTShaderSystem/include/OgreRTShader.i)
    swig_link_libraries(OgreRTShader OgreMain OgreRTShaderSystem ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreRTShader_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
    install(TARGETS ${SWIG_MODULE_OgreRTShader_REAL_NAME} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES})
    install(FILES ${CMAKE_BINARY_DIR}/Components/Python/OgreRTShader.py DESTINATION ${PYTHON_SITE_PACKAGES})
endif()

if(OGRE_BUILD_COMPONENT_OVERLAY)
    ogre_add_component_include_dir(Overlay)
    set_source_files_properties(../Overlay/include/OgreOverlay.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreOverlay python ../Overlay/include/OgreOverlay.i)
    swig_link_libraries(OgreOverlay OgreMain OgreOverlay ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreOverlay_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
endif()

if(OGRE_BUILD_COMPONENT_BITES)
    if(SDL2_FOUND)
        include_directories(${SDL2_INCLUDE_DIR})
        list(APPEND CMAKE_SWIG_FLAGS -DOGRE_BITES_HAVE_SDL=1)
    endif()

    if(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM)
        list(APPEND CMAKE_SWIG_FLAGS -DINCLUDE_RTSHADER_SYSTEM)
        add_definitions(-DINCLUDE_RTSHADER_SYSTEM)
    endif()
    
    ogre_add_component_include_dir(Bites)
    set_source_files_properties(../Bites/include/OgreBites.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreBites python ../Bites/include/OgreBites.i)
    swig_link_libraries(OgreBites OgreMain OgreBites ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreBites_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
endif()
<commit_msg>python: disable swig internal warnings<commit_after>project(OgrePython)

find_package(SWIG)
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_PATH})
find_package(PythonInterp)

if(NOT PYTHONLIBS_FOUND OR NOT SWIG_FOUND)
    return()
endif()

include(${SWIG_USE_FILE})

set(PYTHON_SITE_PACKAGES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages/)

set(CMAKE_SWIG_FLAGS -w401,314 -builtin)

add_definitions(-Wno-cast-qual -Wno-shadow -Wno-maybe-uninitialized -Wno-unused-label)
set_source_files_properties(../../OgreMain/include/Ogre.i PROPERTIES CPLUSPLUS ON)
swig_add_module(Ogre python ../../OgreMain/include/Ogre.i)
swig_link_libraries(Ogre OgreMain ${PYTHON_LIBRARIES})
set_target_properties(${SWIG_MODULE_Ogre_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
install(TARGETS ${SWIG_MODULE_Ogre_REAL_NAME} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES})
install(FILES ${CMAKE_BINARY_DIR}/Components/Python/Ogre.py DESTINATION ${PYTHON_SITE_PACKAGES})

if(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM)
    ogre_add_component_include_dir(RTShaderSystem)
    set_source_files_properties(../RTShaderSystem/include/OgreRTShader.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreRTShader python ../RTShaderSystem/include/OgreRTShader.i)
    swig_link_libraries(OgreRTShader OgreMain OgreRTShaderSystem ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreRTShader_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
    install(TARGETS ${SWIG_MODULE_OgreRTShader_REAL_NAME} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES})
    install(FILES ${CMAKE_BINARY_DIR}/Components/Python/OgreRTShader.py DESTINATION ${PYTHON_SITE_PACKAGES})
endif()

if(OGRE_BUILD_COMPONENT_OVERLAY)
    ogre_add_component_include_dir(Overlay)
    set_source_files_properties(../Overlay/include/OgreOverlay.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreOverlay python ../Overlay/include/OgreOverlay.i)
    swig_link_libraries(OgreOverlay OgreMain OgreOverlay ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreOverlay_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
endif()

if(OGRE_BUILD_COMPONENT_BITES)
    if(SDL2_FOUND)
        include_directories(${SDL2_INCLUDE_DIR})
        list(APPEND CMAKE_SWIG_FLAGS -DOGRE_BITES_HAVE_SDL=1)
    endif()

    if(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM)
        list(APPEND CMAKE_SWIG_FLAGS -DINCLUDE_RTSHADER_SYSTEM)
        add_definitions(-DINCLUDE_RTSHADER_SYSTEM)
    endif()
    
    ogre_add_component_include_dir(Bites)
    set_source_files_properties(../Bites/include/OgreBites.i PROPERTIES CPLUSPLUS ON)
    swig_add_module(OgreBites python ../Bites/include/OgreBites.i)
    swig_link_libraries(OgreBites OgreMain OgreBites ${PYTHON_LIBRARIES})
    set_target_properties(${SWIG_MODULE_OgreBites_REAL_NAME} PROPERTIES DEBUG_POSTFIX "")
endif()

{'fraction_non_alphanumeric': 0.09266968325791855, 'fraction_numerical': 0.003257918552036199, 'mean_word_length': 7.16248153618907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5754552', 'n_tokens_mistral': 2160, 'n_tokens_neox': 2100, 'n_words': 235}