<commit_before>##---------------------------------------------------------------------------
## CMakeLists.txt - The VRmeer Library - Delft University of Technology
##
##---------------------------------------------------------------------------
## Created by <NAME> - Aug 2007
## 
## osg python bindings
##---------------------------------------------------------------------------

FIND_PACKAGE(OpenThreads REQUIRED) 
FIND_PACKAGE(SWIG REQUIRED)

# Build a swig module for python
INCLUDE(${SWIG_USE_FILE})

# Our own Macros
INCLUDE(OSGSWIGMacros)

MACRO(FAKE_INCLUDE_FROM_FRAMEWORK FRAMEWORK_NAME FRAME_WORK_ROOT TARGET_ROOT)
	EXEC_PROGRAM("ln -s ${FRAME_WORK_ROOT}/Headers ${TARGET_ROOT}/${FRAMEWORK_NAME}" )
ENDMACRO(FAKE_INCLUDE_FROM_FRAMEWORK FRAMEWORK_NAME FRAME_WORK_ROOT TARGET_ROOT)

## additional include directories
IF(NOT APPLE)
	INCLUDE_DIRECTORIES(
		${OSG_INCLUDE_DIR}
	)
# dealing with frameworks on Mac OS X
ELSE(NOT APPLE)
	SET(FAKE_INCLUDE_PATH ${CMAKE_BINARY_DIR}/include)
	FILE(MAKE_DIRECTORY ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osg ${OSG_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgUtil ${OSGUTIL_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgDB ${OSGDB_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgGA ${OSGGA_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgManipulator ${OSGMANIPULATOR_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgFX ${OSGFX_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgText ${OSGTEXT_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgViewer ${OSGVIEWER_LIBRARY} ${FAKE_INCLUDE_PATH})
	INCLUDE_DIRECTORIES(${FAKE_INCLUDE_PATH})
ENDIF(NOT APPLE)


FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(
	${PYTHON_INCLUDE_PATH}
)

##set and create the output dir
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/python)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
SET(CMAKE_SWIG_OUTDIR ${OUTPUT_LIBDIR})

SET(CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/")

CONFIGURE_FILE(
	osg.pth.in
	${OUTPUT_LIBDIR}/osg.pth
)


SET_SOURCE_FILES_PROPERTIES(
	osg.i osgUtil.i osgFX.i osgDB.i osgGA.i osgText.i osgSim.i osgViewer.i osgManipulator.i
	PROPERTIES CPLUSPLUS TRUE)
	
SET_SOURCE_FILES_PROPERTIES(osg.i PROPERTIES SWIG_FLAGS "-make_default")

SET(SWIGLINKLIBS ${OSG_LIBRARY} ${PYTHON_LIBRARIES} ${OPENTHREADS_LIBRARY} ${OPENGL_LIBRARIES})

SET(SWIG_MODULE_osg_EXTRA_DEPS ../osg.i)
SWIG_ADD_MODULE(osg python osg.i)
SWIG_LINK_LIBRARIES(osg ${SWIGLINKLIBS} ${OPENGL_LIBS})

SET(SWIG_MODULE_osg_EXTRA_DEPS ../osgUtil.i)
SWIG_ADD_MODULE(osgUtil python osgUtil.i)
SWIG_LINK_LIBRARIES(osgUtil ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY})

SWIG_ADD_MODULE(osgManipulator python osgManipulator.i)
SWIG_LINK_LIBRARIES(osgManipulator ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY} ${OSGGA_LIBRARY} ${OSGMANIPULATOR_LIBRARY})

SWIG_ADD_MODULE(osgFX python osgFX.i)
SWIG_LINK_LIBRARIES(osgFX ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY} ${OSGDB_LIBRARY} ${OSGFX_LIBRARY})

SWIG_ADD_MODULE(osgDB python osgDB.i)
SWIG_LINK_LIBRARIES(osgDB ${SWIGLINKLIBS} ${OSGDB_LIBRARY})

SWIG_ADD_MODULE(osgGA python osgGA.i)
SWIG_LINK_LIBRARIES(osgGA ${SWIGLINKLIBS} ${OSGGA_LIBRARY})

SWIG_ADD_MODULE(osgViewer python osgViewer.i)
SWIG_LINK_LIBRARIES(osgViewer ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGVIEWER_LIBRARY})

SWIG_ADD_MODULE(osgText python osgText.i)
SWIG_LINK_LIBRARIES(osgText ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGTEXT_LIBRARY})

SWIG_ADD_MODULE(osgSim python osgSim.i)
SWIG_LINK_LIBRARIES(osgSim ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGSIM_LIBRARY})


IF(BUILD_WITH_OSGINTROSPECTION)
	SET_SOURCE_FILES_PROPERTIES(
		osgIntrospection.i
		PROPERTIES CPLUSPLUS TRUE)
	SWIG_ADD_MODULE(osgIntrospection python osgIntrospection.i)
	SWIG_LINK_LIBRARIES(osgIntrospection ${SWIGLINKLIBS} ${OSGINTROSPECTION_LIBRARY})
ENDIF(BUILD_WITH_OSGINTROSPECTION)

IF(BUILD_WITH_OSGART)
	INCLUDE_DIRECTORIES(
		${OSGART_INCLUDE_DIR}
	)
	
	SET_SOURCE_FILES_PROPERTIES(
		osgART.i
		PROPERTIES CPLUSPLUS TRUE)
		
	SWIG_ADD_MODULE(osgART python osgART.i)		
	SWIG_LINK_LIBRARIES(osgART ${SWIGLINKLIBS} ${OSGART_LIBRARY} ${OSGDB_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGGA_LIBRARY} )
	
	# OSGSWIG_ADD_MODULE(osgART python ${SWIGLINKLIBS} ${OSGART_LIBRARY} ${OSGGA_LIBRARY})
ENDIF(BUILD_WITH_OSGART)

IF(WIN32)
FOREACH(modname osg osgUtil osgFX osgDB osgGA osgViewer osgText osgSim)
	SET(TGT ${SWIG_MODULE_${modname}_REAL_NAME}) 
	GET_TARGET_PROPERTY(${TGT}_LOCATION ${TGT} LOCATION)
	GET_FILENAME_COMPONENT( MYNAME ${${TGT}_LOCATION} NAME_WE)
	GET_FILENAME_COMPONENT( MYDIR ${${TGT}_LOCATION} PATH)
	GET_FILENAME_COMPONENT( PARDIR ${MYDIR} PATH)

	ADD_CUSTOM_COMMAND(TARGET ${TGT}
                     POST_BUILD
                     COMMAND ${CMAKE_COMMAND}
    								 ARGS -E copy ${${TGT}_LOCATION} "${PARDIR}/${MYNAME}.pyd"
  )
ENDFOREACH(modname)
ENDIF(WIN32)

<commit_msg>fix for segfault caused by linking stdc++, noticeable on new gcc compilers such as in ubuntu intrepid<commit_after>##---------------------------------------------------------------------------
## CMakeLists.txt - The VRmeer Library - Delft University of Technology
##
##---------------------------------------------------------------------------
## Created by <NAME> - Aug 2007
## 
## osg python bindings
##---------------------------------------------------------------------------

FIND_PACKAGE(OpenThreads REQUIRED) 
FIND_PACKAGE(SWIG REQUIRED)

# Build a swig module for python
INCLUDE(${SWIG_USE_FILE})

# Our own Macros
INCLUDE(OSGSWIGMacros)

MACRO(FAKE_INCLUDE_FROM_FRAMEWORK FRAMEWORK_NAME FRAME_WORK_ROOT TARGET_ROOT)
	EXEC_PROGRAM("ln -s ${FRAME_WORK_ROOT}/Headers ${TARGET_ROOT}/${FRAMEWORK_NAME}" )
ENDMACRO(FAKE_INCLUDE_FROM_FRAMEWORK FRAMEWORK_NAME FRAME_WORK_ROOT TARGET_ROOT)

## additional include directories
IF(NOT APPLE)
	INCLUDE_DIRECTORIES(
		${OSG_INCLUDE_DIR}
	)
# dealing with frameworks on Mac OS X
ELSE(NOT APPLE)
	SET(FAKE_INCLUDE_PATH ${CMAKE_BINARY_DIR}/include)
	FILE(MAKE_DIRECTORY ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osg ${OSG_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgUtil ${OSGUTIL_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgDB ${OSGDB_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgGA ${OSGGA_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgManipulator ${OSGMANIPULATOR_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgFX ${OSGFX_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgText ${OSGTEXT_LIBRARY} ${FAKE_INCLUDE_PATH})
	FAKE_INCLUDE_FROM_FRAMEWORK(osgViewer ${OSGVIEWER_LIBRARY} ${FAKE_INCLUDE_PATH})
	INCLUDE_DIRECTORIES(${FAKE_INCLUDE_PATH})
ENDIF(NOT APPLE)


FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(
	${PYTHON_INCLUDE_PATH}
)

##set and create the output dir
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/python)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
SET(CMAKE_SWIG_OUTDIR ${OUTPUT_LIBDIR})

SET(CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/")

CONFIGURE_FILE(
	osg.pth.in
	${OUTPUT_LIBDIR}/osg.pth
)


SET_SOURCE_FILES_PROPERTIES(
	osg.i osgUtil.i osgFX.i osgDB.i osgGA.i osgText.i osgSim.i osgViewer.i osgManipulator.i
	PROPERTIES CPLUSPLUS TRUE)
	
SET_SOURCE_FILES_PROPERTIES(osg.i PROPERTIES SWIG_FLAGS "-make_default")

IF(CMAKE_COMPILER_IS_GNUCXX)
 SET(STDCPLUSPLUS_LIBRARY -lstdc++)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

SET(SWIGLINKLIBS ${OSG_LIBRARY} ${PYTHON_LIBRARIES} ${OPENTHREADS_LIBRARY} ${STDCPLUSPLUS_LIBRARY} ${OPENGL_LIBRARIES})

SET(SWIG_MODULE_osg_EXTRA_DEPS ../osg.i)
SWIG_ADD_MODULE(osg python osg.i)
SWIG_LINK_LIBRARIES(osg ${SWIGLINKLIBS} ${OPENGL_LIBS})

SET(SWIG_MODULE_osg_EXTRA_DEPS ../osgUtil.i)
SWIG_ADD_MODULE(osgUtil python osgUtil.i)
SWIG_LINK_LIBRARIES(osgUtil ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY})

SWIG_ADD_MODULE(osgManipulator python osgManipulator.i)
SWIG_LINK_LIBRARIES(osgManipulator ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY} ${OSGGA_LIBRARY} ${OSGMANIPULATOR_LIBRARY})

SWIG_ADD_MODULE(osgFX python osgFX.i)
SWIG_LINK_LIBRARIES(osgFX ${SWIGLINKLIBS} ${OSGUTIL_LIBRARY} ${OSGDB_LIBRARY} ${OSGFX_LIBRARY})

SWIG_ADD_MODULE(osgDB python osgDB.i)
SWIG_LINK_LIBRARIES(osgDB ${SWIGLINKLIBS} ${OSGDB_LIBRARY})

SWIG_ADD_MODULE(osgGA python osgGA.i)
SWIG_LINK_LIBRARIES(osgGA ${SWIGLINKLIBS} ${OSGGA_LIBRARY})

SWIG_ADD_MODULE(osgViewer python osgViewer.i)
SWIG_LINK_LIBRARIES(osgViewer ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGVIEWER_LIBRARY})

SWIG_ADD_MODULE(osgText python osgText.i)
SWIG_LINK_LIBRARIES(osgText ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGTEXT_LIBRARY})

SWIG_ADD_MODULE(osgSim python osgSim.i)
SWIG_LINK_LIBRARIES(osgSim ${SWIGLINKLIBS} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGSIM_LIBRARY})


IF(BUILD_WITH_OSGINTROSPECTION)
	SET_SOURCE_FILES_PROPERTIES(
		osgIntrospection.i
		PROPERTIES CPLUSPLUS TRUE)
	SWIG_ADD_MODULE(osgIntrospection python osgIntrospection.i)
	SWIG_LINK_LIBRARIES(osgIntrospection ${SWIGLINKLIBS} ${OSGINTROSPECTION_LIBRARY})
ENDIF(BUILD_WITH_OSGINTROSPECTION)

IF(BUILD_WITH_OSGART)
	INCLUDE_DIRECTORIES(
		${OSGART_INCLUDE_DIR}
	)
	
	SET_SOURCE_FILES_PROPERTIES(
		osgART.i
		PROPERTIES CPLUSPLUS TRUE)
		
	SWIG_ADD_MODULE(osgART python osgART.i)		
	SWIG_LINK_LIBRARIES(osgART ${SWIGLINKLIBS} ${OSGART_LIBRARY} ${OSGDB_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGGA_LIBRARY} )
	
	# OSGSWIG_ADD_MODULE(osgART python ${SWIGLINKLIBS} ${OSGART_LIBRARY} ${OSGGA_LIBRARY})
ENDIF(BUILD_WITH_OSGART)

IF(WIN32)
FOREACH(modname osg osgUtil osgFX osgDB osgGA osgViewer osgText osgSim)
	SET(TGT ${SWIG_MODULE_${modname}_REAL_NAME}) 
	GET_TARGET_PROPERTY(${TGT}_LOCATION ${TGT} LOCATION)
	GET_FILENAME_COMPONENT( MYNAME ${${TGT}_LOCATION} NAME_WE)
	GET_FILENAME_COMPONENT( MYDIR ${${TGT}_LOCATION} PATH)
	GET_FILENAME_COMPONENT( PARDIR ${MYDIR} PATH)

	ADD_CUSTOM_COMMAND(TARGET ${TGT}
                     POST_BUILD
                     COMMAND ${CMAKE_COMMAND}
    								 ARGS -E copy ${${TGT}_LOCATION} "${PARDIR}/${MYNAME}.pyd"
  )
ENDFOREACH(modname)
ENDIF(WIN32)


{'fraction_non_alphanumeric': 0.1417070805043647, 'fraction_numerical': 0.0015518913676042677, 'mean_word_length': 4.9360967184801385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6406223', 'n_tokens_mistral': 4553, 'n_tokens_neox': 4098, 'n_words': 571}