From 4a82545662d7d9d9b54be7393c382a4d1759daef Mon Sep 17 00:00:00 2001 From: Sebastian Lipponer Date: Tue, 14 Sep 2021 03:59:54 +0200 Subject: libdlt: Add legacy include path in exported CMake config file (#327) Previously the generated .pc file was changed to export an additional include path such that '#include ' and '#include ' can be used. However the exported CMake config file only supports the latter include statement. Consequently code that uses the other legacy include statement does not compile with the exported CMake config file. This change fixes this inconsistency. It lets users compile existing code with either the pkg-config .pc file or the CMake config file and avoids code clutter that is currently necessary to make this work. Signed-off-by: Sebastian Lipponer --- doc/dlt_for_developers.md | 8 ++------ src/lib/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/dlt_for_developers.md b/doc/dlt_for_developers.md index 78c3201..844eb40 100644 --- a/doc/dlt_for_developers.md +++ b/doc/dlt_for_developers.md @@ -24,12 +24,8 @@ within the standard include directory. This example gives an overview of DLT usage inside an application by using a minimal code example. Detailed information about the API can be found later in this document. -Please note that the #include statement depends on the means by which you are -incorporating the DLT library into your project. The `` form (i.e. -with a directory prefix) seen here is necessary when you are using the CMake -Config file (see below). If you are using pkg-config instead, then for -backward-compatibility reasons it is also possible to use `#include `. -This is not recommended for new code, though. +Please note that for backwards compatibility also the legacy #include statement +`` is supported. Using it for new code is not recommended, though. ``` #include diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 5a94bef..acf1587 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -51,6 +51,7 @@ target_include_directories(dlt $ $ $ + $ ) if(WITH_LIB_SHORT_VERSION) -- cgit v1.2.1