<commit_before># project name, and type
PROJECT(OpenApoc CXX C)

# check cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/framework/cmake/")

include(framework)

# check compiler
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
	CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
	if (COMPILER_SUPPORTS_CXX0X)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
	else()
		message(FATAL_ERROR "Your C++ compiler does not support C++11.")
	endif()
endif()

option (EXTRA_WARNINGS "Enable extra warning flags (-W -Wall -Wextra)" ON)

if(EXTRA_WARNINGS)
	CHECK_CXX_COMPILER_FLAG("-W -Wall -Wextra" COMPILER_SUPPORTS_WARNINGS)
	if (COMPILER_SUPPORTS_WARNINGS)
			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra")
			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra")
	endif(COMPILER_SUPPORTS_WARNINGS)
endif(EXTRA_WARNINGS)

CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden"
		COMPILER_SUPPORTS_HIDDEN_VISIBILITY)
if(COMPILER_SUPPORTS_HIDDEN_VISIBILITY)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
endif(COMPILER_SUPPORTS_HIDDEN_VISIBILITY)

option(MONOLITHIC_BUILD "Build all source in a single step" OFF)

option(LTO "Build using link-time-optimisations" OFF)

CHECK_CXX_COMPILER_FLAG("-flto"
	COMPILER_SUPPORTS_LTO)

if (LTO)
		if (NOT COMPILER_SUPPORTS_LTO)
				message(FATAL_ERROR "LTO not supported by this compiler")
		endif(NOT COMPILER_SUPPORTS_LTO)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
endif(LTO)


# find openapoc sources
AUX_SOURCE_DIRECTORY(game sources)
AUX_SOURCE_DIRECTORY(game/apocresources sources)
AUX_SOURCE_DIRECTORY(game/general sources)
AUX_SOURCE_DIRECTORY(game/city sources)
AUX_SOURCE_DIRECTORY(game/tileview sources)
AUX_SOURCE_DIRECTORY(game/resources sources)
AUX_SOURCE_DIRECTORY(game/ufopaedia sources)
AUX_SOURCE_DIRECTORY(library sources)
AUX_SOURCE_DIRECTORY(shaders sources)
AUX_SOURCE_DIRECTORY(transitions sources)
AUX_SOURCE_DIRECTORY(forms sources)

# declare tinyxml library<commit_msg>Add game/debugtools to cmake build<commit_after># project name, and type
PROJECT(OpenApoc CXX C)

# check cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/framework/cmake/")

include(framework)

# check compiler
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
	CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
	if (COMPILER_SUPPORTS_CXX0X)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
	else()
		message(FATAL_ERROR "Your C++ compiler does not support C++11.")
	endif()
endif()

option (EXTRA_WARNINGS "Enable extra warning flags (-W -Wall -Wextra)" ON)

if(EXTRA_WARNINGS)
	CHECK_CXX_COMPILER_FLAG("-W -Wall -Wextra" COMPILER_SUPPORTS_WARNINGS)
	if (COMPILER_SUPPORTS_WARNINGS)
			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra")
			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra")
	endif(COMPILER_SUPPORTS_WARNINGS)
endif(EXTRA_WARNINGS)

CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden"
		COMPILER_SUPPORTS_HIDDEN_VISIBILITY)
if(COMPILER_SUPPORTS_HIDDEN_VISIBILITY)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
endif(COMPILER_SUPPORTS_HIDDEN_VISIBILITY)

option(MONOLITHIC_BUILD "Build all source in a single step" OFF)

option(LTO "Build using link-time-optimisations" OFF)

CHECK_CXX_COMPILER_FLAG("-flto"
	COMPILER_SUPPORTS_LTO)

if (LTO)
		if (NOT COMPILER_SUPPORTS_LTO)
				message(FATAL_ERROR "LTO not supported by this compiler")
		endif(NOT COMPILER_SUPPORTS_LTO)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
endif(LTO)


# find openapoc sources
AUX_SOURCE_DIRECTORY(game sources)
AUX_SOURCE_DIRECTORY(game/apocresources sources)
AUX_SOURCE_DIRECTORY(game/general sources)
AUX_SOURCE_DIRECTORY(game/city sources)
AUX_SOURCE_DIRECTORY(game/tileview sources)
AUX_SOURCE_DIRECTORY(game/resources sources)
AUX_SOURCE_DIRECTORY(game/ufopaedia sources)
AUX_SOURCE_DIRECTORY(game/debugtools sources)
AUX_SOURCE_DIRECTORY(library sources)
AUX_SOURCE_DIRECTORY(shaders sources)
AUX_SOURCE_DIRECTORY(transitions sources)
AUX_SOURCE_DIRECTORY(forms sources)

# declare tinyxml library
{'fraction_non_alphanumeric': 0.10153380859796933, 'fraction_numerical': 0.006912940159861741, 'mean_word_length': 8.54639175257732, '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': '3984217', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1820, 'n_words': 303}