<commit_before>include(ExternalProject)

macro(import_target tname tdep tinclude tpath)
  add_library(${tname} STATIC IMPORTED GLOBAL)
  add_dependencies(${tname} ${tdep})
  set_target_properties(${tname} PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${tinclude}"
    IMPORTED_LOCATION "${tpath}"
  )
endmacro()

################################################################################
## ETCD
################################################################################

if (GO_FOUND)
  if (MSVC)
    set (ETCD_BUILD_COMMAND build.bat)
  else()
    set (ETCD_BUILD_COMMAND ./build)
  endif()
  ExternalProject_Add(etcd_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/etcd
    CONFIGURE_COMMAND ""
    BUILD_IN_SOURCE TRUE
    BUILD_COMMAND "${ETCD_BUILD_COMMAND}"
    INSTALL_COMMAND "")
endif()

################################################################################
## ZLIB
################################################################################

if (UNIX)
  ExternalProject_Add(zlib_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.7
    BUILD_IN_SOURCE 1
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/zlib
    CONFIGURE_COMMAND ./configure CC=${CMAKE_C_COMPILER} --prefix=${CMAKE_CURRENT_BINARY_DIR}/zlib --static
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    )  
endif()

import_target(zlib zlib_build
  "${CMAKE_CURRENT_SOURCE_DIR}/libev"
  "${CMAKE_CURRENT_SOURCE_DIR}/libev/.libs/libev.a"
)

################################################################################
## EV
################################################################################

if (UNIX)
  ExternalProject_Add(ev_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libev
    BUILD_IN_SOURCE 1
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libev
    CONFIGURE_COMMAND ./configure CC=${CMAKE_C_COMPILER} --prefix=${CMAKE_CURRENT_BINARY_DIR}/libev --enable-static --disable-shared
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    )  
endif()

import_target(ev ev_build
  "${CMAKE_CURRENT_SOURCE_DIR}/libev"
  "${CMAKE_CURRENT_SOURCE_DIR}/libev/.libs/libev.a"
)

################################################################################
## V8 and ICU
################################################################################

if(UNIX)
  set(V8_DIR "${CMAKE_CURRENT_SOURCE_DIR}/V8-4.3.61")<commit_msg>moved CC in front of configure<commit_after>include(ExternalProject)

macro(import_target tname tdep tinclude tpath)
  add_library(${tname} STATIC IMPORTED GLOBAL)
  add_dependencies(${tname} ${tdep})
  set_target_properties(${tname} PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${tinclude}"
    IMPORTED_LOCATION "${tpath}"
  )
endmacro()

################################################################################
## ETCD
################################################################################

if (GO_FOUND)
  if (MSVC)
    set (ETCD_BUILD_COMMAND build.bat)
  else()
    set (ETCD_BUILD_COMMAND ./build)
  endif()
  ExternalProject_Add(etcd_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/etcd
    CONFIGURE_COMMAND ""
    BUILD_IN_SOURCE TRUE
    BUILD_COMMAND "${ETCD_BUILD_COMMAND}"
    INSTALL_COMMAND "")
endif()

################################################################################
## ZLIB
################################################################################

if (UNIX)
  ExternalProject_Add(zlib_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.7
    BUILD_IN_SOURCE 1
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/zlib
    CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/zlib --static
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    )  
endif()

import_target(zlib zlib_build
  "${CMAKE_CURRENT_SOURCE_DIR}/libev"
  "${CMAKE_CURRENT_SOURCE_DIR}/libev/.libs/libev.a"
)

################################################################################
## EV
################################################################################

if (UNIX)
  ExternalProject_Add(ev_build
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libev
    BUILD_IN_SOURCE 1
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libev
    CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libev --enable-static --disable-shared
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    )  
endif()

import_target(ev ev_build
  "${CMAKE_CURRENT_SOURCE_DIR}/libev"
  "${CMAKE_CURRENT_SOURCE_DIR}/libev/.libs/libev.a"
)

################################################################################
## V8 and ICU
################################################################################

if(UNIX)
  set(V8_DIR "${CMAKE_CURRENT_SOURCE_DIR}/V8-4.3.61")
{'fraction_non_alphanumeric': 0.3589304812834225, 'fraction_numerical': 0.0051336898395721925, 'mean_word_length': 6.793333333333333, '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': '4001830', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1342, 'n_words': 190}