ADTF
|
CMake is a meta build system that lets you generate native build environments for multiple platforms and compilers with a single configuration. For example, it enables you generate Visual Studio solutions on Windows and Unix Makefile projects on Linux using gcc. This page is intended for introductionary use only. For a complete CMake documentation please visit http://www.cmake.org.
Each CMake project has a CMakeLists.txt file at the root of its directory hierarchy. This file defines the project and contains the necessary instructions to build it. CMake supports both so called out-of-source builds and in-source builds. We discourage the use of the latter since it will clutter your source directory with multiple files. So building a CMake project typically involves three directories:
Building a CMake project requires the following steps to be carried out:
The ADTF SDK is split up into libraries and will be delivered by packages. See Software Development Kit for an overview.
Other than in previous versions of ADTF SDK we will not deliver many CMake macros anymore.
Within ADTF 3.3 the cmake-handling has changed to the Modern
CMake approach. This means that all the provided libraries contain their relevant information. Therefore you do not have to specify the include directories, compiler flags, preprocessor variables or library dependencies manually. Due to this big change, the usage of find_package in combination with ADTF changes significantly.
The new CMake macro ADTFConfig.cmake
will not set any variables.
If you use the ADTF package to build a binary do the following:
With this approach the find_package(ADTF REQUIRED COMPONENTS systemsdk)
automatically enriches the CMake scope with a new target adtf::systemsdk
We recommend using the find_package
(ADTF COMPONENTS pkg-name) approach. The warranty of finding the packages will be higher.
We provide a CMake macro to create own filters. It will link the filter target to the adtf::filtersdk.
Since ADTF Filter Development Package is strictly separated from the ADTF System SDK you need to use and import an additional adtfsystemsdk package if you do ADTF system development.
We provide a CMake macro to create own services. It will automatically link your target against adtf::systemsdk.
ADTF is delivered in both RelWithDebInfo and Debug versions. To enable the build of other CMake configurations (i.e. Release or MinSizeRel) the ADTF CMake config manipulates the CMAKE_MAP_IMPORTED_CONFIG_<Configuration> variables to map the RelWithDebInfo packages to Release and MinSizeRel.
If you do not want this to happen, specify ONLY_RELWITHDEBINFO in the COMPONENTS section of your find_package call: