Commit Graph

212 Commits

Author SHA1 Message Date
Jonny Paton
d53858afb1 Removed incompatible cmake/catch functionality, replaced with vanilla cmake 2019-02-19 10:16:38 +01:00
Jonny Paton
d3a072fb63 Use modern cmake testing functionality including catch integration 2019-02-19 10:16:38 +01:00
Jonny Paton
353c846c87 Update examples for iOS including touch support, proper handling of window resize, launch screens and icons 2019-01-19 01:34:30 +01:00
Ceylo
82c2f4c05e All mobile-compatible examples now successfully link 2019-01-19 01:29:12 +01:00
=
195f5d7409 Removed old android cmake toolchain 2019-01-09 15:22:49 +00:00
Elias Daler
b81de898bf Modify install rpath only if BUILD_SHARED_LIBS is ON 2018-12-03 19:39:19 +01:00
Elias Daler
fbc0f17198 Fix RPATH for installed examples on Linux 2018-12-03 19:39:19 +01:00
Kwasior
43f0292cb8
Fix audio components linking order 2018-08-14 14:59:57 +02:00
Lukas Dürrenberger
9712bb1ec8 Fixed the installation of pkg-config files
* Removed duplicated CMake code
* Made it possible to manually specify the pkg-config path
* Install pkg-config files by default on Linux and BSD systems
2018-08-13 22:46:20 +02:00
Jonny Paton
ac38b17827 Fix config for finding dependencies on iOS 2018-07-28 18:30:25 +02:00
Ceylo
ff011dc51d Modernize iOS toolchain: remove BUILD_ARM64, drop support for Xcode <4.3 and don't pretend defining official CMake variables 2018-06-04 23:22:21 +02:00
James Cowgill
88bb3f89a5 Install CMake config files into lib${LIB_SIFFIX} 2018-05-18 22:05:48 +02:00
Marty E. Plummer
c828314d12 cmake/Macros.cmake: ex:->examples:
vim interprets the # ex: comments as a modeline, which causes editing
this file with vim to throw an error.

Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-05-18 21:50:25 +02:00
Mario Liebisch
2cd4797557 Examples: Set startup folder for debugging in Visual Studio 2018-04-14 11:02:21 +02:00
David Carlier
9da895da8b further changes 2018-04-14 10:14:34 +02:00
David Carlier
4d0d331272 pushing upstream openbsd support from package. 2018-04-14 10:14:34 +02:00
Jonny Paton
7be2111d61 Add iOS demo 2018-03-26 18:42:19 -07:00
Ceylo
09e24adf2e Remove FindSFML.cmake 2018-03-27 00:03:34 +02:00
Ceylo
a94b3e9e24 Add support for SFMLConfig.cmake 2018-03-27 00:03:34 +02:00
Ceylo
ee08e18726 Modernize CMake files 2018-03-27 00:03:34 +02:00
Ceylo
8b7a50a914 Fix CMake warning on macOS since CMake 3.9 2018-03-12 15:09:59 +01:00
Jonny Paton
910458cfb3 Remove references to SIMULATOR64, as 32 bit is no longer available 2018-03-12 15:04:30 +01:00
Jonny Paton
b196aac5c7 Drop 32 bit support on iOS 2018-03-12 15:04:29 +01:00
Jonny Paton
0118776b7e Force correct iOS architecture for cmake 2018-02-25 13:13:52 -08:00
Mario Liebisch
806813e937 Android: Removed custom toolchain file
This commit drops the previous custom CMake toolchain file for Android
in favor of CMake's new built-in toolchain for this (CMake >3.7.2).

This makes building SFML for Android a lot simpler and more straight
forward, working almost as smooth as other platforms.

To configure your build directory, all you have to do is defining just a
few variables the first time you invoke CMake.

**Required Variables**

* `CMAKE_SYSTEM_NAME` must be `Android`, so CMake knows we actually want
  to cross-compile.
* `CMAKE_ANDROID_NDK` must point to the NDK's installation directory,
  e.g. `/usr/android/ndk` or `c:/android/ndk`.

**Recommended Variables**
* `CMAKE_ANDROID_STL_TYPE` defines the STL implementation to be used.
  You should use `c++_shared`, although others might work.

**Optional Variables**
* `CMAKE_SYSTEM_VERSION` can be set to pick a specific SDK version other
  than the latest.
