CMake supports a number of strings for truthy and falsey values.
ON/OFF and TRUE/FALSE are the most popular but 1/0 is also supported.
This is mostly a style choice but I'm inclined to believe that ON/OFF
is the most popular option and I'm generally in favor of style
choices that better align with the community at large.
Similar renaming for Font::loadFromMemory and Font::loadFromStream.
The goal is to better express the need to keep the source available,
similar to Music::openFromFile for example.
This is the warning I got when building this locally
ld: warning: ignoring duplicate libraries: 'lib/libsfml-graphics-s-d.a', 'lib/libsfml-system-s-d.a', 'lib/libsfml-window-s-d.a'
In a few places I left references to the old name where appropriate.
There are also many CMake references to "OSX" that we have to keep
using since CMake does not offer alternative names for those variables
and target properties.
Within files that are only compiled on Apple platforms, we don't
need that redundant check for __APPLE__ so that got removed. Further,
Clang will recognize GCC pragmas so we don't need both Clang AND GCC
pragmas so I removed the Clang pragmas.
Currently GCC fails to compile this code but if one day in the future
that gets fixed, the deprecation warnings will continue to get ignored.
CMake doesn't require absolute paths so we can safely remove
SRCROOT and let implicit relative pathing achieve the same result
with less work on our part.
This removes the sfml- prefixed targets from the export set. The sfml-
prefixed targets are still available within the build tree but not to
downstream users thus making this an API breaking change when compared
to the 2.x releases. To keep things consistent, usage of the sfml-
targets were replaced with their namespaced counterparts.
This has a number of benefits:
1. It's more idiomatic. Modern CMake libraries are expected to
have namespaced targets.
2. Namespaced targets are less likely to collide with user-defined
targets. No one will accidentally define a SFML:: target.
3. If a namespaced target is not found by CMake, configuration
will immediately stop.