<commit_before>cmake_minimum_required (VERSION 3.2)

###############################################################################
#
#   MAIN
#
###############################################################################

project (Project VERSION 1.0.0)

if (${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
	message(FATAL_ERROR "In-tree builds are not supported; please run cmake in a separate build directory.")
endif ()

list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules")
list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")

set (CMAKE_DEBUG_POSTFIX "_Debug")

set (TARGET_NAME "${CMAKE_PROJECT_NAME}Targets")
set (CONFIG_FILE "${CMAKE_PROJECT_NAME}-Config.cmake")
set (VERSION_FILE "${CMAKE_PROJECT_NAME}-Config-Version.cmake")
set (TARGET_FILE "${CMAKE_PROJECT_NAME}-Targets.cmake")

set (INCLUDE_INSTALL_DIR "Include")
set (LIBRARY_INSTALL_DIR "Library")
set (BINARY_INSTALL_DIR "Binary")
set (CONFIG_INSTALL_DIR "CMake")

###############################################################################
#
#   EXTERNAL PROJECTS
#
###############################################################################

include (ExternalProject)

set_directory_properties (PROPERTIES EP_BASE "${CMAKE_BINARY_DIR}/Extern")

ExternalProject_Add (
    Docopt

    GIT_REPOSITORY "https://github.com/docopt/docopt.cpp.git"
    GIT_TAG "master"
    
    CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
)

ExternalProject_Get_Property (Docopt SOURCE_DIR)
ExternalProject_Get_Property (Docopt BINARY_DIR)
ExternalProject_Get_Property (Docopt INSTALL_DIR)

file(MAKE_DIRECTORY "${INSTALL_DIR}/include/docopt")

add_library (docopt SHARED IMPORTED)

set_target_properties (docopt PROPERTIES
	IMPORTED_LOCATION "${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}docopt${CMAKE_SHARED_LIBRARY_SUFFIX}"
    IMPORTED_IMPLIB "${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}docopt${CMAKE_STATIC_LIBRARY_SUFFIX}"
    INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/docopt")

ExternalProject_Add (
    Bandit

    GIT_REPOSITORY "https://github.com/banditcpp/bandit.git"
    GIT_TAG "master"
    
    CMAKE_ARGS "-DBANDIT_BUILD_SPECS=0" "-DBANDIT_RUN_SPECS=0"
    
    INSTALL_COMMAND ""
)

ExternalProject_Get_Property (Bandit SOURCE_DIR)

add_library (bandit SHARED IMPORTED)

set_target_properties (bandit PROPERTIES<commit_msg>Set C++ 11 standard for external projects.<commit_after>cmake_minimum_required (VERSION 3.2)

###############################################################################
#
#   MAIN
#
###############################################################################

project (Project VERSION 1.0.0)

if (${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
	message(FATAL_ERROR "In-tree builds are not supported; please run cmake in a separate build directory.")
endif ()

list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules")
list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")

set (CMAKE_DEBUG_POSTFIX "_Debug")

set (TARGET_NAME "${CMAKE_PROJECT_NAME}Targets")
set (CONFIG_FILE "${CMAKE_PROJECT_NAME}-Config.cmake")
set (VERSION_FILE "${CMAKE_PROJECT_NAME}-Config-Version.cmake")
set (TARGET_FILE "${CMAKE_PROJECT_NAME}-Targets.cmake")

set (INCLUDE_INSTALL_DIR "Include")
set (LIBRARY_INSTALL_DIR "Library")
set (BINARY_INSTALL_DIR "Binary")
set (CONFIG_INSTALL_DIR "CMake")

###############################################################################
#
#   EXTERNAL PROJECTS
#
###############################################################################

include (ExternalProject)

set_directory_properties (PROPERTIES EP_BASE "${CMAKE_BINARY_DIR}/Extern")

ExternalProject_Add (
    Docopt

    GIT_REPOSITORY "https://github.com/docopt/docopt.cpp.git"
    GIT_TAG "master"
    
    CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
)

set_property(TARGET Docopt PROPERTY CXX_STANDARD 11)

ExternalProject_Get_Property (Docopt SOURCE_DIR)
ExternalProject_Get_Property (Docopt BINARY_DIR)
ExternalProject_Get_Property (Docopt INSTALL_DIR)

file(MAKE_DIRECTORY "${INSTALL_DIR}/include/docopt")

add_library (docopt SHARED IMPORTED)

set_target_properties (docopt PROPERTIES
	IMPORTED_LOCATION "${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}docopt${CMAKE_SHARED_LIBRARY_SUFFIX}"
    IMPORTED_IMPLIB "${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}docopt${CMAKE_STATIC_LIBRARY_SUFFIX}"
    INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/docopt")

ExternalProject_Add (
    Bandit

    GIT_REPOSITORY "https://github.com/banditcpp/bandit.git"
    GIT_TAG "master"
    
    CMAKE_ARGS "-DBANDIT_BUILD_SPECS=0" "-DBANDIT_RUN_SPECS=0
    
    INSTALL_COMMAND ""
)

set_property(TARGET Bandit PROPERTY CXX_STANDARD 11)

ExternalProject_Get_Property (Bandit SOURCE_DIR)

add_library (bandit SHARED IMPORTED)

set_target_properties (bandit PROPERTIES
{'fraction_non_alphanumeric': 0.22057001239157373, 'fraction_numerical': 0.004130524576621231, 'mean_word_length': 7.8699633699633695, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '293565', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1568, 'n_words': 259}