<commit_before>###############################################################################
# create executable
###############################################################################

project (teabag)
include (ExternalProject)

# glob header and source files
file (GLOB_RECURSE teabag_HEADERS "*.h" "*.hpp" "*.hxx")
file (GLOB_RECURSE teabag_SOURCES "*.c" "*.cpp")

if (APPLE)
	file (GLOB_RECURSE teabag_SOURCES_OSX "*.mm")
	set (teabag_SOURCES ${teabag_SOURCES} ${teabag_SOURCES_OSX})
endif()

include_directories (
	.
	engine
)

# create executable
link_directories (${DEPENDENCIES_DIR}/lib)
add_executable (teabag WIN32 MACOSX_BUNDLE ${teabag_HEADERS} ${teabag_SOURCES})

###############################################################################
# dependencies
###############################################################################

# Common CMake Flags
set(COMMON_CMAKE_FLAGS
	-DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_DIR}
	-DCMAKE_PREFIX_PATH=${DEPENDENCIES_DIR}
	-DCMAKE_INCLUDE_PATH=${DEPENDENCIES_DIR}/include
	-DCMAKE_LIBRARY_PATH=${DEPENDENCIES_DIR}/lib)

# Mac OS X requires dependencies to use the libc++ standard library instead of
# the default stdlibc++ when using C++11 in the main project. Additionally,
# disable the -Wdeprecated-register warning.
if (APPLE)
	set(COMMON_CMAKE_FLAGS
		${COMMON_CMAKE_FLAGS}
		-DCMAKE_OSX_ARCHITECTURES="x86_64"
		-DCMAKE_C_FLAGS="-stdlib=libc++"
		"-DCMAKE_CXX_FLAGS='-std=c++11 -stdlib=libc++ -Wno-deprecated-register'")
endif()

###############################################################################
# SDL2

find_package (SDL2 REQUIRED)
include_directories (${SDL2_INCLUDE_DIR})
target_link_libraries (teabag ${SDL2_LIBRARY})

###############################################################################
# Bullet
find_package (BULLET COMPONENTS
	BulletDynamics
	BulletCollision
	LinearMath
)
if (BULLET_FOUND)
	include_directories (${BULLET_INCLUDE_DIR})
	target_link_libraries (teabag
		${BULLET_BulletDynamics_LIBRARY}
		${BULLET_BulletCollision_LIBRARY}
		${BULLET_LinearMath_LIBRARY}
	)
else ()
	message (STATUS "Bullet will be downloaded automatically")
	externalproject_add (Bullet_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		GIT_REPOSITORY "git://github.com/bulletphysics/bullet3"
		GIT_TAG "Bullet-2.83-alpha"
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
		-DBUILD_EXTRAS=0
		-DBUILD_UNIT_TESTS=0
		-DBUILD_CPU_DEMOS=0
		-DBUILD_BULLET2_DEMOS=0
		-DBUILD_BULLET3=0
	)
	add_dependencies(teabag Bullet_PROJECT)
	include_directories ("${DEPENDENCIES_DIR}/include/bullet")
	target_link_libraries (teabag
		BulletDynamics
		BulletCollision
		LinearMath
	)
endif ()

###############################################################################
# MathGeoLib
message (STATUS "MathGeoLib will be downloaded automatically")
externalproject_add (MathGeoLib_PROJECT
	PREFIX ${DEPENDENCIES_DIR}
	GIT_REPOSITORY "git://github.com/juj/MathGeoLib"
	GIT_TAG "master"
	CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
)
add_dependencies(teabag MathGeoLib_PROJECT)
add_definitions (
	-DMATH_BULLET_INTEROP
	-DMATH_OGRE_INTEROP
)
include_directories ("${DEPENDENCIES_DIR}/include/MathGeoLib")
target_link_libraries (teabag MathGeoLib)

