<commit_before>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN32 0)

project(cherryhex)

set(chex_VERSION_MAJOR 0)
set(chex_VERSION_MINOR 1)
set(chex_VERSION_PATCH 0)

set(chex_VERSION_EXTRA "")

set(chex_VERSION "${chex_VERSION_MAJOR}.${chex_VERSION_MINOR}.${chex_VERSION_PATCH}")

if ( chex_VERSION_EXTRA )
	set(chex_VERSION "${chex_VERSION}-${chex_VERSION_EXTRA}")
endif ()

message("Conifguring cherryhex version ${chex_VERSION}.")

if( MSVC )
	set(dialect "")
	set(warnings "")
	set(flags "/EHsc /MP")

	set(chex_DEBUG_FLAGS "/Od")
	set(chex_RELEASE_FLAGS "/Ox")
else ()
	set(dialect "-std=c++1y")
	set(warnings "-Wall -Wextra")
	
	set(chex_DEBUG_FLAGS "-O0 -g3")
	set(chex_RELEASE_FLAGS "-O3 -g0 -march=native")
	
	if ( DEFINED WIN32 )
		# MinGW-w64
		set(flags "-mwindows -mconsole")
		set(OS_LIBS Version Imm32 winmm mingw32 gdi32)
	else ()
		# GCC/Clang
		set(flags "-fPIC")
		set(OS_LIBS "")
	endif ()
endif()

file(GLOB_RECURSE chex_SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/tinyfiledialogs.c)
file(GLOB_RECURSE chex_HEADERS ${PROJECT_SOURCE_DIR}/include/*.hpp)

configure_file (
	"${PROJECT_SOURCE_DIR}/gen/cherryhex_version.hpp.in"
	"${PROJECT_BINARY_DIR}/cherryhex_version.hpp"
)

set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${dialect} ${warnings} ${flags}")

set(EXECUTABLE_NAME "cherryhex")

if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
    set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${chex_DEBUG_FLAGS}")
else ()
    set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${chex_RELEASE_FLAGS}")
endif ()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BASE}")

include_directories("include" ${PROJECT_BINARY_DIR})

set(LIBS "")

message("CXX Flags: ${CMAKE_CXX_FLAGS}")

add_executable(${EXECUTABLE_NAME} ${chex_SOURCES} ${chex_HEADERS})
target_link_libraries(${EXECUTABLE_NAME} ${LIBS})<commit_msg>Add install dir to cmake<commit_after>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN32 0)

project(cherryhex)

set(chex_VERSION_MAJOR 0)
set(chex_VERSION_MINOR 1)
set(chex_VERSION_PATCH 0)

set(chex_VERSION_EXTRA "")

set(chex_VERSION "${chex_VERSION_MAJOR}.${chex_VERSION_MINOR}.${chex_VERSION_PATCH}")

if ( chex_VERSION_EXTRA )
	set(chex_VERSION "${chex_VERSION}-${chex_VERSION_EXTRA}")
endif ()

message("Conifguring cherryhex version ${chex_VERSION}.")

if( MSVC )
	set(dialect "")
	set(warnings "")
	set(flags "/EHsc /MP")

	set(chex_DEBUG_FLAGS "/Od")
	set(chex_RELEASE_FLAGS "/Ox")
else ()
	set(dialect "-std=c++1y")
	set(warnings "-Wall -Wextra")
	
	set(chex_DEBUG_FLAGS "-O0 -g3")
	set(chex_RELEASE_FLAGS "-O3 -g0 -march=native")
	
	if ( DEFINED WIN32 )
		# MinGW-w64
		set(flags "-mwindows -mconsole")
		set(OS_LIBS Version Imm32 winmm mingw32 gdi32)
	else ()
		# GCC/Clang
		set(flags "-fPIC")
		set(OS_LIBS "")
	endif ()
endif()

file(GLOB_RECURSE chex_SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/tinyfiledialogs.c)
file(GLOB_RECURSE chex_HEADERS ${PROJECT_SOURCE_DIR}/include/*.hpp)

configure_file (
	"${PROJECT_SOURCE_DIR}/gen/cherryhex_version.hpp.in"
	"${PROJECT_BINARY_DIR}/cherryhex_version.hpp"
)

set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${dialect} ${warnings} ${flags}")

set(EXECUTABLE_NAME "cherryhex")

if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
    set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${chex_DEBUG_FLAGS}")
else ()
    set(CMAKE_CXX_FLAGS_BASE "${CMAKE_CXX_FLAGS_BASE} ${chex_RELEASE_FLAGS}")
endif ()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BASE}")

include_directories("include" ${PROJECT_BINARY_DIR})

set(LIBS "")

message("CXX Flags: ${CMAKE_CXX_FLAGS}")

add_executable(${EXECUTABLE_NAME} ${chex_SOURCES} ${chex_HEADERS})
target_link_libraries(${EXECUTABLE_NAME} ${LIBS})

install (TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
{'fraction_non_alphanumeric': 0.14821664464993395, 'fraction_numerical': 0.01215323645970938, 'mean_word_length': 7.212581344902386, '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': '3546157', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1562, 'n_words': 228}