<commit_before>cmake_minimum_required(VERSION 2.8)

project(drivekit)

set(CMAKE_MODULE_PATH ${drivekit_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

# Set the default install path to be './build/dist'
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 
  set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/dist CACHE PATH "drive-sdk install prefix" FORCE) 
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 

OPTION( BUILD_EXAMPLES                "Build example apps"                OFF )
OPTION( BUILD_PROJECT                "Build code for cvml project"                OFF )

SET (CMAKE_C_FLAGS                "-Wall -std=c99")
include(MacroOutOfSourceBuild)
include(TargetDistclean)

macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build.")

add_subdirectory(src)
add_subdirectory(test)

install(DIRECTORY include/ankidrive DESTINATION include)

if (BUILD_EXAMPLES)
  add_subdirectory(deps/bzle)
  add_subdirectory(examples)
endif ()

### Compile only the files added for the project
if (BUILD_PROJECT)
  if (NOT BUILD_EXAMPLES)
    add_subdirectory(deps/bzle)
  ENDIF()
  SET (CMAKE_C_FLAGS      "")
  include(FindGLIB2)
  include(FindReadline)
  include_directories(${drivekit_SOURCE_DIR}/include
    ${bzle_SOURCE_DIR}/include
    ${GLIB2_INCLUDE_DIRS}
    ${READLINE_INCLUDE_DIR}
    /usr/include/flycapture
    )
  set(Project_SOURCES
    examples/simple-c-interface/anki-simplified.h
    examples/simple-c-interface/anki-simplified.c
    CV/quickselect.c
    CV/get_camera.cpp
    )
  add_executable(main main.c ${Project_SOURCES})
  
  find_package( OpenCV REQUIRED )
  target_link_libraries(main
    ankidrive
    bzle
    ${GLIB2_LIBRARIES}
    ${READLINE_LIBRARY}
    flycapture
    pthread
    ${OpenCV_LIBS} 
    )
  install(TARGETS main 
    RUNTIME DESTINATION bin
    )
endif ()

# CTest is flaky - Create a target to run our test suite directly
add_custom_target(test COMMAND ${PROJECT_BINARY_DIR}/test/Test)<commit_msg>Save before update with master branch<commit_after>cmake_minimum_required(VERSION 2.8)

project(drivekit)

set(CMAKE_MODULE_PATH ${drivekit_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

# Set the default install path to be './build/dist'
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 
  set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/dist CACHE PATH "drive-sdk install prefix" FORCE) 
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 

OPTION( BUILD_EXAMPLES                "Build example apps"                OFF )
OPTION( BUILD_PROJECT                "Build code for cvml project"                OFF )

SET (CMAKE_C_FLAGS                "-Wall -std=c99")
include(MacroOutOfSourceBuild)
include(TargetDistclean)

macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build.")

add_subdirectory(src)
add_subdirectory(test)

install(DIRECTORY include/ankidrive DESTINATION include)

if (BUILD_EXAMPLES)
  add_subdirectory(deps/bzle)
  add_subdirectory(examples)
endif ()

### Compile only the files added for the project
if (BUILD_PROJECT)
  if (NOT BUILD_EXAMPLES)
    add_subdirectory(deps/bzle)
  ENDIF()
  SET (CMAKE_C_FLAGS      "")
  include(FindGLIB2)
  include(FindReadline)
  include_directories(${drivekit_SOURCE_DIR}/include
    ${bzle_SOURCE_DIR}/include
    ${GLIB2_INCLUDE_DIRS}
    ${READLINE_INCLUDE_DIR}
    /usr/include/flycapture
    )
  set(Project_SOURCES
    examples/simple-c-interface/anki-simplified.c
    CV/quickselect.c
    CV/get_camera.cpp
    )
  add_executable(main main.c ${Project_SOURCES})
  
  find_package( OpenCV REQUIRED )
  target_link_libraries(main
    ankidrive
    bzle
    ${GLIB2_LIBRARIES}
    ${READLINE_LIBRARY}
    flycapture
    pthread
    ${OpenCV_LIBS} 
    )
  install(TARGETS main 
    RUNTIME DESTINATION bin
    )
endif ()

# CTest is flaky - Create a target to run our test suite directly
add_custom_target(test COMMAND ${PROJECT_BINARY_DIR}/test/Test)
{'fraction_non_alphanumeric': 0.08504098360655737, 'fraction_numerical': 0.003586065573770492, 'mean_word_length': 4.051746442432083, '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': '6385537', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1337, 'n_words': 255}