<commit_before>#######################################################
## Library sources

set( INCDIR "../include/pangolin")

## Header only includes / core headers
set(
  HEADERS
  ${INCDIR}/pangolin.h ${INCDIR}/platform.h
  ${INCDIR}/simple_math.h ${INCDIR}/timer.h
  ${INCDIR}/gl.h ${INCDIR}/gldraw.h ${INCDIR}/glvbo.h
  ${INCDIR}/glcuda.h ${INCDIR}/cg.h ${INCDIR}/glsl.h
  ${INCDIR}/image.h
)

## Store list of source files
set( SOURCES "" )

#######################################################
## User build options

option(BUILD_PANGOLIN_GUI "Build support for Pangolin GUI" ON)
if(BUILD_PANGOLIN_GUI)
  list(APPEND HEADERS
    ${INCDIR}/display.h ${INCDIR}/display_internal.h 
    ${INCDIR}/view.h ${INCDIR}/viewport.h
    ${INCDIR}/handler.h ${INCDIR}/opengl_render_state.h
  )
  list(APPEND SOURCES
    display.cpp view.cpp viewport.cpp
    handler.cpp opengl_render_state.cpp
  )
endif()

if(BUILD_PANGOLIN_GUI AND NOT ANDROID)
  list(APPEND HEADERS ${INCDIR}/plotter.h )
  list(APPEND SOURCES plotter.cpp )
endif()

option(BUILD_PANGOLIN_VARS "Build support for Pangolin Vars" ON)
if(BUILD_PANGOLIN_VARS)
  list(APPEND HEADERS ${INCDIR}/vars.h ${INCDIR}/vars_internal.h ${INCDIR}/input_record_repeat.h )
  list(APPEND SOURCES vars.cpp input_record_repeat.cpp )

  if(BUILD_PANGOLIN_GUI AND NOT ANDROID)
      list(APPEND HEADERS ${INCDIR}/widgets.h )
      list(APPEND SOURCES widgets.cpp )
  endif()
endif()

option(BUILD_PANGOLIN_VIDEO "Build support for Pangolin Video Utilities" ON)
if(BUILD_PANGOLIN_VIDEO)
  list(APPEND HEADERS
    ${INCDIR}/threadedfilebuf.h ${INCDIR}/video.h ${INCDIR}/video_common.h
    ${INCDIR}/video_splitter.h ${INCDIR}/video_output.h
    ${INCDIR}/video_recorder.h ${INCDIR}/video_record_repeat.h
    ${INCDIR}/video/pvn_video.h
  )
  list(APPEND SOURCES
    threadedfilebuf.cpp video.cpp video_splitter.cpp video_output.cpp
    video_recorder.cpp video_record_repeat.cpp video/pvn_video.cpp
  )
endif()

#######################################################
## Setup required includes / link info

# Project headers trump everything (including any potentially installed Pangolin)
list(APPEND USER_INC  "${PROJECT_SOURCE_DIR}/include;${CMAKE_CURRENT_BINARY_DIR}/include" )

find_package(Boost COMPONENTS thread filesystem system REQUIRED QUIET)
list(APPEND USER_INC  "${Boost_INCLUDE_DIRS}" )
list(APPEND LINK_LIBS "${Boost_LIBRARIES}" )

if(BUILD_PANGOLIN_GUI)
  if(NOT ANDROID)
      find_package(OpenGL REQUIRED QUIET)
      find_package(GLEW REQUIRED)
      list(APPEND USER_INC  "${OPENGL_INCLUDE_DIR};${GLEW_INCLUDE_DIR}" )
      list(APPEND LINK_LIBS "${OPENGL_LIBRARIES};${GLEW_LIBRARY}" )
  else()
      link_directories( "/Users/slovegrove/tools/toolchain/sysroot/usr/lib" )
      list(APPEND USER_INC  "/Users/slovegrove/tools/android/android-ndk-r8e/platforms/android-14/arch-arm/usr/include/")
  endif()
endif()

#######################################################
## Find optional dependencies

find_package(CVARS QUIET)
if(CVARS_FOUND AND NOT ANDROID)
  set(HAVE_CVARS 1)
  list(APPEND USER_INC  ${CVARS_INCLUDE_DIR} )
  list(APPEND LINK_LIBS ${CVARS_LIBRARIES} )
endif()

find_package(CUDA QUIET)
if(CUDA_FOUND)
  set(HAVE_CUDA 1)
  cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)
  set(CUDA_NVCC_FLAGS "-O3" )
  add_definitions(-DCUDA_BUILD)
  message(STATUS "CUDA Found and Enabled")
endif()

find_package(FREEGLUT)
find_package(GLUT)

if(_OSX_)<commit_msg>Specify android libs to link against.<commit_after>#######################################################
## Library sources

