diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-09-26 11:48:24 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-26 20:33:50 +0300 |
commit | 534e94ffc35dae3a0b2cc9f1e60e7e452872c512 (patch) | |
tree | 1d2b29d71df5338143f781e2bbba33282106151b /test cases/linuxlike | |
parent | fbddeeb4ac1897cf9166317d719ae300178c85b7 (diff) | |
download | meson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.zip meson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.tar.gz meson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.tar.bz2 |
cmake: Support ALIAS libraries
Diffstat (limited to 'test cases/linuxlike')
-rw-r--r-- | test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake | 4 | ||||
-rw-r--r-- | test cases/linuxlike/13 cmake dependency/meson.build | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake b/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake index d65c6fb..753df5b 100644 --- a/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake +++ b/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake @@ -2,12 +2,14 @@ find_package(ZLIB) if(ZLIB_FOUND OR ZLIB_Found) set(ImportedTarget_FOUND ON) - add_library(mesonTestLibDefs UNKNOWN IMPORTED) + add_library(mesonTestLibDefs SHARED IMPORTED) set_property(TARGET mesonTestLibDefs PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARY}) set_property(TARGET mesonTestLibDefs PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIR}) set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS REQUIRED_MESON_FLAG1) set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>) # Error empty string set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS REQUIRED_MESON_FLAG2) + set_target_properties(mesonTestLibDefs PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(MesonTest::TestLibDefs ALIAS mesonTestLibDefs) else() set(ImportedTarget_FOUND OFF) endif() diff --git a/test cases/linuxlike/13 cmake dependency/meson.build b/test cases/linuxlike/13 cmake dependency/meson.build index 411b7a3..7d99764 100644 --- a/test cases/linuxlike/13 cmake dependency/meson.build +++ b/test cases/linuxlike/13 cmake dependency/meson.build @@ -48,9 +48,12 @@ depm3 = dependency('SomethingLikeZLIB', required : true, cmake_module_path : 'cm # Test some edge cases with spaces, etc. -testDep = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs') -testFlagSet = executable('testFlagSet', ['testFlagSet.c'], dependencies: [testDep]) -test('testFlagSetTest', testFlagSet) +testDep1 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs') +testDep2 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules : ['MesonTest::TestLibDefs']) +testFlagSet1 = executable('testFlagSet1', ['testFlagSet.c'], dependencies: [testDep1]) +testFlagSet2 = executable('testFlagSet2', ['testFlagSet.c'], dependencies: [testDep2]) +test('testFlagSetTest1', testFlagSet1) +test('testFlagSetTest2', testFlagSet2) # Try to compile a test that takes a dep and an include_directories |