1From 84dea8284c521f08508bb2dcbc99db3b5d3438fd Mon Sep 17 00:00:00 2001
2From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
3Date: Thu, 27 Aug 2020 17:32:09 +0200
4Subject: [PATCH] gnuradio-runtime_pmt: dont hardcode
5 INTERFACE_INCLUDE_DIRECTORIES
6
7gnuradio-runtimeTargets.cmake and gnuradio-pmtTargets.cmake are filled
8using CMAKE_INSTALL_PREFIX for INSTALL_INTERFACE.
9
10Since CMAKE_INSTALL_PREFIX, in buildroot, is set to /usr, these files contains
11path to host system.
12
13With BR2_COMPILER_PARANOID_UNSAFE_PATH package using gnuradio fails with:
14arm-linux-gnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '-isystem' '/usr/include'
15
16By simply providing 'include', produced .cmake contains:
17INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
18instead of
19INTERFACE_INCLUDE_DIRECTORIES "/usr/include"
20
21[Upstream status: https://github.com/gnuradio/gnuradio/pull/3737]
22
23Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
24---
25 gnuradio-runtime/lib/CMakeLists.txt     | 2 +-
26 gnuradio-runtime/lib/pmt/CMakeLists.txt | 2 +-
27 2 files changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
30index 5aa90a5e1..fc32f473b 100644
31--- a/gnuradio-runtime/lib/CMakeLists.txt
32+++ b/gnuradio-runtime/lib/CMakeLists.txt
33@@ -214,7 +214,7 @@ target_link_libraries(gnuradio-runtime PUBLIC
34
35 target_include_directories(gnuradio-runtime
36   PUBLIC
37-    $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
38+    $<INSTALL_INTERFACE:include>
39     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
40     $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
41   PRIVATE
42diff --git a/gnuradio-runtime/lib/pmt/CMakeLists.txt b/gnuradio-runtime/lib/pmt/CMakeLists.txt
43index 9fb98d0fc..6dfcd945c 100644
44--- a/gnuradio-runtime/lib/pmt/CMakeLists.txt
45+++ b/gnuradio-runtime/lib/pmt/CMakeLists.txt
46@@ -33,7 +33,7 @@ target_link_libraries(gnuradio-pmt
47
48 target_include_directories(gnuradio-pmt
49   PUBLIC
50-  $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
51+  $<INSTALL_INTERFACE:include>
52   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
53   PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/
54   )
55--
562.26.2
57
58