Skip to content

cariad-tech/fep3_base_utilities

 
 

Repository files navigation

FEP Base Utilities

Description

FEP Base Utilities functionality in a nutshell

FEP Control Tool

Dependencies

  • self-contained package
  • but at build time it depends on FEP System Library and at test time it depends on FEP Participant Library

How to build using only cmake

Prerequisites

  • Download CMake at least in version 3.17.0
  • Using git, clone the repository and checkout the desired branch (e.g. master)
  • Build the dev_essential library as described in the Readme file.
  • Build the fep3_system library as described in the Readme file.
  • Boost in version 1.73, can be compiled from sources or the built binaries can be directly downloaded. For Windows Boost 1.73 can be downloaded, for Linux/Debian distributions apt can be used.

Optional

  • Build the fep3_participant library as described in the Readme file.
  • Gtest version 1.10 or newer.
    • Gtest has to be compiled from sources. After checking out the gtest github repository, run the following commands inside the checked out folder (depending on your compiler or the configuration to be built, the cmake command should be adapted accordingly). After executing the commands, <gtest_install_dir> will contain the built libraries. gtest_force_shared_crt flag is needed for windows in order compile with the correct Windows Runtime Library and avoid linking errors later when building the fep participant library.

    • mkdir build

    • cd build

    • cmake -G "Visual Studio 16 2019" -A x64 -T v142 -DCMAKE_INSTALL_PREFIX=<gtest_install_dir> -Dgtest_force_shared_crt=ON ../

    • cmake --build . --target install --config Release

Build with cmake

  • Run the following command, (adaptations may be needed in case a different Visual Studio version is used or different configuration should be built).

    • cmake.exe -H<root_dir> -B<build_dir> -G "Visual Studio 16 2019" -A x64 -T v142 -DCMAKE_INSTALL_PREFIX=package -Dfep_base_utilities_cmake_enable_tests=False -Dfep3_system_DIR=<fep_system_dir> -Ddev_essential_DIR=<dev_essential_dir>/lib/cmake/dev_essential -DBoost_INCLUDE_DIR=<boost_install_dir>

    • cmake --build . --target install --config Release

    • <root_dir> The path where the fep base utilities library is checked out and the main CMakeLists.txt is located.

    • <build_dir> The build directory

    • <install_dir> Path where the built artifacts will be installed.

    • <dev_essential_dir> The path were the dev_essential library was installed. File dev_essential-config.cmake is located under <dev_essential_dir>/lib/cmake/dev_essential.

    • <fep_system_dir> The path were the fep3_system library was installed. File fep3_system-config.cmake is located in this folder.

    • <boost_install_dir> The installation path of boost, version.hpp is located under <boost_install_dir>/boost.

    Note: The above cmake calls are exemplary for using Windows and Visual Studio as generator. For gcc the addition of -DCMAKE_POSITION_INDEPENDENT_CODE=True is needed. Also depending on the generator used, the --config in the build step could be ignored and the adaptation of CMAKE_CONFIGURATION_TYPES or CMAKE_BUILD_TYPE could be necessary for building in other configurations.

Additional Cmake options

  • Enable tests
    • fep_base_utilities_cmake_enable_tests variable controls the activation of the tests. The variable is set by default to True. For activating this flag, gtest is required.

    • Apart from fep_base_utilities_cmake_enable_tests, the GTest_DIR cmake variable should be set to the path where GTestConfig.cmake is located. Assuming the gtest was followed, this path is <gtest_install_dir>/lib/cmake/GTest.

    • Additionally fep3_participant library should be compiled and the following variables should be set:

      • fep3_participant_cpp_DIR and Dfep3_participant_core_DIR to the installation directory of the library.
    • A call to cmake with these flags could look like:

      • cmake.exe -H<root_dir> -B<build_dir> -G "Visual Studio 16 2019" -A x64 -T v142 -DCMAKE_INSTALL_PREFIX=package -Dfep_base_utilities_cmake_enable_tests=True -Dfep3_system_DIR=<fep_system_dir> -Ddev_essential_DIR=<dev_essential_dir>/lib/cmake/dev_essential -DBoost_INCLUDE_DIR=<boost_install_dir> -Dfep3_participant_core_DIR=<fep3_participant_dir> -Dfep3_participant_cpp_DIR= <fep3_participant_dir> -DGTest_DIR=<gtest_install_dir>\lib\cmake\GTest
      • cmake --build . --target install --config Release

      <fep3_participant_dir> is the installation directory of the fep3_participant library where the files fep3_participant_cpp-config.cmake and fep3_participant_core-config.cmake are located.

Tested compilers

  • Windows 10 x64 with Visual Studio C++ 2019 and v142 Toolset.
  • Linux Ubuntu 18.04 LTS x64 with GCC 7.5 and libstdc++14 (C++14 ABI)

About

No description or website provided.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 75.4%
  • C 19.3%
  • CMake 5.3%