Skip to content

Tutorial: Simplify logic checking for cmath functions

Brad King requested to merge brad.king/cmake:tutorial-cmath into master

Since !4375 (merged) the logic does not work on non-Windows platforms when cmake is re-run on an existing build tree. It is also more complicated than we'd like for a tutorial example. Avoid the need to consider the m library case by performing the check as C++.

Since check_cxx_symbol_exists cannot handle overloaded functions like exp and log, check with check_cxx_source_compiles instead. This also presents a more general-purpose example in the tutorial.

Fixes: #23524 (closed)
Backport: release

Merge request reports