Commit Graph

12 Commits

Author SHA1 Message Date
Chris Thrasher
ab109cd3cd Use ON and OFF for CMake booleans
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.
2024-09-11 14:36:13 -06:00
Chris Thrasher
7d095c8b6e Clarify instructions for how to use SFML_ROOT
SFML_ROOT can simply point to the directory in which SFML was installed.
This is verified by our install interface tests which do exactly that,
even when SFML is built as a framework. CMake can figure out where
to find the config module if you give it this much information.
2024-01-20 18:48:53 -07:00
Chris Thrasher
30a986e632
Use CMake-standard <PackageName>_ROOT variable to locating config module
https://cmake.org/cmake/help/v3.22/command/find_package.html
https://cmake.org/cmake/help/v3.22/variable/PackageName_ROOT.html#variable:%3CPackageName%3E_ROOT

SFML_DIR predates the existence of <PackageName>_ROOT which is now
the preferred way to specify where to find a given package's config
module. User reports have shown that SFML_DIR may be broken at least
in certain circumstances so lets stop mentioning it.
2024-01-16 13:10:58 -07:00
Lukas Dürrenberger
48fde44047 Merge branch '2.6.x' into master 2023-06-21 13:31:16 +02:00
Lukas Dürrenberger
f47403ab4d Update version number to 2.6.0 2023-06-20 23:44:57 +02:00
Vittorio Romeo
753644a5bd Fix CMake formatting inconsistencies 2022-10-06 20:33:40 +02:00
friendlyanon
9b3735c05f Honor OPTIONAL_COMPONENTS when finding SFML
The "main" component is not available everywhere, but passing it to the
find_package(SFML) call via the OPTIONAL_COMPONENTS still fails the call
on platforms like Linux.

This commit enables SFML to be used the same in a cross-platform fashion
without forcing consumers to put custom logic around importing SFML.
Example that works with this commit, but break before:

    find_package(SFML REQUIRED graphics OPTIONAL_COMPONENTS main)
    target_link_libraries(dummy PRIVATE SFML::graphics)
    if(SFML_MAIN_FOUND)
      target_link_libraries(dummy PRIVATE SFML::main)
    endif()
2022-03-29 00:30:04 +02:00
Chris Thrasher
a322d18e63 Use built-in CMake project version functionality 2022-01-21 21:09:20 +01:00
Chris Thrasher
4586db91a9 Add SFML:: namespace to targets
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.
2022-01-11 22:27:39 +01:00
Lukas Dürrenberger
1aa2b7cd0d Update SFML version to 3.0.0
Unlike with SFML 2.x and earlier the version numbers are updated as soon
as work on the new release starts. This especially helps with version
checks, which until now caused issues with in-development version
matching the previous release.
2021-12-02 20:02:15 +01:00
kimci86
80c3bdc23c Fix CMake scripts to install and find doxygen's generated SFML.tag file 2019-11-19 09:26:49 +01:00
Ceylo
a94b3e9e24 Add support for SFMLConfig.cmake 2018-03-27 00:03:34 +02:00