###############################################################################
# Ogre3D
find_package (OGRE)
if (NOT OGRE_FOUND)
	# Install Ogre's dependencies
	externalproject_add(OgreDeps_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		HG_REPOSITORY "https://bitbucket.org/davedissian/ogredeps/"
		HG_TAG "default"
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
	)

	# Build Ogre
	message (STATUS "Ogre will be downloaded automatically")
	externalproject_add(Ogre_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		HG_REPOSITORY "https://bitbucket.org/sinbad/ogre"
		HG_TAG "v1-9-0"
		DEPENDS OgreDeps_PROJECT
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
		-DOGRE_BUILD_COMPONENT_OVERLAY=0
		-DOGRE_BUILD_COMPONENT_PAGING=0
		-DOGRE_BUILD_COMPONENT_PROPERTY=0
		-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=0
		-DOGRE_BUILD_COMPONENT_TERRAIN=0
		-DOGRE_BUILD_COMPONENT_VOLUME=0
		-DOGRE_BUILD_PLUGIN_BSP=0
		-DOGRE_BUILD_PLUGIN_CG=0
		-DOGRE_BUILD_PLUGIN_PCZ=0
		-DOGRE_BUILD_PLUGIN_PFX=0
		-DOGRE_BUILD_RENDERSYSTEM_GL=1
		-DOGRE_BUILD_SAMPLES=0
		-DOGRE_BUILD_TOOLS=0
		-DOGRE_INSTALL_DOCS=0
		-DOGRE_INSTALL_PDB=0
		-DOGRE_INSTALL_SAMPLES=0
		-DOGRE_CONFIG_THREADS=0
		-DOGRE_UNITY_BUILD=1
	)
	add_dependencies(teabag Ogre_PROJECT)

	# Set up Ogre variables
	set(OGRE_INCLUDE_DIRS "${DEPENDENCIES_DIR}/include/OGRE;${DEPENDENCIES_DIR}/include/OIS")
	if (APPLE)
		set(OGRE_LIBRARIES "${DEPENDENCIES_DIR}/lib/RelWithDebInfo/Ogre.framework")
		set(OGRE_PLUGIN_DIR_REL "${DEPENDENCIES_DIR}/lib/RelWithDebInfo")
	elseif (UNIX)
		set(OGRE_LIBRARIES "OgreMain")
		set(OGRE_PLUGIN_DIR_REL "${DEPENDENCIES_DIR}/lib/OGRE")
	endif()

endif ()

# Link to Ogre<commit_msg>Boost go home for good this time!<commit_after>###############################################################################
# create executable
###############################################################################

project (teabag)
include (ExternalProject)

# glob header and source files
file (GLOB_RECURSE teabag_HEADERS "*.h" "*.hpp" "*.hxx")
file (GLOB_RECURSE teabag_SOURCES "*.c" "*.cpp")

if (APPLE)
	file (GLOB_RECURSE teabag_SOURCES_OSX "*.mm")
	set (teabag_SOURCES ${teabag_SOURCES} ${teabag_SOURCES_OSX})
endif()

include_directories (
	.
	engine
)

# create executable
link_directories (${DEPENDENCIES_DIR}/lib)
add_executable (teabag WIN32 MACOSX_BUNDLE ${teabag_HEADERS} ${teabag_SOURCES})

###############################################################################
# dependencies
###############################################################################

# Common CMake Flags
set(COMMON_CMAKE_FLAGS
	-DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_DIR}
	-DCMAKE_PREFIX_PATH=${DEPENDENCIES_DIR}
	-DCMAKE_INCLUDE_PATH=${DEPENDENCIES_DIR}/include
	-DCMAKE_LIBRARY_PATH=${DEPENDENCIES_DIR}/lib)

# Mac OS X requires dependencies to use the libc++ standard library instead of
# the default stdlibc++ when using C++11 in the main project. Additionally,
# disable the -Wdeprecated-register warning.
if (APPLE)
	set(COMMON_CMAKE_FLAGS
		${COMMON_CMAKE_FLAGS}
		-DCMAKE_OSX_ARCHITECTURES="x86_64"
		-DCMAKE_C_FLAGS="-stdlib=libc++"
		"-DCMAKE_CXX_FLAGS='-std=c++11 -stdlib=libc++ -Wno-deprecated-register'")
endif()

###############################################################################
# SDL2

find_package (SDL2 REQUIRED)
include_directories (${SDL2_INCLUDE_DIR})
target_link_libraries (teabag ${SDL2_LIBRARY})

###############################################################################
# Bullet
find_package (BULLET COMPONENTS
	BulletDynamics
	BulletCollision
	LinearMath
)
if (BULLET_FOUND)
	include_directories (${BULLET_INCLUDE_DIR})
	target_link_libraries (teabag
		${BULLET_BulletDynamics_LIBRARY}
		${BULLET_BulletCollision_LIBRARY}
		${BULLET_LinearMath_LIBRARY}
	)
