<commit_before>add_definitions(-D_BLD_cdt)

include_directories(.)

add_library(cdt SHARED
    # Header files
    cdt.h
    dthdr.h

    # Source files
    dtclose.c
    dtdisc.c
    dtextract.c
    dtflatten.c
    dthash.c
    dtlist.c
    dtmethod.c
    dtopen.c
    dtrenew.c
    dtrestore.c
    dtsize.c
    dtstat.c
    dtstrhash.c
    dttree.c
    dtview.c
    dtwalk.c

    # Link definition file for Windows
    cdt.def
)

# Installation location of library files
install(
    TARGETS cdt
    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
)

# Installation location of header files
install(
    FILES cdt.h
    DESTINATION ${HEADER_INSTALL_DIR}
)

# Installation location of man page
install(
    FILES cdt.3
    DESTINATION ${MAN_INSTALL_DIR}
)
<commit_msg>Add (so)version specification to cdt CMake build<commit_after>add_definitions(-D_BLD_cdt)

include_directories(.)

add_library(cdt SHARED
    # Header files
    cdt.h
    dthdr.h

    # Source files
    dtclose.c
    dtdisc.c
    dtextract.c
    dtflatten.c
    dthash.c
    dtlist.c
    dtmethod.c
    dtopen.c
    dtrenew.c
    dtrestore.c
    dtsize.c
    dtstat.c
    dtstrhash.c
    dttree.c
    dtview.c
    dtwalk.c

    # Link definition file for Windows
    cdt.def
)

# Installation location of library files
install(
    TARGETS cdt
    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
)

# Specify headers to be installed
install(
    FILES cdt.h
    DESTINATION ${HEADER_INSTALL_DIR}
)

# Specify man pages to be installed
install(
    FILES cdt.3
    DESTINATION ${MAN_INSTALL_DIR}
)

# Specify library version and soversion
set_target_properties(cdt PROPERTIES
    VERSION 5.0.0
    SOVERSION 5
)

{'fraction_non_alphanumeric': 0.0673854447439353, 'fraction_numerical': 0.003234501347708895, 'mean_word_length': 2.7877551020408164, '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': '5358344', 'n_tokens_mistral': 730, 'n_tokens_neox': 689, 'n_words': 156}