diff options
author | Brad King <brad.king@kitware.com> | 2020-05-06 13:27:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-06 13:28:30 (GMT) |
commit | 6ccbf6ba711864d4498b211a58ef8449a4e0fa34 (patch) | |
tree | 1ebc077bd630292d5c17c42e60a6a19cf9d0384d /Tests | |
parent | 4ec59891ade803a3eaf27969e6594236e030c497 (diff) | |
parent | e9d93c37313f49f58b782f50793e0016eae69cf1 (diff) | |
download | CMake-6ccbf6ba711864d4498b211a58ef8449a4e0fa34.zip CMake-6ccbf6ba711864d4498b211a58ef8449a4e0fa34.tar.gz CMake-6ccbf6ba711864d4498b211a58ef8449a4e0fa34.tar.bz2 |
Merge topic 'FindPkgConfig-isystem' into release-3.17
e9d93c3731 Help: Add 3.17 release note for FindPkgConfig '-isystem' fix
dfaaae67a3 Merge branch 'backport-3.16-FindPkgConfig-isystem'
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 62bb5de..d697fc6 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 () |