From 7a619fa6fbebdd907815be2d0edaef0184a3ad95 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 14 Mar 2013 21:40:21 +0100 Subject: [PATCH] Fix cmGeneratorExpression::Preprocess for interleaved inputs. We can't find both preprocessing expressions at once, because then the BUILD_INTERFACE will always be favored if both are present, even if INSTALL_INTERFACE appears first. This was affecting the behavior of install(EXPORT) because the INTERFACE_INCLUDE_DIRECTORIES contained entries like /foo/include;$ As the INSTALL_INTERFACE always evaluates to '0', it always needs to be preprocessed properly. --- Source/cmGeneratorExpression.cxx | 24 ++++++++++++++++++++++-- Tests/ExportImport/Export/CMakeLists.txt | 4 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 3f5912919..ab8bd137e 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -236,9 +236,29 @@ static std::string stripExportInterface(const std::string &input, std::string::size_type pos = 0; std::string::size_type lastPos = pos; - while((pos = input.find("$> $> $> + # The BUILD_INTERFACE entry from above is duplicated below. This is to test that + # the INSTALL_INTERFACE entry bound by a BUILD_INTERFACE entry on either side is + # preprocessed correctly on install(EXPORT). + $> # Test that the below is non-fatal $<$:$> )