<commit_before>.. _customization-top:

=============
Customization
=============

This section describes how to use BDE Build System with external
projects.

.. _customization-1:

Overview
--------

BDE build system allow clients to customize processing at any level of the BDE
repository structure - package groups, packages (including standalones and
thirdparty) - without any changes in the build system itself.

The build system also desinged with the concepts of "layer". The layer is
responsible to handle a specific set of functionality within the build system.

For example, the ``ufid`` layer handles all logic for ``UFID`` processing -
mapping the flags supplied in the ufid to internal CMake build types, build 
flags, the installation ufid-qualified naming scheme. The layer can be
changed to support different ways of passing build configuration.

The ``base`` layer is responsible for core processing the :ref:`BDE-style
repositories <bde_repo-top>` - parsing directory structure, detecting and
loading customization files, parsing ``.mem`` and ``..dep`` files, creating low
level system targets, tests discovery and dependency resolution.

How to enable BDE build system for your project
-----------------------------------------------

To enable BDE build system for a repository that follows the :ref:`BDE-style
repositories <bde_repo-top>` structure, add the ``project.cmake`` and
``CmakeLists.txt`` files with the following content into top level or your
repository:

  .. code-block:: cmake

     # project.cmake
     include(legacy/wafstyleout)
     include(layers/package_libs)
     include(layers/ufid)
     include(layers/install_pkg_config)
     include(layers/install_cmake_config) 

  .. code-block:: cmake

     # CmakeLists.txt
     cmake_minimum_required(VERSION 3.8)

     get_filename_component(repoName ${CMAKE_CURRENT_LIST_DIR} NAME)

     project(${repoName})

     include(bde_workspace)

     bde_process_workspace(
         ${CMAKE_CURRENT_LIST_DIR}
     )

  .. note::
     Sample ``CmakeLists.txt`` and ``project.cmake`` files can be found <commit_msg>Update customization.rst<commit_after>.. _customization-top:

=============
Customization
=============

This section describes how to use BDE Build System with external
projects.

.. _customization-1:

Overview
--------

BDE build system allow clients to customize processing at any level of the BDE
repository structure - package groups, packages (including standalones and
thirdparty) - without any changes in the build system itself.

The build system also desinged with the concepts of "layer". The layer is
responsible to handle a specific set of functionality within the build system.

For example, the ``ufid`` layer handles all logic for ``UFID`` processing -
mapping the flags supplied in the ufid to internal CMake build types, build 
flags, the installation ufid-qualified naming scheme. The layer can be
changed to support different ways of passing build configuration.

The ``base`` layer is responsible for core processing the :ref:`BDE-style
repositories <bde_repo-top>` - parsing directory structure, detecting and
loading customization files, parsing ``.mem`` and ``..dep`` files, creating low
level system targets, tests discovery and dependency resolution.

How to enable BDE build system for your project
-----------------------------------------------

To enable BDE build system for a repository that follows the :ref:`BDE-style
repositories <bde_repo-top>` structure, add the ``project.cmake`` and
``CmakeLists.txt`` files with the following content into top level or your
repository:

  .. code-block:: cmake

     # project.cmake
     include(legacy/wafstyleout)
     include(layers/package_libs)
     include(layers/ufid)
     include(layers/install_pkg_config)
     include(layers/install_cmake_config) 

  .. code-block:: cmake

     # CmakeLists.txt
     cmake_minimum_required(VERSION 3.15)

     get_filename_component(repoName ${CMAKE_CURRENT_LIST_DIR} NAME)

     project(${repoName})

     include(bde_workspace)

     bde_process_workspace(
         ${CMAKE_CURRENT_LIST_DIR}
     )

  .. note::
     Sample ``CmakeLists.txt`` and ``project.cmake`` files can be found 
{'fraction_non_alphanumeric': 0.10986653956148713, 'fraction_numerical': 0.0016682554814108675, 'mean_word_length': 3.7423728813559323, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7037724', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1091, 'n_words': 441}