Reputation: 2458
In my meson.build there is a line
cmake = import('cmake')
which returns a CMake module object. How can I determine whether CMake is actually available?
I would like to do something like
if not cmake.found()
# Do something without the cmake module.
endif
Upvotes: 1
Views: 155
Reputation: 10997
You can try using find_program function:
cmake_bin = find_program('cmake', required: false)
if not cmake_bin.found()
# Do something without the cmake module.
else
cmake = import('cmake')
...
endif
Upvotes: 1