Unit tests for the square root of "-25" currently fail when USE_MYMATH
is disabled. The "mysqrt" method in the tutorials, returns "0" for a
negative value, while "sqrt" returns "NaN", and therefore the output is
not accepted by the test.
This patch checks if the number is negative and eventually returns "0"
before calling "sqrt" or "mysqrt" to fix this issue.
Printing a NaN might cause issues with the string catched by the tests
on some platform. Therefore assume that "0" is correct and "fix" the
USE_MYMATH=OFF version by checking if the number is negative and
eventually returning "0" before calling "sqrt" or "mysqrt".
With CMAKE_C_COMPILER=clang and CMAKE_C_FLAGS='-Wall -Werror', this test
breaks with -Werror,-Wuninitialized. Fix this by getting rid of the
temporary variable.
Remove use of an old hack that takes advantage of the auto-dereference
behavior of the if() command to detect if a variable is defined. The
hack has the form:
if("${VAR} MATCHES "^${VAR}$")
where "${VAR}" is a macro argument reference. Use if(DEFINED) instead.
This also avoids warnings for CMake Policy CMP0054.
Re-apply change from commit v2.8.0~1683 (add initial support for HAIKU
OS, 2008-09-15) on updated upstream curl. However, leave out the part
that was reverted by commit v3.0.0-rc1~541^2~1 (Haiku: Remove outdated
preprocessor checks, 2013-10-05).
We imported curl from an upstream release, so report the corresponding
release version to servers. This is consistent with the version we
presented when our builtin curl was 7.16.1.
Remove our curl CMake build files since upstream now provides some.
After merging the upstream versions we may then port them to build
inside CMake and take code from our old build files as needed.
Use the '-s ours' merge strategy to keep our side unchanged.
This merge brings in the upstream snapshot as of the version
of curl on which our source is based. This will allow new
snapshots to be merged with our changes.
When we explain in add_definitions documentation that it is intended
only for preprocessor definitions, link to add_compile_options for
adding other flags. Also explicitly mention that the order of
add_definitions calls with respect to target creation does not matter.
This differs from the behavior now explicitly stated in the
documentation of add_compile_options.
The value must be either a full path or relative to the configuration
directory, not relative to the 'static' directory. Use a full path.
This avoids a warning:
WARNING: favicon file 'cmake-favicon.ico' does not exist
It worked before because all 'static' directory content is copied to the
'_static' directory of html output anyway.
Explain that it affects only targets added after the call. Fix the link
to the COMPILE_OPTIONS directory propert documentation. Update the
latter to explain that it is used to initialize the corresponding target
property when a target is created.
Convert ExternalProject module documentation to use explicit markup
blocks for each command. Enumerate command options with definition
lists instead of a literal block. This will allow more detail to be
added later. Also fix the logic that parses options out of the
documentation to be aware of the new layout.
Use a bracket comment to hold the documentation instead of a block of
line comments. This will make further updates easier. Also fix the
logic that parses options out of the documentation to be aware of the
new layout.