else ()
	message (STATUS "Bullet will be downloaded automatically")
	externalproject_add (Bullet_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		GIT_REPOSITORY "git://github.com/bulletphysics/bullet3"
		GIT_TAG "Bullet-2.83-alpha"
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
		-DBUILD_EXTRAS=0
		-DBUILD_UNIT_TESTS=0
		-DBUILD_CPU_DEMOS=0
		-DBUILD_BULLET2_DEMOS=0
		-DBUILD_BULLET3=0
	)
	add_dependencies(teabag Bullet_PROJECT)
	include_directories ("${DEPENDENCIES_DIR}/include/bullet")
	target_link_libraries (teabag
		BulletDynamics
		BulletCollision
		LinearMath
	)
endif ()

###############################################################################
# MathGeoLib
message (STATUS "MathGeoLib will be downloaded automatically")
externalproject_add (MathGeoLib_PROJECT
	PREFIX ${DEPENDENCIES_DIR}
	GIT_REPOSITORY "git://github.com/juj/MathGeoLib"
	GIT_TAG "master"
	CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
)
add_dependencies(teabag MathGeoLib_PROJECT)
add_definitions (
	-DMATH_BULLET_INTEROP
	-DMATH_OGRE_INTEROP
)
include_directories ("${DEPENDENCIES_DIR}/include/MathGeoLib")
target_link_libraries (teabag MathGeoLib)

###############################################################################
# Ogre3D
find_package (OGRE)
if (NOT OGRE_FOUND)
	# Install Ogre's dependencies
	externalproject_add(OgreDeps_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		HG_REPOSITORY "https://bitbucket.org/davedissian/ogredeps/"
		HG_TAG "default"
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
	)

	# Build Ogre
	message (STATUS "Ogre will be downloaded automatically")
	externalproject_add(Ogre_PROJECT
		PREFIX ${DEPENDENCIES_DIR}
		HG_REPOSITORY "https://bitbucket.org/sinbad/ogre"
		HG_TAG "v1-9-0"
		DEPENDS OgreDeps_PROJECT
		CMAKE_ARGS ${COMMON_CMAKE_FLAGS}
		-DOGRE_BUILD_COMPONENT_OVERLAY=0
		-DOGRE_BUILD_COMPONENT_PAGING=0
		-DOGRE_BUILD_COMPONENT_PROPERTY=0
		-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=0
		-DOGRE_BUILD_COMPONENT_TERRAIN=0
		-DOGRE_BUILD_COMPONENT_VOLUME=0
		-DOGRE_BUILD_DOCS=0
		-DOGRE_BUILD_PLUGIN_BSP=0
		-DOGRE_BUILD_PLUGIN_OCTREE=0
		-DOGRE_BUILD_PLUGIN_CG=0
		-DOGRE_BUILD_PLUGIN_PCZ=0
		-DOGRE_BUILD_PLUGIN_PFX=0
		-DOGRE_BUILD_RENDERSYSTEM_GL=1
		-DOGRE_BUILD_SAMPLES=0
		-DOGRE_BUILD_TOOLS=0
		-DOGRE_INSTALL_DOCS=0
		-DOGRE_INSTALL_PDB=0
		-DOGRE_INSTALL_SAMPLES=0
		-DOGRE_CONFIG_THREADS=0
		-DOGRE_UNITY_BUILD=1
		-DOGRE_USE_BOOST=0
	)
	add_dependencies(teabag Ogre_PROJECT)

	# Set up Ogre variables
	set(OGRE_INCLUDE_DIRS "${DEPENDENCIES_DIR}/include/OGRE;${DEPENDENCIES_DIR}/include/OIS")
	if (APPLE)
		set(OGRE_LIBRARIES "${DEPENDENCIES_DIR}/lib/RelWithDebInfo/Ogre.framework")
		set(OGRE_PLUGIN_DIR_REL "${DEPENDENCIES_DIR}/lib/RelWithDebInfo")
	elseif (UNIX)
		set(OGRE_LIBRARIES "OgreMain")
		set(OGRE_PLUGIN_DIR_REL "${DEPENDENCIES_DIR}/lib/OGRE")
	endif()

endif ()

# Link to Ogre
{'fraction_non_alphanumeric': 0.21780850185720182, 'fraction_numerical': 0.010008254230293025, 'mean_word_length': 7.677708146821844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '67651', 'n_tokens_mistral': 3924, 'n_tokens_neox': 3614, 'n_words': 528}