<commit_before>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

#-----------------------------------------------------------------------
# CPM configuration
#-----------------------------------------------------------------------
set(CPM_MODULE_NAME gl_batch_testing)
set(CPM_LIB_TARGET_NAME ${CPM_MODULE_NAME})

if ((DEFINED CPM_DIR) AND (DEFINED CPM_UNIQUE_ID) AND (DEFINED CPM_TARGET_NAME))
  set(CPM_LIB_TARGET_NAME ${CPM_TARGET_NAME})
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CPM_DIR})
  include(CPM)
else()
  set(CPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/cpm-packages" CACHE TYPE STRING)
  find_package(Git)
  if(NOT GIT_FOUND)
    message(FATAL_ERROR "CPM requires Git.")
  endif()
  if (NOT EXISTS ${CPM_DIR}/CPM.cmake)
    execute_process(
      COMMAND "${GIT_EXECUTABLE}" clone https://github.com/iauns/cpm ${CPM_DIR}
      RESULT_VARIABLE error_code
      OUTPUT_VARIABLE head_sha)
    if(error_code)
      message(FATAL_ERROR "CPM failed to get the hash for HEAD")
    endif()
  endif()
  include(${CPM_DIR}/CPM.cmake)
endif()

# All externals *must* define this.
CPM_ForceOnlyOneModuleVersion()

# ++ EXTERNAL-MODULE: Google Test
CPM_AddModule("google_test"
  GIT_REPOSITORY "https://github.com/iauns/cpm-google-test"
  GIT_TAG "1.0.0"
  EXPORT_MODULE TRUE
  USE_EXISTING_VER TRUE)

# ++ MODULE: Spire
CPM_AddModule("spire"
  GIT_REPOSITORY "https://github.com/SCIInstitute/spire"
  GIT_TAG "origin/master"
  EXPORT_MODULE TRUE)

# ++ MODULE: GL Batch Context
CPM_AddModule("gl_batch_context"
  GIT_REPOSITORY "https://github.com/iauns/cpm-gl-batch-context.git"
  GIT_TAG "1.1.0")

# ++ MODULE: GL Platform
CPM_AddModule("gl_platform"
  GIT_REPOSITORY "https://github.com/iauns/cpm-gl-platform.git"
  GIT_TAG "1.1.0"
  EXPORT_MODULE TRUE)

# ++ EXTERNAL-MODULE: Lodepng
CPM_AddModule("lodepng"
  GIT_REPOSITORY "https://github.com/iauns/cpm-lodepng.git"
  GIT_TAG "1.0.0")

CPM_InitModule(${CPM_MODULE_NAME})

#-----------------------------------------------------------------------
# Source
#-----------------------------------------------------------------------

# Globbing has some downsides, but the advantages outweigh the
# disadvantages.
file (GLOB Sources
  "batch-testing/*.cpp"
  "batch-testing/*.h"
  )

#-----------------------------------------------------------------------
# Library setup
#-----------------------------------------------------------------------

# Build the library.
add_library(${CPM_LIB_TARGET_NAME} ${Sources})<commit_msg>Working around feature deficiency in CPM.<commit_after>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

#-----------------------------------------------------------------------
# CPM configuration
#-----------------------------------------------------------------------
set(CPM_MODULE_NAME gl_batch_testing)
set(CPM_LIB_TARGET_NAME ${CPM_MODULE_NAME})

if ((DEFINED CPM_DIR) AND (DEFINED CPM_UNIQUE_ID) AND (DEFINED CPM_TARGET_NAME))
  set(CPM_LIB_TARGET_NAME ${CPM_TARGET_NAME})
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CPM_DIR})
  include(CPM)
else()
  set(CPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/cpm-packages" CACHE TYPE STRING)
  find_package(Git)
  if(NOT GIT_FOUND)
    message(FATAL_ERROR "CPM requires Git.")
  endif()
  if (NOT EXISTS ${CPM_DIR}/CPM.cmake)
    execute_process(
      COMMAND "${GIT_EXECUTABLE}" clone https://github.com/iauns/cpm ${CPM_DIR}
      RESULT_VARIABLE error_code
      OUTPUT_VARIABLE head_sha)
    if(error_code)
      message(FATAL_ERROR "CPM failed to get the hash for HEAD")
    endif()
  endif()
  include(${CPM_DIR}/CPM.cmake)
endif()

# All externals *must* define this.
CPM_ForceOnlyOneModuleVersion()

# ++ EXTERNAL-MODULE: Google Test
CPM_AddModule("google_test"
  GIT_REPOSITORY "https://github.com/iauns/cpm-google-test"
  GIT_TAG "1.0.0"
  EXPORT_MODULE TRUE
  USE_EXISTING_VER TRUE)

# ++ MODULE: Spire
CPM_AddModule("spire"
  GIT_REPOSITORY "https://github.com/SCIInstitute/spire"
  GIT_TAG "origin/master"
  EXPORT_MODULE TRUE)

# ++ MODULE: GL Batch Context
CPM_AddModule("gl_batch_context"
  GIT_REPOSITORY "https://github.com/iauns/cpm-gl-batch-context.git"
  GIT_TAG "1.1.0")

# ++ MODULE: GL Platform
CPM_AddModule("gl_platform"
  GIT_REPOSITORY "https://github.com/iauns/cpm-gl-platform.git"
  GIT_TAG "1.1.0"
  EXPORT_MODULE TRUE)

# ++ EXTERNAL-MODULE: Lodepng
CPM_AddModule("lodepng"
  GIT_REPOSITORY "https://github.com/iauns/cpm-lodepng.git"
  GIT_TAG "1.0.0")

# Re-export the GLM module. We expose spire through our public interfaces,
# we also need to expose its module exports (CPM TODO).
# ++ MODULE: GLM
CPM_AddModule("GLM"
  GIT_REPOSITORY "https://github.com/iauns/cpm-glm"
  GIT_TAG "origin/master"
  USE_EXISTING_VER TRUE
  EXPORT_MODULE TRUE    # Use EXPORT_MODULE sparingly. We expose GLM's interface
  )                     # through our own interface hence why we export it.

CPM_InitModule(${CPM_MODULE_NAME})

#-----------------------------------------------------------------------
# Source
#-----------------------------------------------------------------------

# Globbing has some downsides, but the advantages outweigh the
# disadvantages.
file (GLOB Sources
  "batch-testing/*.cpp"
  "batch-testing/*.h"
  )

#-----------------------------------------------------------------------
# Library setup
#-----------------------------------------------------------------------

# Build the library.
add_library(${CPM_LIB_TARGET_NAME} ${Sources})
{'fraction_non_alphanumeric': 0.2602739726027397, 'fraction_numerical': 0.00518326545723806, 'mean_word_length': 2.2864963503649633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, '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': '4574468', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1806, 'n_words': 338}