<commit_before>#
# Sets Forge installation paths.
#

# NOTE: These paths are all relative to the project installation prefix.

# Executables
if(NOT DEFINED FG_INSTALL_BIN_DIR)
    set(FG_INSTALL_BIN_DIR "bin" CACHE PATH "Installation path for executables")
endif()

# Libraries
if(NOT DEFINED FG_INSTALL_LIB_DIR)
    set(FG_INSTALL_LIB_DIR "lib" CACHE PATH "Installation path for libraries")
endif()

# Header files
if(NOT DEFINED FG_INSTALL_INC_DIR)
    set(FG_INSTALL_INC_DIR "include" CACHE PATH "Installation path for headers")
endif()

# Data files
if(NOT DEFINED FG_INSTALL_DATA_DIR)
    set(FG_INSTALL_DATA_DIR "share/Forge" CACHE PATH "Installation path for data files")
endif()

# Documentation
if(NOT DEFINED FG_INSTALL_DOC_DIR)
    set(FG_INSTALL_DOC_DIR "${FG_INSTALL_DATA_DIR}/doc" CACHE PATH "Installation path for documentation")
endif()

if(NOT DEFINED FG_INSTALL_EXAMPLE_DIR)
    set(FG_INSTALL_EXAMPLE_DIR "${FG_INSTALL_DATA_DIR}/examples" CACHE PATH "Installation path for examples")
endif()

# Man pages
if(NOT DEFINED FG_INSTALL_MAN_DIR)
    set(FG_INSTALL_MAN_DIR "${FG_INSTALL_DATA_DIR}/man" CACHE PATH "Installation path for man pages")
endif()

# CMake files
if(NOT DEFINED FG_INSTALL_CMAKE_DIR)
    set(FG_INSTALL_CMAKE_DIR "${FG_INSTALL_DATA_DIR}/cmake" CACHE PATH "Installation path for CMake files")
endif()

foreach(p BIN LIB INC DATA DOC EXAMPLE MAN CMAKE)
    set(var FG_INSTALL_${p}_DIR)
    if(NOT IS_ABSOLUTE "${${var}}")
      set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
    endif()
endforeach()<commit_msg>Allow cmake to accept relative path for install_prefix<commit_after>#
# Sets Forge installation paths.
#

# NOTE: These paths are all relative to the project installation prefix.

# Executables
if(NOT DEFINED FG_INSTALL_BIN_DIR)
    set(FG_INSTALL_BIN_DIR "bin" CACHE PATH "Installation path for executables")
endif()

# Libraries
if(NOT DEFINED FG_INSTALL_LIB_DIR)
    set(FG_INSTALL_LIB_DIR "lib" CACHE PATH "Installation path for libraries")
endif()

# Header files
if(NOT DEFINED FG_INSTALL_INC_DIR)
    set(FG_INSTALL_INC_DIR "include" CACHE PATH "Installation path for headers")
endif()

# Data files
if(NOT DEFINED FG_INSTALL_DATA_DIR)
    set(FG_INSTALL_DATA_DIR "share/Forge" CACHE PATH "Installation path for data files")
endif()

# Documentation
if(NOT DEFINED FG_INSTALL_DOC_DIR)
    set(FG_INSTALL_DOC_DIR "${FG_INSTALL_DATA_DIR}/doc" CACHE PATH "Installation path for documentation")
endif()

if(NOT DEFINED FG_INSTALL_EXAMPLE_DIR)
    set(FG_INSTALL_EXAMPLE_DIR "${FG_INSTALL_DATA_DIR}/examples" CACHE PATH "Installation path for examples")
endif()

# Man pages
if(NOT DEFINED FG_INSTALL_MAN_DIR)
    set(FG_INSTALL_MAN_DIR "${FG_INSTALL_DATA_DIR}/man" CACHE PATH "Installation path for man pages")
endif()

# CMake files
if(NOT DEFINED FG_INSTALL_CMAKE_DIR)
    set(FG_INSTALL_CMAKE_DIR "${FG_INSTALL_DATA_DIR}/cmake" CACHE PATH "Installation path for CMake files")
endif()

# Use absolute paths (these changes are internal and will not show up in cache)
# The cache will continue to show relative/absolute paths as used without modifications
# This is required for configure_package_config_file in CMakeLists.txt

# CMAKE_INSTALL_PREFIX
# If this is relative, it is relative to CMAKE_BINARY_DIR
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX})
    get_filename_component(CMAKE_INSTALL_PREFIX
                           "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}"
                           ABSOLUTE)
endif()

# FG_INSTALL_*_DIR
foreach(p BIN LIB INC DATA DOC EXAMPLE MAN CMAKE)
    set(var FG_INSTALL_${p}_DIR)
    if(NOT IS_ABSOLUTE "${${var}}")
      set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
    endif()
endforeach()
{'fraction_non_alphanumeric': 0.09061313076505698, 'fraction_numerical': 0.0, 'mean_word_length': 5.468421052631579, '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': '6322093', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1236, 'n_words': 345}