<commit_before>cmake_minimum_required (VERSION 3.8 FATAL_ERROR)
project (yer-face LANGUAGES CXX CUDA)
set(EXECUTABLE_OUTPUT_PATH "bin")

set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")

option(USE_CUDA "Use CUDA, default to true" 1)

set( YERFACE_MODULES src/yer-face.cpp src/Logger.cpp src/SDLDriver.cpp src/FaceTracker.cpp src/FaceMapper.cpp src/MarkerType.cpp src/MarkerTracker.cpp src/MarkerSeparator.cpp src/FrameDerivatives.cpp src/Metrics.cpp src/Utilities.cpp )

include(CTest)

set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")

include(DownloadProject.cmake)
download_project(PROJ	googletest
	GIT_REPOSITORY	https://github.com/google/googletest.git
	GIT_TAG	master
	${UPDATE_DISCONNECTED_IF_AVAILABLE}
)

# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

include_directories("src")

set( _OPENCV_REQUIRED_MODULES core tracking calib3d )

if(USE_CUDA)
	list(APPEND _OPENCV_REQUIRED_MODULES cudaimgproc cudafilters )
	add_definitions(-DHAVE_CUDA)
	add_library( yer-face-cuda STATIC src/GPUUtils.cu )
else()
	unset(CUDA_FOUND)
endif()

find_package( OpenCV REQUIRED ${_OPENCV_REQUIRED_MODULES} )
find_package( dlib REQUIRED )
find_package( SDL2 REQUIRED )
<commit_msg>fix broken non-CUDA compile on systems which do not have the CUDA toolkit installed<commit_after>cmake_minimum_required (VERSION 3.8 FATAL_ERROR)
project (yer-face LANGUAGES CXX)
set(EXECUTABLE_OUTPUT_PATH "bin")

set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")

option(USE_CUDA "Use CUDA, default to true" 1)

set( YERFACE_MODULES src/yer-face.cpp src/Logger.cpp src/SDLDriver.cpp src/FaceTracker.cpp src/FaceMapper.cpp src/MarkerType.cpp src/MarkerTracker.cpp src/MarkerSeparator.cpp src/FrameDerivatives.cpp src/Metrics.cpp src/Utilities.cpp )

include(CTest)

set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")

include(DownloadProject.cmake)
download_project(PROJ	googletest
	GIT_REPOSITORY	https://github.com/google/googletest.git
	GIT_TAG	master
	${UPDATE_DISCONNECTED_IF_AVAILABLE}
)

# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

include_directories("src")

set( _OPENCV_REQUIRED_MODULES core tracking calib3d )

if(USE_CUDA)
	enable_language(CUDA)
	list(APPEND _OPENCV_REQUIRED_MODULES cudaimgproc cudafilters )
	add_definitions(-DHAVE_CUDA)
	add_library( yer-face-cuda STATIC src/GPUUtils.cu )
else()
	unset(CUDA_FOUND)
endif()

find_package( OpenCV REQUIRED ${_OPENCV_REQUIRED_MODULES} )
find_package( dlib REQUIRED )
find_package( SDL2 REQUIRED )

{'fraction_non_alphanumeric': 0.09549492385786802, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 7.43048128342246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '566088', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1199, 'n_words': 223}