<commit_before>cmake_minimum_required(VERSION 3.1)
project(TPM2_PK11 LANGUAGES C)
include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake)

find_package(PkgConfig REQUIRED)
pkg_check_modules(P11_KIT REQUIRED p11-kit-1)
pkg_check_modules(SAPI REQUIRED sapi)
pkg_check_modules(TCTI_SOCKET tcti-socket)
pkg_check_modules(TCTI_DEVICE tcti-device)
pkg_check_modules(TCTI_TABRMD tcti-tabrmd)

if(NOT TCTI_SOCKET_FOUND AND NOT TCTI_DEVICE_FOUND AND NOT TCTI_TABRMD_FOUND)
  message(FATAL_ERROR "At least one connection type must be enabled")
endif()

aux_source_directory(./src SRC_LIST)

add_library(tpm2-pk11 SHARED ${SRC_LIST})
set_property(TARGET tpm2-pk11 PROPERTY C_STANDARD 11)
target_include_directories(tpm2-pk11 PRIVATE ${P11_KIT_INCLUDE_DIRS} ${SAPI_INCLUDE_DIRS} ${TCTI_SOCKET_INCLUDE_DIRS} ${TCTI_DEVICE_INCLUDE_DIRS} ${TCTI_TABRMD_INCLUDE_DIRS})
target_link_libraries(tpm2-pk11 ${P11_KIT_LIBRARIES} ${SAPI_LIBRARIES} ${TCTI_SOCKET_LIBRARIES} ${TCTI_DEVICE_LIBRARIES} ${TCTI_TABRMD_LIBRARIES})
if(TCTI_SOCKET_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_SOCKET_ENABLED=1)
endif()
if(TCTI_DEVICE_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_DEVICE_ENABLED=1)
endif()
if(TCTI_TABRMD_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_TABRMD_ENABLED=1)
endif()

install(TARGETS tpm2-pk11 DESTINATION ${CMAKE_INSTALL_LIBDIR})<commit_msg>CMakeList.txt: Require 2.x branch of tpm2-tss<commit_after>cmake_minimum_required(VERSION 3.1)
project(TPM2_PK11 LANGUAGES C)
include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake)

find_package(PkgConfig REQUIRED)
pkg_check_modules(P11_KIT REQUIRED p11-kit-1)
pkg_check_modules(SAPI REQUIRED sapi>=2.0)
pkg_check_modules(TCTI_SOCKET tcti-socket>=2.0)
pkg_check_modules(TCTI_DEVICE tcti-device>=2.0)
pkg_check_modules(TCTI_TABRMD tcti-tabrmd)

if(NOT TCTI_SOCKET_FOUND AND NOT TCTI_DEVICE_FOUND AND NOT TCTI_TABRMD_FOUND)
  message(FATAL_ERROR "At least one connection type must be enabled")
endif()

aux_source_directory(./src SRC_LIST)

add_library(tpm2-pk11 SHARED ${SRC_LIST})
set_property(TARGET tpm2-pk11 PROPERTY C_STANDARD 11)
target_include_directories(tpm2-pk11 PRIVATE ${P11_KIT_INCLUDE_DIRS} ${SAPI_INCLUDE_DIRS} ${TCTI_SOCKET_INCLUDE_DIRS} ${TCTI_DEVICE_INCLUDE_DIRS} ${TCTI_TABRMD_INCLUDE_DIRS})
target_link_libraries(tpm2-pk11 ${P11_KIT_LIBRARIES} ${SAPI_LIBRARIES} ${TCTI_SOCKET_LIBRARIES} ${TCTI_DEVICE_LIBRARIES} ${TCTI_TABRMD_LIBRARIES})
if(TCTI_SOCKET_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_SOCKET_ENABLED=1)
endif()
if(TCTI_DEVICE_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_DEVICE_ENABLED=1)
endif()
if(TCTI_TABRMD_FOUND)
  target_compile_definitions(tpm2-pk11 PUBLIC TCTI_TABRMD_ENABLED=1)
endif()

install(TARGETS tpm2-pk11 DESTINATION ${CMAKE_INSTALL_LIBDIR})
{'fraction_non_alphanumeric': 0.09097446961524631, 'fraction_numerical': 0.03380079108234448, 'mean_word_length': 10.88888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3252171', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1195, 'n_words': 164}