* `CMAKE_ANDROID_ARCH_ABI` defines the target architecture and ABI, for
  example `armeabi` or `armeabi-v7a`.

Based on your system, you might want to enforce a specific generator to
prevent issues, e.g. using `MinGW Makefiles`.
2018-02-11 20:15:54 +01:00
Alexander Weinrauch
0da25a0b87 Added support for the newest NDK version 2018-02-11 20:15:54 +01:00
Maximilian Wagenbach
989367e345 Turned the header image in readme.md into a link.
Updated all links to use https (tested).
2018-02-10 17:12:54 +01:00
Ceylo
511c16329e Use -stdlib=libc++ on macOS 2018-02-10 14:42:51 +01:00
Jonny Paton
d6c6345d4c Don't need to find vorbisfile or vorbisenc on iOS 2018-01-29 17:53:46 +01:00
papychacal
341bc2a130 Added Tagfile generation and finding 2018-01-25 22:00:38 +01:00
Ceylo
ce7ced5488 Replace INSTALL_RESOURCES_DIR option of sfml_add_example() command with RESOURCES_DIR 2018-01-25 00:23:33 +01:00
Ceylo
777ec2c04d Fix launch of Cocoa example due to missing MainMenu.nib in bundle app 2018-01-25 00:23:33 +01:00
Tucker Lein
b6c1acab3c add license to top of toolchain file 2018-01-09 22:06:55 +01:00
tlein
bba5808717 use a toolchain file for iOS instead of setting the necessary CMake variables in SFML 2018-01-09 22:06:55 +01:00
Laurent Gomila
2aa70def6f Removed dependency to libjpeg, stb_image_write now supports writing JPEG files 2017-09-28 19:55:10 +02:00
Rafael Kitover
5fe5e5d6d7 packaging support improvements
This grew out of my work creating an sfml port for macports, but should
be helpful for package maintainers of various distributions:

* add an SFML_USE_SYSTEM_DEPS option to ignore everything in extlibs/
  except for headers/stb_image, and use the system versions

* install pkg-config files if a pkg-config program is found
  and either lib/pkgconfig or libdata/pkgconfig exists under the
  INSTALL_PREFIX, or the SFML_INSTALL_PKGCONFIG_FILES flag is set
  explicitly

* install pkg-config files for static libs too, add the necessary
  Requires.private and Libs.private entries to the .pc files to support
  static linking

* on OS X, honor all INSTALL_NAME and RPATH related cmake variables and
  only set the INSTALL_NAME_DIR to "@rpath" if none of them is set, this
  preserves the default behavior of using @rpath but also allows
  overriding by the usual cmake mechanisms
2017-02-28 10:03:14 +01:00
Mario Liebisch
95828a85a2 Added some simple messaging when trying to build under Cygwin 2016-10-04 09:33:15 +02:00
binary1248
9996b7abb6 Converted Unix Window implementation from XCB back to Xlib. 2016-09-29 09:25:34 +02:00
James Cowgill
e199ef3790 Define SFML_OS_FREEBSD when compiling for kFreeBSD 2016-08-24 14:05:40 +02:00
Manu343726
9558c6d689 Correctly add XCB components if no components are requested
This commit fixes the FindXCB.cmake module for the case no components
are requested. The previous version assigned `XCB_FIND_COMPONENTS`
list to an empty variable name.

I was lucky enough to catch the bug in a corner case where both
`XCB_COMPONENTS` and `XCB_FIND_COMPONENTS` were empty and `set()`
command failed, but note this awesome CMake language supports more annoying
corner cases like `XCB_COMPONENTS` empty and `XCB_FIND_COMPONENTS`
with two elements, which results in the following `set()` invocation:

``` cmake
set(${XCB_FIND_COMPONENTS[0]} ${XCB_FIND_COMPONENTS[1]})
```

