Tests for determining which of two options hold should not report failure
(Edited following comment.)
Some commonly-used FindXYZ modules perform certain tests to determine whether the system is configured this way or the other. For example, FindLibDL
checks whether you need an underscore for the dynamic loading library. If you use FindLibDL
, you get (on a typical Linux system):
-- Performing Test LIBDL_NEEDS_UNDERSCORE
-- Performing Test LIBDL_NEEDS_UNDERSCORE - Failed
The thing is, the test didn't "fail", it's just that its answer was "no" rather than "yes".
I'm not sure if CMake is to blame, but - these Find modules should not be presenting such test outcomes as failures; and I'm guessing maybe CMake's facility for performing these checks encourages this behavior. To clarify, I mean that I should be seeing something like:
-- Performing Check LIBDL_NEEDS_UNDERSCORE
-- Performing Check LIBDL_NEEDS_UNDERSCORE - No
or
-- Performing Check LIBDL_NEEDS_UNDERSCORE
-- Performing Check LIBDL_NEEDS_UNDERSCORE - Underscore not needed
etc. it should be possible to specify what the outcomes are named (both for binary and non-binary tests).
I'm using CMake 3.5.1 in case it matters.