diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2020-04-30 12:19:04 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2020-05-05 16:30:38 (GMT) |
commit | 4d446c68d10a98a9b790ef75c22ecbcc52351fbc (patch) | |
tree | 4c19b6fa65a31daddd6835655f9a3f8bf8f13a0b /Tests | |
parent | 4c82f309c59d02899145bc25c0e9efc91a6f64ed (diff) | |
download | CMake-4d446c68d10a98a9b790ef75c22ecbcc52351fbc.zip CMake-4d446c68d10a98a9b790ef75c22ecbcc52351fbc.tar.gz CMake-4d446c68d10a98a9b790ef75c22ecbcc52351fbc.tar.bz2 |
FindPkgConfig: also handle "-isystem" prefixes for include directories
Fixes: #20652
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 () |