Skip to content
Snippets Groups Projects
Forked from CMake / CMake
Source project has a limited visibility.
  • Brad King's avatar
    5c84eca2
    Tutorial: Simplify logic checking for cmath functions · 5c84eca2
    Brad King authored
    Since commit 07223c5c (Tutorial: Update Step 5 to work on Windows,
    2020-02-18, v3.18.0-rc1~655^2) 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
    5c84eca2
    History
    Tutorial: Simplify logic checking for cmath functions
    Brad King authored
    Since commit 07223c5c (Tutorial: Update Step 5 to work on Windows,
    2020-02-18, v3.18.0-rc1~655^2) 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