diff options
author | Brad King <brad.king@kitware.com> | 2020-05-06 13:27:29 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-06 09:28:30 -0400 |
commit | 1aecbda7566ace8650f51f25d7afd338c4a0d14e (patch) | |
tree | 25b7f6b31b4003717727201a2dab064b1dbe2755 /Tests | |
parent | 84c49ff5d18ceadaacffac2c06d8d6c29319f999 (diff) | |
parent | 502e562940322243c4b16688a45b056119bef72f (diff) | |
download | cmake-1aecbda7566ace8650f51f25d7afd338c4a0d14e.tar.gz |
Merge topic 'FindPkgConfig-isystem'
502e562940 Merge branch 'backport-3.17-FindPkgConfig-isystem' into FindPkgConfig-isystem
e9d93c3731 Help: Add 3.17 release note for FindPkgConfig '-isystem' fix
dfaaae67a3 Merge branch 'backport-3.16-FindPkgConfig-isystem'
cd31a8acef FindPkgConfig: also handle "-isystem" prefixes for include directories
4d446c68d1 FindPkgConfig: also handle "-isystem" prefixes for include directories
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4693
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake index 62bb5de771..d697fc6778 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake @@ -99,6 +99,7 @@ file(WRITE ${fakePkgDir}/lib/pkgconfig/${pname}.pc Description: Dummy package for FindPkgConfig IMPORTED_TARGET INTERFACE_LINK_OPTIONS test Version: 1.2.3 Libs: -e dummy_main +Cflags: -I/special -isystem /other -isystem/more -DA-isystem/foo ") set(expected_link_options -e dummy_main) @@ -109,7 +110,26 @@ endif() get_target_property(link_options PkgConfig::FakeLinkOptionsPackage INTERFACE_LINK_OPTIONS) if (NOT link_options STREQUAL expected_link_options) message(FATAL_ERROR - "Additional link options not present in INTERFACE_LINK_OPTIONS property" + "Additional link options not present in INTERFACE_LINK_OPTIONS property\n" "expected: \"${expected_link_options}\", but got \"${link_options}\"" ) endif() + +get_target_property(inc_dirs PkgConfig::FakeLinkOptionsPackage INTERFACE_INCLUDE_DIRECTORIES) +set(expected_inc_dirs "/special" "/other" "/more") + +if (NOT inc_dirs STREQUAL expected_inc_dirs) + message(FATAL_ERROR + "Additional include directories not correctly present in INTERFACE_INCLUDE_DIRECTORIES property\n" + "expected: \"${expected_inc_dirs}\", got \"${inc_dirs}\"" + ) +endif () + +get_target_property(c_opts PkgConfig::FakeLinkOptionsPackage INTERFACE_COMPILE_OPTIONS) +set(expected_c_opts "-DA-isystem/foo") # this is an invalid option, but a good testcase +if (NOT c_opts STREQUAL expected_c_opts) + message(FATAL_ERROR + "Additional compile options not present in INTERFACE_COMPILE_OPTIONS property\n" + "expected: \"${expected_c_opts}\", got \"${c_opts}\"" + ) +endif () |