set( INCDIR "../include/pangolin")

## Header only includes / core headers
set(
  HEADERS
  ${INCDIR}/pangolin.h ${INCDIR}/platform.h
  ${INCDIR}/simple_math.h ${INCDIR}/timer.h
  ${INCDIR}/gl.h ${INCDIR}/gldraw.h ${INCDIR}/glvbo.h
  ${INCDIR}/glcuda.h ${INCDIR}/cg.h ${INCDIR}/glsl.h
  ${INCDIR}/image.h
)

## Store list of source files
set( SOURCES "" )

#######################################################
## User build options

option(BUILD_PANGOLIN_GUI "Build support for Pangolin GUI" ON)
if(BUILD_PANGOLIN_GUI)
  list(APPEND HEADERS
    ${INCDIR}/display.h ${INCDIR}/display_internal.h 
    ${INCDIR}/view.h ${INCDIR}/viewport.h
    ${INCDIR}/handler.h ${INCDIR}/opengl_render_state.h
  )
  list(APPEND SOURCES
    display.cpp view.cpp viewport.cpp
    handler.cpp opengl_render_state.cpp
  )
endif()

if(BUILD_PANGOLIN_GUI AND NOT ANDROID)
  list(APPEND HEADERS ${INCDIR}/plotter.h )
  list(APPEND SOURCES plotter.cpp )
endif()

option(BUILD_PANGOLIN_VARS "Build support for Pangolin Vars" ON)
if(BUILD_PANGOLIN_VARS)
  list(APPEND HEADERS ${INCDIR}/vars.h ${INCDIR}/vars_internal.h ${INCDIR}/input_record_repeat.h )
  list(APPEND SOURCES vars.cpp input_record_repeat.cpp )

  if(BUILD_PANGOLIN_GUI AND NOT ANDROID)
      list(APPEND HEADERS ${INCDIR}/widgets.h )
      list(APPEND SOURCES widgets.cpp )
  endif()
endif()

option(BUILD_PANGOLIN_VIDEO "Build support for Pangolin Video Utilities" ON)
if(BUILD_PANGOLIN_VIDEO)
  list(APPEND HEADERS
    ${INCDIR}/threadedfilebuf.h ${INCDIR}/video.h ${INCDIR}/video_common.h
    ${INCDIR}/video_splitter.h ${INCDIR}/video_output.h
    ${INCDIR}/video_recorder.h ${INCDIR}/video_record_repeat.h
    ${INCDIR}/video/pvn_video.h
  )
  list(APPEND SOURCES
    threadedfilebuf.cpp video.cpp video_splitter.cpp video_output.cpp
    video_recorder.cpp video_record_repeat.cpp video/pvn_video.cpp
  )
endif()

#######################################################
## Setup required includes / link info

# Project headers trump everything (including any potentially installed Pangolin)
list(APPEND USER_INC  "${PROJECT_SOURCE_DIR}/include;${CMAKE_CURRENT_BINARY_DIR}/include" )

find_package(Boost COMPONENTS thread filesystem system REQUIRED QUIET)
list(APPEND USER_INC  "${Boost_INCLUDE_DIRS}" )
list(APPEND LINK_LIBS "${Boost_LIBRARIES}" )

if(BUILD_PANGOLIN_GUI)
  if(NOT ANDROID)
      find_package(OpenGL REQUIRED QUIET)
      find_package(GLEW REQUIRED)
      list(APPEND USER_INC  "${OPENGL_INCLUDE_DIR};${GLEW_INCLUDE_DIR}" )
      list(APPEND LINK_LIBS "${OPENGL_LIBRARIES};${GLEW_LIBRARY}" )
  else()
      list(APPEND LINK_LIBS "-lEGL;-lGLESv2;-lGLESv1_CM" )
  endif()
endif()

#######################################################
## Find optional dependencies

find_package(CVARS QUIET)
if(CVARS_FOUND AND NOT ANDROID)
  set(HAVE_CVARS 1)
  list(APPEND USER_INC  ${CVARS_INCLUDE_DIR} )
  list(APPEND LINK_LIBS ${CVARS_LIBRARIES} )
endif()

find_package(CUDA QUIET)
if(CUDA_FOUND)
  set(HAVE_CUDA 1)
  cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)
  set(CUDA_NVCC_FLAGS "-O3" )
  add_definitions(-DCUDA_BUILD)
  message(STATUS "CUDA Found and Enabled")
endif()

find_package(FREEGLUT)
find_package(GLUT)

if(_OSX_)
{'fraction_non_alphanumeric': 0.1780761932564589, 'fraction_numerical': 0.0016056050211647934, 'mean_word_length': 5.470254957507082, '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': '4396141', 'n_tokens_mistral': 2665, 'n_tokens_neox': 2548, 'n_words': 436}