<commit_before>project(libcsync)

add_subdirectory(std)

find_package(Sqlite3 REQUIRED)
find_package(Iniparser REQUIRED)
find_package(Dlfcn REQUIRED)

set(CSYNC_PUBLIC_INCLUDE_DIRS
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}
  CACHE INTERNAL "csync public include directories"
)

set(CSYNC_PRIVATE_INCLUDE_DIRS
  ${DLFCN_INCLUDE_DIRS}
  ${INIPARSER_INCLUDE_DIRS}
  ${LOG4C_INCLUDE_DIRS}
  ${SQLITE3_INCLUDE_DIRS}
  ${CSTDLIB_PUBLIC_INCLUDE_DIRS}
  ${CMAKE_BINARY_DIR}
)

set(CSYNC_LIBRARY
  csync
  CACHE INTERNAL "csync library"
)

set(CSYNC_LINK_LIBRARIES
  ${CSYNC_LIBRARY}
  ${CSTDLIB_LIBRARY}
  ${DLFCN_LIBRARIES}
  ${INIPARSER_LIBRARIES}
  ${LOG4C_LIBRARIES}
  ${SQLITE3_LIBRARIES}
)

set(csync_SRCS
  csync.c
  csync_config.c
  csync_exclude.c
  csync_journal.c
  csync_lock.c
  csync_time.c
  csync_util.c
  csync_update.c

  vio/csync_vio.c
  vio/csync_vio_handle.c
  vio/csync_vio_file_stat.c
  vio/csync_vio_local.c
)

set(csync_HDRS
  csync.h
)

include_directories(
  ${CSYNC_PUBLIC_INCLUDE_DIRS}
  ${CSYNC_PRIVATE_INCLUDE_DIRS}
)

add_library(${CSYNC_LIBRARY} SHARED ${csync_SRCS})

target_link_libraries(${CSYNC_LINK_LIBRARIES})

set_target_properties(
  ${CSYNC_LIBRARY}
    PROPERTIES
      VERSION
        0.1.0
      SOVERSION
        0
)

INSTALL(
  TARGETS
    ${CSYNC_LIBRARY}<commit_msg>Install needed header files.<commit_after>project(libcsync)

add_subdirectory(std)

find_package(Sqlite3 REQUIRED)
find_package(Iniparser REQUIRED)
find_package(Dlfcn REQUIRED)

set(CSYNC_PUBLIC_INCLUDE_DIRS
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}
  CACHE INTERNAL "csync public include directories"
)

set(CSYNC_PRIVATE_INCLUDE_DIRS
  ${DLFCN_INCLUDE_DIRS}
  ${INIPARSER_INCLUDE_DIRS}
  ${LOG4C_INCLUDE_DIRS}
  ${SQLITE3_INCLUDE_DIRS}
  ${CSTDLIB_PUBLIC_INCLUDE_DIRS}
  ${CMAKE_BINARY_DIR}
)

set(CSYNC_LIBRARY
  csync
  CACHE INTERNAL "csync library"
)

set(CSYNC_LINK_LIBRARIES
  ${CSYNC_LIBRARY}
  ${CSTDLIB_LIBRARY}
  ${DLFCN_LIBRARIES}
  ${INIPARSER_LIBRARIES}
  ${LOG4C_LIBRARIES}
  ${SQLITE3_LIBRARIES}
)

set(csync_SRCS
  csync.c
  csync_config.c
  csync_exclude.c
  csync_journal.c
  csync_lock.c
  csync_time.c
  csync_util.c
  csync_update.c

  vio/csync_vio.c
  vio/csync_vio_handle.c
  vio/csync_vio_file_stat.c
  vio/csync_vio_local.c
)

set(csync_HDRS
  csync.h
  vio/csync_vio.h
  vio/csync_vio_file_stat.h
  vio/csync_vio_handle.h
  vio/csync_vio_method.h
  vio/csync_vio_module.h
)

include_directories(
  ${CSYNC_PUBLIC_INCLUDE_DIRS}
  ${CSYNC_PRIVATE_INCLUDE_DIRS}
)

add_library(${CSYNC_LIBRARY} SHARED ${csync_SRCS})

target_link_libraries(${CSYNC_LINK_LIBRARIES})

set_target_properties(
  ${CSYNC_LIBRARY}
    PROPERTIES
      VERSION
        0.1.0
      SOVERSION
        0
)

INSTALL(
  TARGETS
    ${CSYNC_LIBRARY}
{'fraction_non_alphanumeric': 0.09054834054834054, 'fraction_numerical': 0.006493506493506494, 'mean_word_length': 5.081140350877193, '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': '2926548', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1280, 'n_words': 145}