<commit_before>cmake_minimum_required(VERSION 3.4)
project(hello)

find_package(Threads REQUIRED)

include(ExternalProject)

message("my vars: $ENV{MY_CMAKE} $ENV{MY_CMAKE_GEN}")

## GoogleTest/GoogleMock
ExternalProject_Add(gtest
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest
  GIT_REPOSITORY https://github.com/google/googletest
  CMAKE_COMMAND $ENV{MY_CMAKE}
  CMAKE_GENERATOR $ENV{MY_CMAKE_GEN}
  CMAKE_ARGS -Dgtest_disable_pthreads:BOOL=ON -DCMAKE_CXX_COMPILER=$ENV{CXX_COMPILER} -DCMAKE_C_COMPILER=$ENV{CC_COMPILER}
  INSTALL_COMMAND ""
)
ExternalProject_Get_Property(gtest source_dir binary_dir)

add_library(libgtest IMPORTED STATIC GLOBAL)
add_library(libgmock IMPORTED STATIC GLOBAL)
add_dependencies(libgtest gtest)
add_dependencies(libgmock gtest)

set_target_properties(libgtest PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
)
include_directories("${source_dir}/googletest/include")

set_target_properties(libgmock PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/googlemock/libgmock.a"
)
include_directories("${source_dir}/googlemock/include")

## CryptoPP
ExternalProject_Add(cryptopp
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/cryptopp
  GIT_REPOSITORY https://github.com/weidai11/cryptopp
  CMAKE_COMMAND $ENV{MY_CMAKE}
  CMAKE_GENERATOR $ENV{MY_CMAKE_GEN}
  CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF -DCMAKE_CXX_COMPILER=$ENV{CXX_COMPILER} -DCMAKE_C_COMPILER=$ENV{CC_COMPILER}
  INSTALL_COMMAND ""
)
ExternalProject_Get_Property(cryptopp source_dir binary_dir)

add_library(libcryptopp IMPORTED STATIC GLOBAL)
add_dependencies(libcryptopp cryptopp)

set_target_properties(libcryptopp PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/libcryptopp.a"
)
include_directories("${source_dir}/..")


aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
  libgtest
  libgmock
  libcryptopp
)

SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
SET(GCC_COVERAGE_LINK_FLAGS    "-lgcov")

SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")<commit_msg>add -pthread again<commit_after>cmake_minimum_required(VERSION 3.4)
project(hello)

find_package(Threads REQUIRED)

include(ExternalProject)

message("my vars: $ENV{MY_CMAKE} $ENV{MY_CMAKE_GEN}")

## GoogleTest/GoogleMock
ExternalProject_Add(gtest
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest
  GIT_REPOSITORY https://github.com/google/googletest
  CMAKE_COMMAND $ENV{MY_CMAKE}
  CMAKE_GENERATOR $ENV{MY_CMAKE_GEN}
  CMAKE_ARGS -Dgtest_disable_pthreads:BOOL=ON -DCMAKE_CXX_COMPILER=$ENV{CXX_COMPILER} -DCMAKE_C_COMPILER=$ENV{CC_COMPILER}
  INSTALL_COMMAND ""
)
ExternalProject_Get_Property(gtest source_dir binary_dir)

add_library(libgtest IMPORTED STATIC GLOBAL)
add_library(libgmock IMPORTED STATIC GLOBAL)
add_dependencies(libgtest gtest)
add_dependencies(libgmock gtest)

set_target_properties(libgtest PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
)
include_directories("${source_dir}/googletest/include")

set_target_properties(libgmock PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/googlemock/libgmock.a"
)
include_directories("${source_dir}/googlemock/include")

## CryptoPP
ExternalProject_Add(cryptopp
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/cryptopp
  GIT_REPOSITORY https://github.com/weidai11/cryptopp
  CMAKE_COMMAND $ENV{MY_CMAKE}
  CMAKE_GENERATOR $ENV{MY_CMAKE_GEN}
  CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF -DCMAKE_CXX_COMPILER=$ENV{CXX_COMPILER} -DCMAKE_C_COMPILER=$ENV{CC_COMPILER}
  INSTALL_COMMAND ""
)
ExternalProject_Get_Property(cryptopp source_dir binary_dir)

add_library(libcryptopp IMPORTED STATIC GLOBAL)
add_dependencies(libcryptopp cryptopp)

set_target_properties(libcryptopp PROPERTIES
  "IMPORTED_LOCATION" "${binary_dir}/libcryptopp.a"
)
include_directories("${source_dir}/..")


aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
  libgtest
  libgmock
  libcryptopp
)

SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage -pthread")
SET(GCC_COVERAGE_LINK_FLAGS    "-lgcov")

SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
{'fraction_non_alphanumeric': 0.1036557149467839, 'fraction_numerical': 0.0018509949097639982, 'mean_word_length': 9.391826923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2066550', 'n_tokens_mistral': 1750, 'n_tokens_neox': 1667, 'n_words': 198}