From 82104ef5becc2a61ff64355ca5202a4a9bc20d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 4 Nov 2020 18:12:30 +0100 Subject: [PATCH] Add workaround for broken gpsim includes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c6003b0..c57f627 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -53,6 +53,21 @@ if( NOT WITH_GPSIM ) ##### check for gpsim version + if( EXISTS ${GPSIM_INCLUDE_DIRS}/gpsim/breakpoints.h ) + file( STRINGS ${GPSIM_INCLUDE_DIRS}/gpsim/breakpoints.h + GPSIM_BROKEN_INCLUDE + REGEX "^#include \"../config.h" ) + if( NOT "${GPSIM_BROKEN_INCLUDE}" STREQUAL "" ) + message( STATUS "Create fake config.h, due to broken gpsim includes" ) + list( APPEND CMAKE_REQUIRED_INCLUDES "${CMAKE_BINARY_DIR}/CMakeFiles" ) + list( APPEND GPSIM_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/src" ) + if( NOT EXISTS "${CMAKE_BINARY_DIR}/config.h" ) + file( WRITE "${CMAKE_BINARY_DIR}/config.h" + "/* fake config.h - due to broken gpsim includes */" ) + endif() + endif() + endif() + check_cxx_source_compiles( " #include #include