tests: skip gtest test if gtest not installed
project('gtest', 'cpp')
-gtest = dependency('gtest', main : true)
+gtest = dependency('gtest', main : true, required : false)
+if not gtest.found()
+ error('MESON_SKIP_TEST: gtest not installed.')
+endif
gtest_nomain = dependency('gtest', main : false)
e = executable('testprog', 'test.cc', dependencies : gtest)
