<commit_before>include (GenerateExportHeader)

include_directories(../deps/darts-clone)
include_directories(../deps/rapidjson-0.11)
include_directories(../deps/tclap-1.2.1)

# Library

set(
  LIBOPENCC_HEADERS
  BinaryDict.hpp
  Common.hpp
  Config.hpp
  Conversion.hpp
  ConversionChain.hpp
  Converter.hpp
  DartsDict.hpp
  Dict.hpp
  DictEntry.hpp
  DictGroup.hpp
  Exception.hpp
  Export.hpp
  Lexicon.hpp
  MaxMatchSegmentation.hpp
  Optional.hpp
  PhraseExtract.hpp
  Segmentation.hpp
  Segments.hpp
  SerializableDict.hpp
  SimpleConverter.hpp
  TextDict.hpp
  UTF8StringSlice.hpp
  UTF8Util.hpp
  opencc.h
)

set(
  LIBOPENCC_SOURCES
  BinaryDict.cpp
  Config.cpp
  Conversion.cpp
  ConversionChain.cpp
  Converter.cpp
  DartsDict.cpp
  Dict.cpp
  DictEntry.cpp
  DictGroup.cpp
  MaxMatchSegmentation.cpp
  PhraseExtract.cpp
  SimpleConverter.cpp
  Segmentation.cpp
  TextDict.cpp
  UTF8StringSlice.cpp
  UTF8Util.cpp
)

add_library(libopencc ${LIBOPENCC_SOURCES})

GENERATE_EXPORT_HEADER(
  libopencc
  BASE_NAME OPENCC
  EXPORT_MACRO_NAME OPENCC_EXPORT
  EXPORT_FILE_NAME Opencc_Export.h
  STATIC_DEFINE Opencc_BUILT_AS_STATIC
)

set_target_properties(
  libopencc
  PROPERTIES
    LINKER_LANGUAGE<commit_msg>Also include headers in project source, it's useful to edit code in an IDE.<commit_after>include (GenerateExportHeader)

include_directories(../deps/darts-clone)
include_directories(../deps/rapidjson-0.11)
include_directories(../deps/tclap-1.2.1)

# Library

set(
  LIBOPENCC_HEADERS
  BinaryDict.hpp
  Common.hpp
  Config.hpp
  Conversion.hpp
  ConversionChain.hpp
  Converter.hpp
  DartsDict.hpp
  Dict.hpp
  DictEntry.hpp
  DictGroup.hpp
  Exception.hpp
  Export.hpp
  Lexicon.hpp
  MaxMatchSegmentation.hpp
  Optional.hpp
  PhraseExtract.hpp
  Segmentation.hpp
  Segments.hpp
  SerializableDict.hpp
  SimpleConverter.hpp
  TextDict.hpp
  UTF8StringSlice.hpp
  UTF8Util.hpp
  opencc.h
)

set(
  LIBOPENCC_SOURCES
  BinaryDict.cpp
  Config.cpp
  Conversion.cpp
  ConversionChain.cpp
  Converter.cpp
  DartsDict.cpp
  Dict.cpp
  DictEntry.cpp
  DictGroup.cpp
  MaxMatchSegmentation.cpp
  PhraseExtract.cpp
  SimpleConverter.cpp
  Segmentation.cpp
  TextDict.cpp
  UTF8StringSlice.cpp
  UTF8Util.cpp
)

add_library(libopencc ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
source_group(libopencc FILES ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})

GENERATE_EXPORT_HEADER(
  libopencc
  BASE_NAME OPENCC
  EXPORT_MACRO_NAME OPENCC_EXPORT
  EXPORT_FILE_NAME Opencc_Export.h
  STATIC_DEFINE Opencc_BUILT_AS_STATIC
)

set_target_properties(
  libopencc
  PROPERTIES
    LINKER_LANGUAGE
{'fraction_non_alphanumeric': 0.06941766293868107, 'fraction_numerical': 0.007713073659853451, 'mean_word_length': 4.251012145748988, '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': '3348875', 'n_tokens_mistral': 1027, 'n_tokens_neox': 959, 'n_words': 149}