So always beware of CMake secret charms...
2016-08-24 14:05:17 +02:00
Mario Liebisch
3a2e176e59 Android: Readded support for libc++ and use it as the standard STL 2016-07-23 14:35:10 +02:00
Mario Liebisch
757094a25b Fixed current Android compilation issues
* Updated the Android toolchain file to support NDKs up to the latest release (r12b; based on https://github.com/gongminmin/android-cmake).
* Fixed missing sRGB extension defines - also SFML once again compiles for older target API levels not having the sRGB extensions (fixes #1079, supersedes #1085).
* Changed SFML's default STL runtime to `stlport_shared`, since `c++_shared` is no longer supported.
2016-07-21 10:42:45 +02:00
Mario Liebisch
ba9383f25e Updated/fixed string comparisons in Config.cmake
SFML so far used `${CMAKE_SYSTEM_NAME} MATCHES "Windows"`. This works, but only because there's a variable `WINDOWS` having the exact same content (`Windows`).

[More information and a similar issue can be found in this SO thread.](http://stackoverflow.com/questions/21995777/cygwins-cmake-does-not-match-for-cmake-system-name)
2016-07-17 20:13:14 +02:00
Andras Kucsma
fb40e7e43f Change comment chars in FindSFML.cmake to # 2016-06-05 00:08:55 +02:00
Jan Haller
77609e166a Added SFML_GENERATE_PDB CMake option; check CMake version dynamically 2016-03-01 17:14:21 +01:00
Jan Haller
2bd897c513 Create and install PDB debug symbols alongside binaries 2016-03-01 17:14:20 +01:00
Lukas Dürrenberger
1217699fe0 Added the missing -s postfix for the RelWithDebInfo config. 2015-12-31 11:13:58 +01:00
Lukas Dürrenberger
6b9781475d Added support for VS 2015. 2015-09-30 08:32:30 +02:00
Alexander Ankudinov
18193a5cde Fix FindSFML.cmake can't find SFML 2.1 2015-08-24 13:36:04 +02:00
dawid-aurobit
7fba68ac52 convert FLAC name to upper case 2015-08-04 09:50:18 +02:00
binary1248
e80bf0ba92 Fix whitespace: Convert tabs to spaces and remove trailing whitespace. 2015-04-15 01:53:43 +02:00
binary1248
3ec672afe9 Removed XCB dependencies (EWMH, ICCCM, Keysyms, Util), added XCB libraries to FindSFML.cmake, fixed checking for X11 library checking for XRandR instead. 2015-04-06 01:06:00 +02:00
Jan Haller
5ce73e9274 FindSFML.cmake: Added missing VorbisEnc dependency 2015-03-31 20:59:22 +02:00
Jan Haller
c0bee34d42 FindSFML.cmake: Ignored environment variables to find library paths
Environment variables (e.g. PATH on Windows) are looked up early by CMake, and libraries found there are prioritized over those in SFML's own folder. To avoid paths to wrong libraries, this commit modifies the CMake find_library() call, such that environment variables are no longer considered as suitable paths.
2015-03-31 20:59:21 +02:00
Lukas Dürrenberger
23cc8cfe3f Only link sfml-main for the GUI examples in release mode. 2015-03-26 10:23:28 +01:00
binary1248
3e397bff4b Replaced GLEW with (a highly customized) loader generated by glLoadGen, restructured GLExtensions.hpp for easier extension bookkeeping, make use of GLEXT definitions in Shader.cpp and Texture.cpp as well, replaced GL_MAX_TEXTURE_COORDS with GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, implemented flags for requesting a debug or core/compatibility profile context, changed the default context version from 2.0 to 2.1. 2015-03-23 16:10:28 +01:00
Lukas Dürrenberger
d53338298a Added the FindFreetype.cmake CMake module, set the minimum require CMake version to 2.8.3 and fixed the paths to the FreeType headers. 2015-03-21 10:30:31 +01:00
Lukas Dürrenberger
bbfa3d5a76 Changed the SOVERSION to major.minor. 2015-03-12 11:06:33 +01:00
Oleh Prypin
01d5d1b463 Replaced non-ASCII symbols with equivalents 2015-03-10 02:04:02 +02:00
Mario Liebisch
f17ea5872b Removed last references to libsndfile 2015-03-04 09:36:24 +01:00
Mario Liebisch
af4dac6fed Marked the FLAC/Vorbis/Ogg variables as advanced 2015-03-04 09:36:23 +01:00
Jonathan De Wachter
3fbfde39a5 Adjusted the new audio backends to compile on Linux 2015-03-04 09:33:06 +01:00
Laurent Gomila
5e0e645f46 Added support for FLAC audio files 2015-03-04 09:33:05 +01:00
Laurent Gomila
f0608eaed8 Redesigned the audio encoding/decoding classes to get rid of libsndfile 2015-03-04 09:33:03 +01:00
Mario Liebisch
34692d5a39 Android: Updated the toolchain file and CMake scripts
* Replaced the toolchain file with a new version based on [zuhowei's fork](https://github.com/zhuowei/android-cmake), which enables x64 builds as well as support for the latest NDK. This breaks compatibility with old build directories.
* Removed the STL dependency from **sfml-activity** rather than relying on *some* implementation implicitly linked by default.
* Deleted *project.properties*, which wasn't supposed to be part of the repository code. You have to use the Android SDK to recreate it (`android update project --path to/your/example --target 1 --name SFML-Example`).
* Made it possible to select a STL implementation to be used (default: `c++_shared`). Keep in mind that not all available configurations are necessarily compatible with SFML.
* Fixed linker flags to be compatible with Nvidia's Nsight Tegra for Visual Studio.
* It is now possible to compile the Android version using Nvidia's Nsight Tegra for Visual Studio (requires up-to-date CMake and `CMAKE_SFML_SYSTEM` to be set to `Android`; keep in mind that this is still experimental and requires further CMake updates).
* Updated and renamed some Android specific CMake variables.
* Made `armeabi-v7a` the default ABI for Android builds.
2015-03-04 09:05:22 +01:00
Mark Dresselhaus
66f38262f7 Fixed missing pthread dependency
The find script fails to add pthread to the SFML_SYSTEM_DEPENDENCIES when linking SFML statically on Linux.
2015-02-10 23:35:07 +01:00
Lukas W
135c1716e8 Replaced Xlib by XCB implementation.
* Added FindXCB.cmake script
* Added AutoPointer wrapper for automatically free'ing pointers
* Huge commit: Ported linux implementation of sfml-window to xcb
* Xcb is now used for window creation, event loop etc
* As GLX is linked to Xlib, that part of the implementation
  still uses Xlib.
* Also, some keyboard related (such as XLookupString) stuff
  is still Xlib, as xcb does not have it (yet?).
* Replaced some enums with the xcb equivalents
2014-12-29 08:59:20 +01:00
Danijar Hafner
f44c903e56 Hide CMake success message in quiet mode 2014-12-21 12:50:55 +01:00
Lukas Dürrenberger
1c46ec7c37 Updated the version to 2.2, added support for patch versions and added the changelog.txt 2014-12-04 16:09:54 +01:00
Lukas Dürrenberger
45810a1345 Fixed additional comments and documention spelling mistakes. 2014-11-18 01:02:07 +01:00
Lukas Dürrenberger
e257909a65 Fixes CMake issues with udev (#734) 2014-11-10 14:45:50 +01:00
Mario Liebisch
1271dff960 Reworked the UDev inclusion
* This fixes `SFML_DEPENDENCIES` missing the UDev library for static builds (issue #728).
2014-11-06 08:36:27 +01:00
Marco Antognini
ba1488ec97 Improve flexibility of dependencies locations on OS X
- Replaced @executable_path by @rpath for more flexibility
 - Updated freetype and sndfile libs as follow:

    install_name_tool -id "@rpath/../Frameworks/freetype.framework/Versions/A/freetype" freetype
    install_name_tool -id "@rpath/../Frameworks/sndfile.framework/Versions/A/sndfile" sndfile
2014-10-07 10:46:05 +02:00
Stefan Schindler
f24ca9a840 Source code changes.
* Changed newlines to \n.
* Removed whitespace before colons.
* Fixed several alignments.
2014-10-06 01:18:47 +02:00
Marco Antognini
2427aaf3bb Added support for OS X 10.10
Note: this only fix the compilation process. SFML was not thoroughly
tested on this OS yet.
2014-09-21 07:39:05 +02:00
binary1248
c37e442cee Fixed FindSFML.cmake not updating library entries when the user changes the value of SFML_STATIC_LIBRARIES after the initial configure (#637). 2014-08-26 08:27:33 +02:00
Laurent Gomila
83e019e7d3 Fixed order of dependent libraries (SFML_DEPENDENCIES variable) in FindSFML.cmake 2014-07-26 21:01:17 +02:00
Marco Antognini
b9f5f19f7c Reverted OS X implementation to non-ARC
* Apparently, there were some leaks not reported as such
 * Support for 32 bits computer is restored
 * Fix memory leak in sfStringToNSString (related to #484)
 * Unapply context when closing the window, freeing memory

The following commits are related to ARC modifications:

 * 42f6e83dfb
 * 6edc4b9518
 * f6c94451fb
 * 324d4a18e7
 * 0d47056132

Commit ac28902b57 is the last one before the introduction of ARC.
2014-05-23 09:52:17 +02:00
Laurent Gomila
a8ab8fb061 Removed unused duplicate code 2014-05-22 22:53:20 +02:00
Marco Antognini
1ce8a42954 Merge pull request #548 from jdpage/master
Adjust CMake module to provide correct deps on OSX
2014-04-23 11:08:19 +02:00
Jonathan De Wachter
76fddc0729 [Android] The armeabi version of SFML is now built by default (the example as well) 2014-04-20 12:58:41 +02:00
Mario Liebisch
84bd8c6c5b Fixed several issues
- Cmake errored out due to the ANDROID_NDK_* variables being used before being set/detected for the first time.
- Fixed one warning regarding one string replace in CMake.
- Fixed warnings when compiling SFML-Activity.
2014-04-20 12:58:37 +02:00
Jonathan De Wachter
75ddae7e90 [Android] Updated the Android CMake toolchain to use libc++ instead of stlport
Warning: I kept the same variable name because this file will be rewritten fairly soon since most of its code no longer applies to SFML and becomes incorrect (too hard to maintain).
Thus stlport variable names refers to libc++ stuff. E.g: ANDROID_USE_STLPORT=1 turns the use of libc++ on.
2014-04-20 12:58:35 +02:00
Jonathan De Wachter
45f23cdbbb Made the OpenGL ES implementation available on ARM-based Linux OSes 2014-04-20 12:58:00 +02:00
Laurent Gomila
d40399e431 Fixed the INSTALL_MISC_DIR CMake variable not defined on iOS 2014-04-20 12:57:55 +02:00
Jonathan De Wachter
663dad18f2 [Android] Fixed compilation issue and enabled audio module for mips arches 2014-04-20 12:57:14 +02:00
Jonathan De Wachter
bc46dfb8f5 [Android] Various adjustements 2014-04-20 12:57:11 +02:00
Jonathan De Wachter
f60ab60263 Added SFML_OS_ prefix to IOS and ANDROID variables 2014-04-20 12:57:02 +02:00
Jonathan De Wachter
cc0d982f72 [Android] Wrote a native activity acting as a bootstrap
A current limitation prevents one library from depending on shared libraries.
As we have legal issues here (LGPL wants us to use shared libs of OpenAL-Soft and libsndfile), we're forced to use this homemade native activity which will manually load our shared libraries.
2014-04-20 12:56:42 +02:00
Jonathan De Wachter
60894d1c1a [Android] Rewrote CMake scripts to compile SFML with our new toolchain 2014-04-20 12:56:40 +02:00
Jonathan De Wachter
f9e80e1a3b [Android] Updated the Android CMake toolchain to support NDK r9
It brings support for 64-bits toolchains.
2014-04-20 12:53:40 +02:00
Jonathan De Wachter
b167c7a8d5 [Android] Replaced our homemade Android CMake toolchain with the one used for the OpenCV project
http://code.google.com/p/android-cmake/
2014-04-20 12:53:38 +02:00
Laurent Gomila
c35b48bcea [iOS] Removed support for examples, it was too much trouble and not as robust as true iOS App Xcode projects 2014-04-20 12:53:22 +02:00
Laurent Gomila
3872b27569 Reworked the sfml-main module, added Main.hpp, moved the main() internal entry point for iOS from sfml-window to sfml-main 2014-04-20 12:53:17 +02:00
Laurent Gomila
b9fd685a60 [iOS] Made the build independent of the iOS framework version 2014-04-20 12:53:15 +02:00
Laurent Gomila
4bd1a66915 Removed a copy of the sfml_add_example CMake macro, which was duplicated by accident in the big Android commit 2014-04-20 12:53:12 +02:00
Laurent Gomila
239921b456 [iOS] Improved support for examples, removed the need for a toolchain file 2014-04-20 12:53:04 +02:00
Laurent Gomila
4e8e1629d1 Adapted the examples for iOS (WIP) 2014-04-20 12:52:10 +02:00
Jonathan De Wachter
63bbe2c91e Added the Android port 2014-04-20 12:52:04 +02:00
Laurent Gomila
e20ff86330 [iOS] Adjusted the code and build files to use Automatic Reference Counting 2014-04-20 12:48:04 +02:00