aboutsummaryrefslogtreecommitdiff
path: root/test cases/linuxlike
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-11-27 19:58:04 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2021-12-01 21:03:36 +0200
commit45c5300496486ff9f1f3d47a01cdf19b8fa7e877 (patch)
tree97f3c7c077df90cc60e83ee4e0bf85e5379f9a4e /test cases/linuxlike
parent4f882ff8ec81cbc42b097d3aee8ca4a8013f538b (diff)
downloadmeson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.zip
meson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.tar.gz
meson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.tar.bz2
cmake: Fix old style dependency lookup with imported targets
This also includes some refactoring, since the alternaticve would have been to duplicate the huge traceparser target code block again. fixes #9581
Diffstat (limited to 'test cases/linuxlike')
-rw-r--r--test cases/linuxlike/13 cmake dependency/cmake/FindImportedOldStyle.cmake5
-rw-r--r--test cases/linuxlike/13 cmake dependency/meson.build9
2 files changed, 14 insertions, 0 deletions
diff --git a/test cases/linuxlike/13 cmake dependency/cmake/FindImportedOldStyle.cmake b/test cases/linuxlike/13 cmake dependency/cmake/FindImportedOldStyle.cmake
new file mode 100644
index 0000000..595b887
--- /dev/null
+++ b/test cases/linuxlike/13 cmake dependency/cmake/FindImportedOldStyle.cmake
@@ -0,0 +1,5 @@
+find_package(ZLIB)
+
+set(IMPORTEDOLDSTYLE_LIBRARIES ZLIB::ZLIB)
+set(IMPORTEDOLDSTYLE_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR})
+set(IMPORTEDOLDSTYLE_FOUND ON)
diff --git a/test cases/linuxlike/13 cmake dependency/meson.build b/test cases/linuxlike/13 cmake dependency/meson.build
index 94d07d1..ae4cc42 100644
--- a/test cases/linuxlike/13 cmake dependency/meson.build
+++ b/test cases/linuxlike/13 cmake dependency/meson.build
@@ -58,6 +58,15 @@ depm1 = dependency('SomethingLikeZLIB', required : true, components : 'required_
depm2 = dependency('SomethingLikeZLIB', required : true, components : 'required_comp', method : 'cmake', cmake_module_path : ['cmake'])
depm3 = dependency('SomethingLikeZLIB', required : true, components : ['required_comp'], cmake_module_path : 'cmake')
+
+# Mix of imported targets and old style variables
+
+depio1 = dependency('ImportedOldStyle', required : true, cmake_module_path : 'cmake')
+
+# Try to actually link with depio1, since we are doing even more "fun" stuff there
+exe4 = executable('zlibprog4', 'prog.c', dependencies : depio1)
+test('zlibtest4', exe4)
+
# Test some edge cases with spaces, etc. (but only for CMake >= 3.15)
if cm_vers.version_compare('>=3.15')