diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..0fbd9e45 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,54 @@ +Thanks for raising your issue here! 🙂 + +Before you submit the issue however, we'd like you to consider the follow points. + +* We like to use the issue tracker for confirmed issues. +* If you're stuck with SFML, please use [the forum](https://en.sfml-dev.org/forums/index.php#c3) to get help. + +---- + +## Subject of the issue + +Describe your issue here. + +## Your environment + +* Your OS / distro / window manager used +* Your version of SFML (2.5.0, git master, etc) +* Your compiler and compiler version used +* Special compiler flags used + +## Steps to reproduce + +Tell us how to reproduce this issue. Please provide a [minimal, complete and verifiable example](https://stackoverflow.com/help/mcve), you can use the follow template as a start: + +```cpp +#include + +int main() +{ + sf::RenderWindow window(sf::VideoMode(1280, 720), "Minimal, complete and verifiable example"); + window.setFramerateLimit(60); + + while (window.isOpen()) + { + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) + window.close(); + } + + window.clear(); + window.display(); + } +} +``` + +## Expected behavior + +Tell us what should happen + +## Actual behavior + +Tell us what happens instead diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..92a926d5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,51 @@ +Thanks a lot for making a contribution to SFML! 🙂 + +Before you create the pull request, we ask you to check the follow boxes. (For small changes not everything needs to ticked, but the more the better!) + +* [ ] Has this change been discussed on [the forum](https://en.sfml-dev.org/forums/index.php#c3) or in an issue before? +* [ ] Does the code follow the SFML [Code Style Guide](https://www.sfml-dev.org/style.php)? +* [ ] Have you provided some example/test code for your changes? +* [ ] If you have additional steps which need to be performed list them as tasks! + +---- + +## Description + +Please describe your pull request. + +This PR is related to the issue # + +## Tasks + +* [ ] Tested on Linux +* [ ] Tested on Windows +* [ ] Tested on macOS +* [ ] Tested on iOS +* [ ] Tested on Android + +## How to test this PR? + +Describe how to best test these changes. Please provide a [minimal, complete and verifiable example](https://stackoverflow.com/help/mcve) if possible, you can use the follow template as a start: + +```cpp +#include + +int main() +{ + sf::RenderWindow window(sf::VideoMode(1280, 720), "Minimal, complete and verifiable example"); + window.setFramerateLimit(60); + + while (window.isOpen()) + { + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) + window.close(); + } + + window.clear(); + window.display(); + } +} +``` \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..cd0ee3d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + name: ${{ matrix.platform.name }} ${{ matrix.config.name }} + runs-on: ${{ matrix.platform.os }} + + strategy: + matrix: + platform: + - { name: Windows VS2017, os: windows-2016 } + - { name: Windows VS2019, os: windows-latest } + - { name: Linux GCC, os: ubuntu-latest } + - { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } + - { name: MacOS XCode, os: macos-latest } + config: + - { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE } + - { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } + + include: + - platform: { name: MacOS XCode, os: macos-latest } + config: { name: Frameworks, flags: -DSFML_BUILD_FRAMEWORKS=TRUE } + - platform: { name: MacOS XCode, os: macos-latest } + config: { name: iOS, flags: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/toolchains/iOS.toolchain.cmake -DIOS_PLATFORM=SIMULATOR } + - platform: { name: Android, os: ubuntu-latest } + config: { name: x86, flags: -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r18b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 } + - platform: { name: Android, os: ubuntu-latest } + config: { name: armeabi-v7a, flags: -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r18b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 } + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Linux Dependencies + if: runner.os == 'Linux' + run: sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev + + + - name: Install Android Components + if: matrix.platform.name == 'Android' + run: | + echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "cmake;3.10.2.4988404" --sdk_root=ANDROID_SDK_ROOT + sudo ln -sf /usr/local/lib/android/sdk/cmake/3.10.2.4988404/bin/cmake /usr/bin/cmake + wget -nv https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip -P $GITHUB_WORKSPACE + unzip -qq -d $GITHUB_WORKSPACE android-ndk-r18b-linux-x86_64.zip + + + - name: Configure CMake + shell: bash + run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DSFML_BUILD_TEST_SUITE=TRUE ${{matrix.platform.flags}} ${{matrix.config.flags}} + + - name: Build + shell: bash + run: cmake --build $GITHUB_WORKSPACE/build --config Release --target install diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..953ae090 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,134 @@ +language: cpp + +addons: + apt_packages: + - cmake + - libxrandr-dev + - libxcursor-dev + - libudev-dev + - libopenal-dev + - libflac-dev + - libvorbis-dev + - g++ + - clang + - libgl1-mesa-dev + +before_script: +- mkdir build && cd build +- cmake .. $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX=../install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON + +script: +- cmake --build . --target install + +matrix: + include: + + - name: "Linux gcc Dynamic" + os: linux + dist: xenial + compiler: gcc + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "Linux gcc Static" + os: linux + dist: xenial + compiler: gcc + env: + - CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "Linux clang Dynamic" + os: linux + dist: xenial + compiler: clang + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "Linux clang Static" + os: linux + dist: xenial + compiler: clang + env: + - CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "macOS Xcode 10 Dynamic" + os: osx + osx_image: xcode10 + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "macOS Xcode 10 Frameworks" + os: osx + osx_image: xcode10 + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE -DSFML_BUILD_FRAMEWORKS=TRUE" + + - name: "macOS Xcode 10 Static" + os: osx + osx_image: xcode10 + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE -DBUILD_SHARED_LIBS=FALSE" + + - name: "iOS Xcode 10" + os: osx + osx_image: xcode10 + env: + - CMAKE_FLAGS="-GXcode -DSFML_BUILD_TEST_SUITE=TRUE -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/iOS.toolchain.cmake -DIOS_PLATFORM=SIMULATOR" + + - name: "Visual Studio 15 2017 Dynamic" + os: windows + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=FALSE" + + - name: "Visual Studio 15 2017 Static" + os: windows + env: + - CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE" + + - name: "Visual Studio 16 2019 Dynamic" + os: windows + env: + - CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=FALSE" + - MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" + - VS160COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools" + - PATH=$MSBUILD_PATH:$PATH + install: + - choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + - choco install visualstudio2019-workload-nativedesktop + + - name: "Visual Studio 16 2019 Static" + os: windows + env: + - CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE" + - MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" + - VS160COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools" + - PATH=$MSBUILD_PATH:$PATH + install: + - choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + - choco install visualstudio2019-workload-nativedesktop + + - name: "Android armeabi-v7a" + language: android + android: &androidComponents + components: + - tools + - platform-tools + - build-tools-26.0.1 + env: + - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" + + install: &androidInstall + - echo y | sdkmanager "cmake;3.10.2.4988404" + - sudo ln -sf /usr/local/android-sdk/cmake/3.10.2.4988404/bin/cmake /usr/bin/cmake + - wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip + - unzip -qq android-ndk-r18b-linux-x86_64.zip + + - name: "Android x86" + language: android + android: *androidComponents + env: + - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" + install: *androidInstall + +notifications: + email: false diff --git a/CMakeLists.txt b/CMakeLists.txt index c8521005..63ab622e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,9 @@ -cmake_minimum_required(VERSION 2.8.3) +# CMake's built-in Android support requires 3.7.0 +if(CMAKE_SYSTEM_NAME MATCHES "Android") + cmake_minimum_required(VERSION 3.7.2) +else() + cmake_minimum_required(VERSION 3.0.2) +endif() # define a macro that helps defining an option macro(sfml_set_option var default type docstring) @@ -13,22 +18,27 @@ endmacro() # determine whether to create a debug or release build sfml_set_option(CMAKE_BUILD_TYPE Release STRING "Choose the type of build (Debug or Release)") -# set Android specific options +# Suppress Cygwin legacy warning +set(CMAKE_LEGACY_CYGWIN_WIN32 0) -# define the minimum API level to be used -sfml_set_option(ANDROID_API_MIN 9 STRING "Choose the Android API level to be used (minimum 9)") -# mirror the setting for the toolchain file -set(ANDROID_NATIVE_API_LEVEL ${ANDROID_API_MIN}) +# Suppress Mac OS X RPATH warnings and adopt new related behaviors +cmake_policy(SET CMP0042 NEW) +if (NOT CMAKE_VERSION VERSION_LESS 3.9) + cmake_policy(SET CMP0068 NEW) +endif() -# define the path to the Android NDK -sfml_set_option(ANDROID_NDK "$ENV{ANDROID_NDK}" PATH "Path to the Android NDK") - -# define the STL implementation to be used -sfml_set_option(ANDROID_STL c++_shared STRING "Choose the STL implementation to be used (experimental)") - -# default the ABI to ARM v7a for hardware floating point -if(NOT ANDROID_ABI) - set(ANDROID_ABI armeabi-v7a) +# add some default value for some additional macOS variable +# note that those variables are ignored on other systems +if(NOT CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "macOS architecture to build; 64-bit is expected" FORCE) +endif() +if(NOT CMAKE_OSX_SYSROOT) + # query the path to the default SDK, will fail on non-macOS, but it's okay. + execute_process(COMMAND xcodebuild -sdk macosx -version Path + COMMAND head -n 1 + COMMAND tr -d '\n' + OUTPUT_VARIABLE CMAKE_OSX_SYSROOT + ERROR_QUIET) endif() # project name @@ -37,13 +47,15 @@ project(SFML) # include the configuration file include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake) +# we use the paths from the cmake GNUInstallDirs module as defaults +# you can override these if you like +# https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html +include(GNUInstallDirs) + # setup version numbers set(VERSION_MAJOR 2) -set(VERSION_MINOR 3) -set(VERSION_PATCH 2) - -# add the SFML header path -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +set(VERSION_MINOR 5) +set(VERSION_PATCH 1) # add an option for choosing the build type (shared or static) if(NOT (SFML_OS_IOS OR SFML_OS_ANDROID)) @@ -57,39 +69,51 @@ else() endif() # add an option for building the examples -if(NOT (SFML_OS_IOS OR SFML_OS_ANDROID)) +if(NOT SFML_OS_ANDROID) sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples, FALSE to ignore them") else() set(SFML_BUILD_EXAMPLES FALSE) endif() +# add options to select which modules to build +sfml_set_option(SFML_BUILD_WINDOW TRUE BOOL "TRUE to build SFML's Window module. This setting is ignored, if the graphics module is built.") +sfml_set_option(SFML_BUILD_GRAPHICS TRUE BOOL "TRUE to build SFML's Graphics module.") +sfml_set_option(SFML_BUILD_AUDIO TRUE BOOL "TRUE to build SFML's Audio module.") +sfml_set_option(SFML_BUILD_NETWORK TRUE BOOL "TRUE to build SFML's Network module.") + # add an option for building the API documentation sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") # add an option for choosing the OpenGL implementation -sfml_set_option(SFML_OPENGL_ES ${OPENGL_ES} BOOL "TRUE to use an OpenGL ES implementation, FALSE to use a desktop OpenGL implementation") +if(SFML_BUILD_WINDOW) + sfml_set_option(SFML_OPENGL_ES ${OPENGL_ES} BOOL "TRUE to use an OpenGL ES implementation, FALSE to use a desktop OpenGL implementation") +endif() -# Mac OS X specific options +# add an option for building the test suite +sfml_set_option(SFML_BUILD_TEST_SUITE FALSE BOOL "TRUE to build the SFML test suite, FALSE to ignore it") + +# macOS specific options if(SFML_OS_MACOSX) # add an option to build frameworks instead of dylibs (release only) sfml_set_option(SFML_BUILD_FRAMEWORKS FALSE BOOL "TRUE to build SFML as frameworks libraries (release only), FALSE to build according to BUILD_SHARED_LIBS") - # add an option to let the user specify a custom directory for frameworks installation (SFML, FLAC, ...) - sfml_set_option(CMAKE_INSTALL_FRAMEWORK_PREFIX "/Library/Frameworks" STRING "Frameworks installation directory") - # add an option to automatically install Xcode templates sfml_set_option(SFML_INSTALL_XCODE_TEMPLATES FALSE BOOL "TRUE to automatically install the Xcode templates, FALSE to do nothing about it. The templates are compatible with Xcode 4 and 5.") endif() +# iOS specific options +if(SFML_OS_IOS) + # At the moment the minimal deployement target version is 10.2 only because the externals for iOS were built with that requirement. + sfml_set_option(SFML_IOS_DEPLOYMENT_TARGET "10.2" STRING "The minimal iOS version that will be able to run the built binaries. Cannot be lower than 10.2.") + + sfml_set_option(SFML_CODE_SIGN_IDENTITY "iPhone Developer" STRING "The code signing identity to use when building for a real device") +endif() + # Android options if(SFML_OS_ANDROID) # make sure there's the android library available - if (${ANDROID_API_MIN} LESS 9) - message(FATAL_ERROR "Android API level must be equal or greater than 9. Please adjust the CMake variable 'ANDROID_API_MIN'.") - endif() - - if(NOT ANDROID_NDK) - message(FATAL_ERROR "The Android NDK couldn't be found. Please adjust the CMake variable 'ANDROID_NDK' to point to the NDK directory.") + if (CMAKE_ANDROID_API LESS 14) + message(FATAL_ERROR "Android API level (${CMAKE_ANDROID_API}) must be equal or greater than 14.") endif() # CMake doesn't support defining the STL to be used with Nsight Tegra, so warn the user @@ -98,36 +122,93 @@ if(SFML_OS_ANDROID) endif() # install everything in $NDK/sources/ because this path is appended by the NDK (convenient) - set(CMAKE_INSTALL_PREFIX ${ANDROID_NDK}/sources/sfml) - - # we install libs in a subdirectory named after the ABI (lib/mips/*.so) - set(LIB_SUFFIX "/${ANDROID_ABI}") + set(CMAKE_INSTALL_PREFIX ${CMAKE_ANDROID_NDK}/sources/third_party/sfml) + # we install libs in a subdirectory named after the ABI + set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CMAKE_ANDROID_ARCH_ABI}") # pass shared STL configuration (if any) - if (ANDROID_STL MATCHES "_shared") - add_definitions("-DSTL_LIBRARY=${ANDROID_STL}") + if (CMAKE_ANDROID_STL_TYPE MATCHES "_shared") + add_definitions("-DSTL_LIBRARY=${CMAKE_ANDROID_STL_TYPE}") + # if(NOT CMAKE_ANDROID_STL_TYPE MATCHES "c\\+\\+_shared") + # message("Android: Using ${CMAKE_ANDROID_STL_TYPE} as STL. Set CMAKE_ANDROID_STL_TYPE to c++_shared, if there are any issues.") + # endif() + else() + # message(WARNING "Android: You're using a static STL (${CMAKE_ANDROID_STL_TYPE}). Set CMAKE_ANDROID_STL_TYPE to c++_shared, if there are any issues.") endif() + # let the user switch ABIs + set(ANDROID_ABI "armeabi-v7a" CACHE STRING "Look at the NDK docs for currently supported ABIs") + # this is a workaround to compile sfml-activity without the stl library as a dependency # we save the original compilation command line to restore it later in Macro.cmake set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITH_STL ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITHOUT_STL " -o ") -else() - unset(ANDROID_ABI CACHE) - unset(ANDROID_API_MIN CACHE) - unset(ANDROID_STL CACHE) - unset(ANDROID_NATIVE_API_LEVEL CACHE) - unset(ANDROID_NDK CACHE) endif() -# define SFML_STATIC if the build type is not set to 'shared' -if(NOT BUILD_SHARED_LIBS) - add_definitions(-DSFML_STATIC) +# Install directories +# For miscellaneous files +if(SFML_OS_WINDOWS OR SFML_OS_IOS) + set(DEFAULT_INSTALL_MISC_DIR .) +elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD) + set(DEFAULT_INSTALL_MISC_DIR share/SFML) +elseif(SFML_OS_MACOSX) + set(DEFAULT_INSTALL_MISC_DIR /usr/local/share/SFML) +elseif(SFML_OS_ANDROID) + set(DEFAULT_INSTALL_MISC_DIR ${CMAKE_ANDROID_NDK}/sources/third_party/sfml) endif() -# remove SL security warnings with Visual C++ +# force building sfml-window, if sfml-graphics module is built +if(SFML_BUILD_GRAPHICS AND NOT SFML_BUILD_WINDOW) + message(WARNING "You're trying to build SFML's Graphics module without the Window module. Forcing building of the Window module as a dependency.") + set(SFML_BUILD_WINDOW TRUE) +endif() + +# allow not using bundled dependencies with a switch +# (except for stb_image) +# yes this is horrible, but GLOB_RECURSE sucks +sfml_set_option(SFML_USE_SYSTEM_DEPS FALSE BOOL "TRUE to use system dependencies, FALSE to use the bundled ones.") +if(SFML_USE_SYSTEM_DEPS) + if(SFML_INSTALL_XCODE_TEMPLATES) + message(FATAL_ERROR "XCode templates installation cannot be used with the SFML_USE_SYSTEM_DEPS option (the bundled frameworks are required.)") + endif() + + file(GLOB_RECURSE DEP_LIBS "${CMAKE_SOURCE_DIR}/extlibs/libs*/*") + file(GLOB_RECURSE DEP_BINS "${CMAKE_SOURCE_DIR}/extlibs/bin*/*") + file(GLOB_RECURSE DEP_HEADERS "${CMAKE_SOURCE_DIR}/extlibs/headers/*") + + foreach(DEP_FILE ${DEP_LIBS} ${DEP_BINS} ${DEP_HEADERS}) + get_filename_component(DEP_DIR ${DEP_FILE} PATH) + + if(NOT DEP_DIR MATCHES "/stb_image(/|$)") + set(CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH} ${DEP_DIR}) + endif() + + get_filename_component(DEP_PARENT_DIR ${DEP_DIR} PATH) + while(NOT DEP_PARENT_DIR STREQUAL "${CMAKE_SOURCE_DIR}/extlibs") + if(NOT DEP_DIR MATCHES "/stb_image(/|$)") + set(CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH} ${DEP_PARENT_DIR}) + endif() + + get_filename_component(DEP_PARENT_DIR ${DEP_PARENT_DIR} PATH) + endwhile() + endforeach() + + list(REMOVE_DUPLICATES CMAKE_IGNORE_PATH) +endif() + +# Visual C++: remove warnings regarding SL security and algorithms on pointers if(SFML_COMPILER_MSVC) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + # add an option to choose whether PDB debug symbols should be generated (defaults to true when possible) + if(CMAKE_VERSION VERSION_LESS 3.1) + sfml_set_option(SFML_GENERATE_PDB FALSE BOOL "True to generate PDB debug symbols, FALSE otherwise. Requires CMake 3.1.") + if(SFML_GENERATE_PDB) + message(FATAL_ERROR "Generation of PDB files (SFML_GENERATE_PDB) requires at least CMake 3.1.0") + endif() + else() + sfml_set_option(SFML_GENERATE_PDB TRUE BOOL "True to generate PDB debug symbols, FALSE otherwise. Requires CMake 3.1.") + endif() + + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) endif() # define SFML_OPENGL_ES if needed @@ -177,39 +258,13 @@ if(SFML_OS_MACOSX) endif() endif() - # configure Xcode templates - if(CMAKE_OSX_ARCHITECTURES) - # maybe multiple arches are present in CMAKE_OSX_ARCHITECTURES - # we simply need to replace ';' by ' ' (space) and store the result in XCODE_TEMPLATES_ARCH - string(REPLACE ";" " " XCODE_TEMPLATES_ARCH "${CMAKE_OSX_ARCHITECTURES}") - else() - # no arch was provided to cmake, so we use the default one - set(XCODE_TEMPLATES_ARCH "\$(NATIVE_ARCH_ACTUAL)") + # only the default architecture (i.e. 64-bit) is supported + if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") + message(FATAL_ERROR "Only 64-bit architecture is supported") endif() -endif() -if(SFML_OS_LINUX OR SFML_OS_FREEBSD) - set(PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig) - if(SFML_OS_FREEBSD) - set(PKGCONFIG_DIR libdata/pkgconfig) - endif() - if(BUILD_SHARED_LIBS) - sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES FALSE BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") - if(SFML_INSTALL_PKGCONFIG_FILES) - foreach(sfml_module IN ITEMS all system window graphics audio network) - CONFIGURE_FILE( - "tools/pkg-config/sfml-${sfml_module}.pc.in" - "tools/pkg-config/sfml-${sfml_module}.pc" - @ONLY) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" - DESTINATION "${CMAKE_INSTALL_PREFIX}/${PKGCONFIG_DIR}") - endforeach() - endif() - else() - if(SFML_INSTALL_PKGCONFIG_FILES) - message(WARNING "No pkg-config files are provided for the static SFML libraries (SFML_INSTALL_PKGCONFIG_FILES will be ignored).") - endif() - endif() + # configure Xcode templates + set(XCODE_TEMPLATES_ARCH "\$(NATIVE_ARCH_ACTUAL)") endif() # enable project folders @@ -224,6 +279,36 @@ endif() if(SFML_BUILD_DOC) add_subdirectory(doc) endif() +if(SFML_BUILD_TEST_SUITE) + if (SFML_OS_IOS) + message( WARNING "Unit testing not supported on iOS") + else() + enable_testing() + add_subdirectory(test) + endif() +endif() + +# on Linux and BSD-like OS, install pkg-config files by default +set(SFML_INSTALL_PKGCONFIG_DEFAULT FALSE) + +if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD) + set(SFML_INSTALL_PKGCONFIG_DEFAULT TRUE) +endif() + +sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES ${SFML_INSTALL_PKGCONFIG_DEFAULT} BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") + +if(SFML_INSTALL_PKGCONFIG_FILES) + sfml_set_option(SFML_PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${SFML_PKGCONFIG_DIR}" PATH "Install directory for SFML's pkg-config .pc files") + + foreach(sfml_module IN ITEMS all system window graphics audio network) + CONFIGURE_FILE( + "tools/pkg-config/sfml-${sfml_module}.pc.in" + "tools/pkg-config/sfml-${sfml_module}.pc" + @ONLY) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" + DESTINATION "${SFML_PKGCONFIG_INSTALL_PREFIX}") + endforeach() +endif() # setup the install rules if(NOT SFML_BUILD_FRAMEWORKS) @@ -231,6 +316,13 @@ if(NOT SFML_BUILD_FRAMEWORKS) DESTINATION . COMPONENT devel FILES_MATCHING PATTERN "*.hpp" PATTERN "*.inl") + + if(SFML_GENERATE_PDB) + install(DIRECTORY ${PROJECT_BINARY_DIR}/lib + DESTINATION . + COMPONENT devel + FILES_MATCHING PATTERN "*.pdb") + endif() else() # find only "root" headers file(GLOB SFML_HEADERS RELATIVE ${PROJECT_SOURCE_DIR} "include/SFML/*") @@ -249,6 +341,9 @@ else() # create SFML.framework add_library(SFML ${SFML_SOURCES}) + # set the target flags to use the appropriate C++ standard library + sfml_set_stdlib(SFML) + # edit target properties set_target_properties(SFML PROPERTIES FRAMEWORK TRUE @@ -258,78 +353,126 @@ else() MACOSX_FRAMEWORK_BUNDLE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} PUBLIC_HEADER "${SFML_HEADERS}") - # add the remaining headers - add_custom_command(TARGET SFML - POST_BUILD - COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* $/Headers) + # add the non-optional SFML headers + add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r + ${PROJECT_SOURCE_DIR}/include/SFML/Config.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/OpenGL.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/GpuPreference.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/System.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/Main.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/System + $/Headers) + + # add window module headers if enabled + if(SFML_BUILD_WINDOW) + add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r + ${PROJECT_SOURCE_DIR}/include/SFML/Window.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/Window + $/Headers) + endif() + + # add network module headers if enabled + if(SFML_BUILD_NETWORK) + add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r + ${PROJECT_SOURCE_DIR}/include/SFML/Network.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/Network + $/Headers) + endif() + + # add graphics module headers if enabled + if(SFML_BUILD_GRAPHICS) + add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r + ${PROJECT_SOURCE_DIR}/include/SFML/Graphics.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/Graphics + $/Headers) + endif() + + # add audio module headers if enabled + if(SFML_BUILD_AUDIO) + add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r + ${PROJECT_SOURCE_DIR}/include/SFML/Audio.hpp + ${PROJECT_SOURCE_DIR}/include/SFML/Audio + $/Headers) + endif() # adapt install directory to allow distributing dylibs/frameworks in user's frameworks/application bundle - # NOTE: it's not required to link agains SFML.framework - set_target_properties(SFML PROPERTIES - BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@rpath") + # NOTE: it's not required to link against SFML.framework + set_target_properties(SFML PROPERTIES INSTALL_NAME_DIR "@rpath") + if(NOT CMAKE_SKIP_BUILD_RPATH) + if (CMAKE_VERSION VERSION_LESS 3.9) + set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) + else() + set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE) + endif() + endif() # install rule install(TARGETS SFML - FRAMEWORK DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX} + FRAMEWORK DESTINATION "." COMPONENT devel) endif() -install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR}) -install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR}) -if(NOT SFML_OS_ANDROID) - install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake/Modules) -endif() +install(FILES license.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) +install(FILES readme.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) # install 3rd-party libraries and tools if(SFML_OS_WINDOWS) - # install the binaries of SFML dependencies - if(ARCH_32BITS) - install(DIRECTORY extlibs/bin/x86/ DESTINATION bin) - if(SFML_COMPILER_MSVC) - install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION lib) - else() - install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION lib) - endif() - elseif(ARCH_64BITS) - install(DIRECTORY extlibs/bin/x64/ DESTINATION bin) - if(SFML_COMPILER_MSVC) - install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION lib) - else() - install(DIRECTORY extlibs/libs-mingw/x64/ DESTINATION lib) + if(NOT SFML_USE_SYSTEM_DEPS) + # install the binaries of SFML dependencies + if(ARCH_32BITS) + install(DIRECTORY extlibs/bin/x86/ DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14) + install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + elseif(SFML_COMPILER_MSVC) + install(DIRECTORY extlibs/libs-msvc-universal/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + elseif(ARCH_64BITS) + install(DIRECTORY extlibs/bin/x64/ DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14) + install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + elseif(SFML_COMPILER_MSVC) + install(DIRECTORY extlibs/libs-msvc-universal/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + install(DIRECTORY extlibs/libs-mingw/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() endif() endif() elseif(SFML_OS_MACOSX) - # install extlibs dependencies only when used - if("${FLAC_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/FLAC.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/FLAC.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + if(SFML_BUILD_GRAPHICS) + if(FREETYPE_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/freetype.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() endif() - if("${FREETYPE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/freetype.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif() + if(SFML_BUILD_AUDIO) + if(FLAC_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/FLAC.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/FLAC.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() - if("${OGG_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/ogg.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/ogg.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif() + if(OGG_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/ogg.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/ogg.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() - if("${VORBIS_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbis.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/vorbis.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif() + if(VORBIS_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbis.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/vorbis.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() - if("${VORBISENC_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisenc.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisenc.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif() + if(VORBISENC_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisenc.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisenc.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() - if("${VORBISFILE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisfile.framework") - install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif() + if(VORBISFILE_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisfile.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisfile.framework DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() - if("${OPENAL_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/OpenAL.framework") - install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + if(OPENAL_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/OpenAL.framework") + install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() endif() # install the Xcode templates if requested @@ -350,21 +493,34 @@ elseif(SFML_OS_MACOSX) elseif(SFML_OS_IOS) # fix CMake install rules broken for iOS (see http://public.kitware.com/Bug/view.php?id=12506) - if(SFML_OS_IOS) - install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/\$ENV{CONFIGURATION}/" DESTINATION lib${LIB_SUFFIX}) - endif() + install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/\$ENV{CONFIGURATION}/" DESTINATION ${CMAKE_INSTALL_LIBDIR}) - # since the iOS libraries are built as static, we must install the SFML dependencies - # too so that the end user can easily link them to its final application - install(FILES extlibs/libs-ios/libfreetype.a extlibs/libs-ios/libjpeg.a DESTINATION lib) + if(NOT SFML_USE_SYSTEM_DEPS) + # since the iOS libraries are built as static, we must install the SFML dependencies + # too so that the end user can easily link them to its final application + if(SFML_BUILD_GRAPHICS) + install(FILES extlibs/libs-ios/libfreetype.a DESTINATION lib) + endif() + + if(SFML_BUILD_AUDIO) + install(FILES extlibs/libs-ios/libflac.a + extlibs/libs-ios/libvorbis.a + extlibs/libs-ios/libogg.a + DESTINATION lib) + endif() + endif() elseif(SFML_OS_ANDROID) - # install extlibs - install(DIRECTORY extlibs/libs-android/${ANDROID_ABI} DESTINATION extlibs/lib) - install(FILES extlibs/Android.mk DESTINATION extlibs) + if(NOT SFML_USE_SYSTEM_DEPS) + # install extlibs + install(DIRECTORY extlibs/libs-android/${CMAKE_ANDROID_ARCH_ABI} DESTINATION extlibs/lib) + install(FILES extlibs/Android.mk DESTINATION extlibs) + endif() # install Android.mk so the NDK knows how to set up SFML install(FILES src/SFML/Android.mk DESTINATION .) endif() + +sfml_export_targets() diff --git a/CONTRIBUTING b/CONTRIBUTING deleted file mode 100644 index fae5de03..00000000 --- a/CONTRIBUTING +++ /dev/null @@ -1,16 +0,0 @@ -Contribution Guidelines -======================= - -You would like to see a feature implemented or a bug fixed in SFML? Great! -Contributions to SFML are highly appreciated, be it in the form of general -ideas, concrete suggestions or code patches. - -A few guiding rules have been set up on the SFML website that you should be -aware of before opening an Issue or Pull Request. They will help you focus -on the important stuff and prevent you from losing (y)our time with requests -that are out of SFML's scope, known issues, and so on. - - http://www.sfml-dev.org/contribute.php - -Those rules cover the general scope defined for this project, a coding -style, and a precise procedure to report bugs or suggest new features. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ce2b66c1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contribution Guidelines + +You would like to see a feature implemented or a bug fixed in SFML? Great! Contributions to SFML are highly appreciated, be it in the form of general ideas, concrete suggestions or code patches. + +[A few guiding rules have been set up on the SFML website](https://www.sfml-dev.org/contribute.php) that you should be aware of before opening an Issue or Pull Request. They will help you focus on the important stuff and prevent you from losing (y)our time with requests that are out of SFML's scope, known issues, and so on. + +Those rules cover the general scope defined for this project, a coding style, and a precise procedure to report bugs or suggest new features. diff --git a/changelog.md b/changelog.md new file mode 100644 index 00000000..6174a84f --- /dev/null +++ b/changelog.md @@ -0,0 +1,702 @@ +# Changelog + +## SFML 2.5.1 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.5.1 + +### General + + * Various CMake fixes (#1414, #1416, #1436, #1439, #1467, #1470) + * Fixed the installation of pkg-config files (#1466) + * Fixed two conversion warnings (#1454) + * [Android] Fixes all symbols in sfml-main are hidden (#1457, #1460) + * [Android] Fixed some `#define` flag problem (#1458) + * [Android] Fix deadlock in main cleanup (#1265) + * [iOS] Modernized toolchain file (#1411) + * [iOS] Check that `` is used (#1412) + * [macOS] Add `-ObjC` flag to fix static linking on macOS (#1485) + +### Window + +**Bugfixes** + + * [iOS] Use default supported rotations when none are specified (#1417) + * [iOS] Fixed autocomplete window overlaps keyboard (#1473, #1482) + * [Linux] Fixed dual monitor issue (#1226, #1238) + * [Linux] Fixed issue where fullscreen window didn't go over task bars on top and left on in Ubuntu (#1224) + * [Linux] Fixed the Unix clipboard implementation causing an abort due to internal data races in Xlib (#1437) + * [macOS] Added additional system cursors (#1401, #1413, #1425) + * [Windows] Fixed swapped colors for custom cursors (#1464, #1465, #1491) + +### Graphics + +**Bugfixes** + + * Fixed a bug in which a `sf::RenderTexture` would not be re-activated after being re-created (#1438) + * Fixed `sf::RenderTextureImplFBO`'s destructor incorrectly triggering deletion of other `sf::RenderTextureImplFBO`'s active FBOs (#1440) + * Fix `sf::RenderWindow::setActive` incorrectly trying to unbind an FBO during deactivation (#1442) + * Fixed `sf::RenderTexture::display()` dereferencing a NULL pointer when being called before `sf::RenderTexture::create()` (#1446) + * Fixed bug in `sf::Text` when applying an outline color/thickness (#1176) + * Squash duplicated `sf::Font` glyphs to single chars (#1461) + * Fixed two issues with glyph sub-pixel positioning (#1452) + * Reduced context locking & unlocking while creating textures (#1459) + * Fixed the error message when the wrong bitmap font size is selected (#1456, #1474, #1492) + +### Audio + +**Bugfixes** + + * Fixed performance issue with reading WAV files (#1450) + +## SFML 2.5.0 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.5.0 + +### General + + * Replaced FindSFML.cmake with SFMLConfig.cmake (#1335) + * Markdown'd and updated readme, changelog, contributing and license files (#1196, #1368, #1317) + * Improve packaging support (#1173) + * Added Tagfile generation and search (#1327) + * Added CMake variables to select the modules to be built (#798, #800) + * Do not install extlibs if `SFML_USE_SYSTEM_DEPS` is true (#1236, #1237) + * Fixed various type conversion/comparison warnings (#1325) + * [Android] Increased minimum API version to 14 (#1362) + * [Android] Removed custom toolchain and added support for the newest NDK version and Gradle (#1350, #1393) + * [iOS] Updated the binary libs from exlibs/libs-ios (#1207, #1209) + * [iOS] Use a CMake toolchain file for iOS build (#1268, #1269) + * [iOS] Install extlibs if needed (#1348) + * [iOS] Drop 32 bit support (#1374) + * [iOS] Force correct iOS architecture for cmake (#1373, #1377) + * [iOS] Added iOS example (#1378) + * [macOS] Fixed launch of cocoa examples (#1334) + * [macOS] Improved application signing process (#1020, #1036, #1194) + * [macOS] Improved CMake script (#1215, #1371) + * [macOS] Use `-stdlib=libc++` (#1361) + * [OpenBSD] Added support for OpenBSD (#1330) + +### System + +**Bugfixes** + + * Added protected destructor to `sf::NonCopyable` to prevent possible resource leaks (#1125, #1161) + * Fixed crash when `sf::Clock` is constructed in a global scope (#1258) + +### Window + +**Features** + + * Implemented Cursor API (#269, #784, #827) + * Implemented Clipboard API (#715, #1204, #1221) + * Renamed a few key codes (#1395) + * Added joystick example (#1363) + * [Windows] Added support for interfacing with joysticks via DirectInput when it is available (#1251, #1326) + * [Windows] Fix discrete GPU preference symbols being exported from the wrong place (#1192, #1406) + +**Bugfixes** + + * [Android] Return correct key code for delete/backspace (#1309, #1362) + * [iOS] Don't need to find vorbisfile or vorbisenc (#1347) + * [Linux] Fixed `sf::Window::getPosition()` returning incorrect position because of differences in window managers (#1228, #1266) + * [Linux] Fix X11 key repeat handling not filtering out events from other windows (#1223, #1230, #1291) + * [Linux] Restore fullscreen of a non-visible window (#1339) + * [macOS] Fixed window menu not working (#1091, #1180, #1193) + * [macOS] Fixed crash with application messing hardware detection e.g. TeamViewer (#1323) + * [macOS] Added support for (some) Hat/POV axis (#1248) + * [Windows] Prevent uninitialized read by zeroing memory (#1264) + * [Windows] Fixed modifier keys handling (#1357) + +### Graphics + +**Features** + + * Implemented additional line spacing and letter spacing in `sf::Text` (#928, #1366) + * Added `sf::VertexBuffer` class (#1308) + * Added GPU local texture copying support, allowing performance optimizations and texture swapping (#1119, #1319, #1320) + * Optimize performance by skipping `glTexCoordPointer()` call if not needed (#1015) + * Generate shape outline vertices only if necessary (#925, #1356) + * Removed dependency to libjpeg, stb_image_write now supports writing JPEG files (#1278, #1279) + * Enable comparing `sf::Transform` and optimize resetting OpenGL back to the identity matrix (#1298) + * Added missing `setActive()` virtual method to `sf::RenderTarget` (#1157) + * Updated stb_image to v2.16 and stb_image_write to v1.07 (#1270) + * Added `sf::RenderTexture` stencil and multisampling support (#1274, #1285) + * Added example demonstrating `sf::VertexBuffer`, `sf::Shader` and `sf::Thread` usage (#1352) + * Optimized `sf::RenderTexture` performance (#1379) + +**Bugfixes** + + * Properly free memory in `sf::Font::cleanup()` (#1119) + * Fixed memory leak in `sf::Font` (#1216) + * Fix OpenGL texture coordinate pointer not being updated correctly under certain conditions (#1297) + * Fix for broken text when the font is reloaded (#1345) + * Fix memory leak in `sf::Text` (#1233, #1360) + * Fixed strict aliasing punning warning when generating the key of a glyph in Font.cpp (#1187, #1396) + * Fixed OpenGL version string being parsed incorrectly on some platforms (#1249, #1390) + * [macOS] Worked around render target bug (#1132, #1342) + * [Windows] Replaced time-based joystick poll with a hardware event handler (#1179, #1195, #1198, #1199, #1421) + +### Audio + +**Features** + + * Added loop point support to `sf::Music` (#177, #629) + * Added support for the extensible PCM wave file format (#1296) + * [iOS] Enable audio module (#1338) + +**Bugfixes** + + * Fixed inconsistent seek behavior in `sf::SoundStream` (#1118) + * Fixed stack overflow in `sf::SoundStream::fillAndPushBuffer()` (#1154) + * Fixed seeking quirks in the FLAC reader (#966, #1162) + * Allow polymorphism with `sf::SoundSource` (#1185) + * Fixed WAV file writer writing wrong header values (#1280, #1281) + * Small bugfix to argument of `alcCaptureOpenDevice()` (#1304, #1305) + * [iOS] Find OpenAL correctly (#1263, #1376) + * [Windows] Updated OpenAL Soft to 1.18.1 fixing crashes (#1247, #1260) + +### Network + +**Features** + + * Add append/overwrite parameter to Ftp::upload (#1072, #1399) + +**Bugfixes** + + * Fixed wrong condition for building network support (#1253) + * Changed TCP listen backlog from 0 to SOMAXCONN (#1369, #1407) + * Fixed socket reuse not conforming to documentation (#1346, #1408) + +## SFML 2.4.2 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.4.2 + +### System + +**Bugfixes** + + * [Windows] Removed thread affinity changes in sf::Clock (#1107) + +### Window + +**Bugfixes** + + * Fixed bug where TransientContextLock would hang (#1165, #1172) + * [Linux] Fixed GLX extensions being loaded too late (#1183) + * [Linux] Fix wrong types passed to XChangeProperty (#1168, #1171) + * [Windows] Make context disabling via wglMakeCurrent more tolerant of broken drivers (#1186) + +### Graphics + +**Bugfixes** + + * Optimized sf::Image::create and made it more exception safe (#1166) + +## SFML 2.4.1 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.4.1 + +### General + + * [kFreeBSD] Define SFML_OS_FREEBSD when compiling for kFreeBSD (#1129) + * [Windows] Added some simple messaging when trying to build under Cygwin (#1153) + +### Window + +**Bugfixes** + + * Fixed stack overflow on GlContext creation with multiple threads (#989, #1002) + * Adjusted mouse cursor grab documentation (#1133) + * [iOS] Fixed orientation change not rescaling window size properly (#1049, #1050) + * [Linux] Fixed fullscreen issue (#921, #1138) + * [Linux] Switched from XCB back to Xlib for windowing (#1138) + * [Linux] Fixed window icon not showing up on some distros (#1087, #1088) + * [Linux] Fixed an issue where GNOME flags window unresponsive (#1089, #1138) + * [Linux] Fixed leak of XVisualInfo objects during GlxContext creation (#1135) + * [Linux] Fixed possible hang when setting visibility if external window sources (#1136) + * [macOS] Fixed inconsistency between doc and impl on macOS for the grab feature (#1133, #1148, #1150) + * [Windows] Fixed context memory leaks (#1143, #1002) + +### Graphics + +**Bugfixes** + + * Adjusted uniform error message (#1131) + * Clarify documentation on Rect::contains function bounds (#1151) + +### Network + +**Bugfixes** + + * Fixed a typo in comment for void unbind() (#1121) + +## SFML 2.4.0 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.4.0 + +### General + + * Added deprecation macro (#969) + * Fixed issues reported by Coverity Scan static analysis (#1064) + * Fixed some initialization issues reported by Cppcheck (#1008) + * Changed comment chars in FindSFML.cmake to # (#1090) + * Fixed some typos (#1098, #993, #1099, #956, #963, #979) + * Updated/fixed string comparisons in Config.cmake (#1102) + * Added the missing -s postfix for the RelWithDebInfo config (#1014) + * [Android] Fixed current Android compilation issues (#1116, #1111, #1079) + * [macOS] Update Xcode template material (#976, #968) + * [Windows] Added support for VS 2015 (#972) + * [Windows] Create and install PDB debug symbols alongside binaries (#1037) + +### Deprecated API + + * sf::RenderWindow::capture(): Use a sf::Texture and its sf::Texture::update(const Window&) function and copy its contents into an sf::Image instead. + * sf::Shader::setParameter(): Use setUniform() instead. + * sf::Text::getColor(): There is now fill and outline colors instead of a single global color. Use getFillColor() or getOutlineColor() instead. + * sf::Text::setColor(): There is now fill and outline colors instead of a single global color. Use setFillColor() or setOutlineColor() instead. + * sf::LinesStrip: Use LineStrip instead. + * sf::TrianglesFan: Use TriangleFan instead. + * sf::TrianglesStrip: Use TriangleStrip instead. + +### System + +**Features** + + * [Android] Added sf::getNativeActivity() (#1005, #680) + +**Bugfixes** + + * Added missing include in String.hpp (#1069, #1068) + * Fixed encoding of UTF-16 (#997) + * [Android] Fixed crash when trying to load a non-existing font file (#1058) + +### Window + +**Features** + + * Added ability to grab cursor (#614, #394, #1107) + * Added Multi-GPU preference (#869, #867) + * Added support for sRGB capable framebuffers (#981, #175) + * [Linux, Windows] Improved OpenGL context creation (#884) + * [Linux, Windows] Added support for pbuffers on Windows and Unix (#885, #434) + +**Bugfixes** + + * Updated platform-specific handle documentation (#961) + * [Android] Accept touch events from "multiple" devices (#954, #953) + * [Android] Copy the selected EGL context's settings to SFML (#1039) + * [Linux] Fixed modifiers causing sf::Keyboard::Unknown being returned (#1022, #1012) + * [macOS] Improved memory management on macOS (#962, #790) + * [macOS] Fixed crash when resizing a window to a zero-height/width size (#986, #984) + * [macOS] Use the mouse button constant instead of 0 to avoid a compiler error on macOS (#1035) + * [macOS] macOS improvement: warnings + bugfix + refactoring, the lot! (#1042) + +### Graphics + +**Features** + + * Added support for outlined text (#840) + * Add support for geometry shaders (#886, #428) + * Feature/blend mode reverse subtract (#945, #944) + * Implemented support for mipmap generation (#973, #498, #123) + * Added new API to set shader uniforms (#983, #538) + * Rewrite RenderWindow::capture (#1001) + +**Bugfixes** + + * Exporting some Glsl utility functions due to linking issues (#1044, #1046) + * Fixed missing initialisation of Font::m_stroker (#1059) + * Changed primitive types to be grammatically correct (#1095, #939) + +### Audio + +**Features** + + * Implemented stereo audio recording (#1010) + +**Bugfixes** + + * Added an assignment operator to SoundSource (#864) + * [macOS] Updates OpenAL-soft for macOS to version 1.17.2 (#1057, #900, #1000) + * Fixed a bug where vorbis can't handle large buffers (#1067) + * Added support for 24-bit .wav files (#958, #955) + * Fixed threading issue in sf::SoundRecorder (#1011) + * Made WAV file reader no longer assume that data chunk goes till end of file to prevent reading trailing metadata as samples (#1018) + * Fixed seeking in multi channel FLAC files (#1041, #1040) + +### Network + +**Features** + + * Added optional argument on which address to bind (socket). (#850, #678) + +**Bugfixes** + + * Fixed FTP directory listing blocking forever (#1086, #1025) + +## SFML 2.3.2 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.3.2 + +### General + + * Fixed an issue where FindSFML.cmake couldn't find older versions of SFML (#903) + * Robust alCheck and glCheck macros (#917) + * Fixed FindSFML.cmake to use the uppercase FLAC name (#923) + * Added a CONTRIBUTING file so GitHub shows a message when creating a new issue (#932) + +### Window + +**Bugfixes** + + * [Linux] Fixed an issue where the keypad's key weren't being detected (#910) + * [Linux] Revert to Xlib event handling (#934) + * [Linux] Fixed `XK_*` inconsistency in InpuImpl.cpp (#947) + * [Linux] Fix `_NET_WM_PING` messages not being replied to properly (#947) + +### Graphics + +**Bugfixes** + + * Fixed clear bug on RenderTextures (#915) + * Fixed image file extension detection (#929, #930, #931) + * Secure function against random data return (#935, #942) + +## SFML 2.3.1 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.3.1 + +### Window + +**Bugfixes** + + * [Android] Make sure a window still exists before trying to access its dimensions (#854) + * [Android] Added Android API level checks (#856) + * [Android] Updated the JNI/event handling code (#906) + * [Linux] Resized events are only spawned when the window size actually changes (#878, #893) + * [Linux] Whitelisted X SHAPE events (#879, #883) + * [Linux] Remap Unix keyboard when user changes layout (#895, #897) + * [Linux] Fix undefined behavior in ewmhSupported() (#892, #901) + +### Graphics + +**Bugfixes** + + * Added support for GL_EXT_texture_edge_clamp for systems that don't expose GL_SGIS_texture_edge_clamp (#880, #882) + +### Audio + +**Bugfixes** + + * [Android] Fixed audio files not loading (and possibly crashing) (#855, #887) + +## SFML 2.3 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.3 + +### General + + * Examples only link against sfml-main in release mode (#610, #766) + * Replaced unsigned int with std::size_t for array indices and sizes (#739) + * Fixed some issues with the Doxygen documentation (#750) + * Added support for EditorConfig (#751) + * Hide success message for CMake in quiet mode (#753) + * Improved documentation for statuses with sf::Ftp (#763) + * Moved stb_image into the extlibs directory (#795) + * Changed the SOVERSION to major.minor (#812) + * Fixed warnings about switch-statements (#863) + * Added missing includes in the general headers (#851) + * [Android] Updated toolchain file and dependencies (#791) + * [Linux] Fixed missing pthread dependency (#794) + * [macOS] Relaxed CMake installation rules regarding framework dependencies (#767) + +### Deprecated API + + * sf::Event::MouseWheelEvent: This event is deprecated and potentially inaccurate. Use MouseWheelScrollEvent instead. + +### Window + +**Features** + + * Added new events for handling high-precision scrolling (#95, #810, #837) + * Switched from Xlib to XCB (#200, #319, #694, #780, #813, #825) + * Added support for OpenGL 3 core context creation (#654, #779) + +**Bugfixes** + + * Fixed glXSwapIntervalSGI being broken for some driver implementations (#727, #779) + * Fixed simultaneous context operations causing crashes on some AMD hardware (#778, #779) + * Fixed joystick identification (#809, #811) + * [iOS] Fixed various issues including stencil bits, device orientation and retina support (#748) + * [iOS] Fixed inconsistency between sf::Touch::getPosition and touch events (#875) + * [Linux] Fixed Alt+F4 not getting triggered in window mode (#274) + * [Linux] Fixed Unix joystick stuff (#838) + * [macOS] Fixed typo in JoystickImpl.cpp to prevent a crash (#762, #765) + * [macOS] Fixed an issue in InputImpl::getSFOpenGLViewFromSFMLWindow (#782, #792) + +### Graphics + +**Features** + + * Replaced GLEW with loader generated by glLoadGen (#779) + * Added a new constructor to sf::Color that takes an sf::Uint32 (#722) + * Updated stb_image to v2.02 (#777) + * Updated FreeType to v2.5.5 (#799, #804) + * Added checks for software OpenGL (#870) + +**Bugfixes** + + * Fixed GL_ARB_compatibility not being detected (#859) + * Fixed pixel format selection (#862) + * Bumped back the OpenGL version requirement to 1.1 (#858) + +### Audio + +**Features** + + * Dropped libsndfile and started using Vorbis, FLAC and OGG directly (#604, #757) + * Added a FLAC file to the sound example (#815) + +**Bugfixes** + + * Fixed access violation error in the destructor of sf::AudioDevice (#30, #602) + * [macOS] Fixed threading issue with sf::SoundStream and OpenAL (#541, #831) + +### Network + +**Bugfixes** + + * Fixed sf::TcpSocket not handling partial sends properly (#749, #796) + +## SFML 2.2 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.2 + +### General + + * Support for iOS and Android platform (#410, #440) + * Various documentation corrections (#438, #496, #497, #714) + * Fixed support for compilers on Debian FreeBSD (#380, #578) + * Added support for Visual Studio 2013 and proper support for the TDM builds (#482) + * Fixed CMake problems related to FindSFML and cached variables (#637, #684) + * Switched and enforced LF line endings (#708, #712) + * Updated OpenAL to version 1.15.1 (d077210) + * Made compiler and OS variable names much clearer in CMake files (9b0ed30) + * Re-enabled RPATH feature (e157e7a) + * Slight adjustments to the examples (#737) + * [FreeBSD] Various configuration fixes (#577, #578) + * [Linux] Updated FindSFML.cmake to add UDev to SFML's dependencies (#728, #729, #734, #736) + * [macOS] Fixed incorrect symlink in freetype.framework (#519) + * [macOS] CMake module for correct dependencies (#548) + * [macOS] Fixed SFML target for Xcode (#595, #596) + * [macOS] Updated implementation, mainly reverting to non-ARC (#601) + * [macOS] Fixed memory leaks and dead store (#615) + * [macOS] Improved event handling and performance (#617) + * [macOS] Reduced memory usage (#672, #698) + * [macOS] macOS 10.10 support (#691, #699) + * [macOS] Improve flexibility of dependencies' locations (#713) + * [Windows] Removed the hack that copied external libraries into SFML static libraries (dbf01a7) + +### System + +**Features** + + * Added substring and replace functions to sf::String (#21, #355) + * Added toUtfX to sf::String (#501) + * Added fromUtfX functions to set the internal data to a string by converting from another string in a fixed encoding (#196) + * Added modulo operator for sf::Time (#429, #430) + * Added division operator for sf::Time (#453) + +**Bugfixes** + + * Ensured a high resolution for sf::sleep (#439, #475) + * [Windows] Fixed stack unalignment by two internal functions (#412) + +### Window + +**Features** + + * Added window methods to request and to check focus (#518, #525, #613, #723, #735) + * Provide name, manufacturer ID and product ID via sf::Joystick (#152, #528) + * [FreeBSD] Joystick support (#477) + * [macOS] Improved integration with menus and dock actions (#11) + * [macOS] Support for OpenGL 3.2 (#84) + * [macOS] Improved fullscreen support (#343) + * [macOS] Added support for retina displays (#353, #388) + * [Windows] Removed support for Windows 9x (#469) + * [Windows] Fixed typo in Windows keyboard implementation (#516) + +**Bugfixes** + + * sf::Window::create() now also resets framerate limit (#371) + * Fixed OpenGL context leak (#635, #705) + * Fixed various joystick problems (memory leak, accelerometer detected, code refactoring) (#660, #686, #742, #743) + * Optimized sf::Window::waitEvent a bit, no sleep if events are available at first try (ff555d6) + * [Linux] Output error message when XOpenDisplay() fails (#508, #616) + * [Linux] Resize window with setSize when sf::Style::Resize is set (#466) + * [Linux] Fixed broken key repeat on window recreation (#564, #567) + * [macOS] Fixed KeyReleased not being fired in fullscreen mode (#465) + * [macOS] Fixed an issue where disconnecting the keyboard would cause a crash (#467) + * [macOS] Fixed unexpected resizing behavior (#468) + * [macOS] Improved resizing windows (#474) + * [macOS] Fixed memory leak with sf::Window::create() (#484) + * [macOS] Fixed menu shortcuts in fullscreen on macOS (#527) + * [macOS] Improved cursor hiding (#703) + * [macOS] Fixed right click not detected with trackpads (#716, #730) + * [Windows] Fixed joystick POV values (ef1d29b) + * [Windows] Fixed Unicode inconsistency (#635) + * [Windows] Fixed Alt+F4 and mouse clicks issues (#437, #457) + * [Windows] Send MouseButtonReleased event when the mouse is outside of the window (#455, #457) + * [Windows] Fixed sf::Joystick wrong registry usage (#701, #702, #706) + +### Graphics + +**Features** + + * Provide more information about the loaded font in sf::Font (#164) + * Implemented a more flexible blending system (#298) + * Added strikethrough text style (#243, #362, #682) + * Slight optimization for sf::Text::setString (#413) + * Added subtraction operator for sf::Color (#114, #145) + * Optimized sf::Image::flipVertically/flipHorizontally (#555) + * Changed sf::Font measurements from int to float to allow better underline drawing (#693) + +**Bugfixes** + + * Improved text quality for small and pixelated fonts (#228) + * Yet another fix for Intel GPUs with sf::RenderTexture (#418) + * Removed VTab since it causes issues and doesn't have a use nowadays (#442, #445, #460, #588) + * Fixed broken BDF and PCF font formats (#448) + * Fixed compilation issue with newer versions of GCC for sf::Rect (#458) + * Fixed resetGLStates() not explicitly setting the default polygon mode (#480) + * Fixed division-by-zero in sf::RectangleShape (#499) + * Fixed potential memory leak in sf::Font (#509) + * Updated glext and removed glxext (#511, #583) + * Make sure texture unit 0 is active when resetting sf::RenderTarget states (#523, #591) + * Fixed texture rect computation in fonts (#669) + * Improved rendering of underlined text (#593) + * Avoided repeated output of error messages (#566) + * Fixed text rendered with vertical offset on ascent and font size mismatch (#576) + * Fixed rounding problem for viewports (#598) + * Fixed sf::Shader::isAvailable() possibly breaking context management (#211, #603, #608, #603) + * Fixed sf::Texture::getMaximumSize() possibly breaking context management (#666) + * Fixed various sf::Text rendering issues (#692, #699) + * The texture matrix is now reset in sf::Texture::bind(NULL) (7c4b058) + * [Windows] Fixed DPI scaling causing strange window behavior (#679, #681, #688) + +### Audio + +**Features** + + * Added support for selecting the audio capture device (#220, #470) + * Make sf::SoundRecorder processing frequency configurable (#333) + * Added up vector to sf::Listener (#545) + +**Bugfixes** + + * Prevented sf::SoundStream::setPlayingOffset() from restarting playing even when paused (#203, #592) + * Fixed sf::SoundBuffer contents not being able to be updated when still attached to sounds (#354, 367, #390, #589) + * Catch audio format error and prevent division by zero (#529) + * Fixed sf::SoundBuffer returning wrong duration for sounds containing more than ~4.3 million samples (2ff58ed) + * Optimized sf::Listener with a cache (d97e524) + +### Network + +**Features** + + * Added support for PUT and DELETE in sf::Http (#257, #312, #607) + * Added support for chunked HTTP transfers (#296, #337) + * Added support for 64-bit integers in sf::Packet (#710) + * Made sf::Ftp::sendCommand() public (2c5cab5) + +**Bugfixes** + + * Checked socket descriptor limit (#153, #628, #683) + * Fixed sf::TcpSocket::connect()'s switching from blocking to non-blocking mode on immediate connection success (#221) + * Fixed FTP download and upload file sizes being limited by available RAM (#565, #590) + * Fixed C++11 compiler warnings for sf::Uint8 (#731, #732) + +## SFML 2.1 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.1 + +### General + + * Updated the Window and OpenGL examples (got rid of GLU and immediate mode) + +### Window + +**Features** + + * Now using inotify on Linux to avoid constantly polling joystick connections (#96) + * Add keypad return, equal and period keys support for macOS + * Improved mouse events on macOS regarding fullscreen mode + * Improved mouse events on macOS (#213, #277) + * Improved reactivity of setMousePosition on macOS (#290) + * Added support for right control key on macOS + * Improved TextEntered for macOS (#377) + * Improved the performances of Window::getSize() (the size is now cached) + * Added the WM_CLASS property to SFML windows on Linux + * Fake resize events are no longer sent when the window is moved, on Linux + * Pressing ALT or F10 on Windows no longer steals the focus + +**Bugfixes** + + * Fixed MouseMove event sometimes not generated when holding left button on Windows (#225) + * Fixed ContextSettings ignored when creating a 3.x/4.x OpenGL context on Linux (#258) + * Fixed ContextSettings ignored on Linux when creating a window (#35) + * Fixed windows bigger than the desktop not appearing on Windows (#215) + * Fixed KeyRelease events sometimes not reported on Linux (#404) + * Fixed mouse moved event on macOS when dragging the cursor (#277) + * Fixed KeyRelease event with CMD key pressed (#381) + * Fixed taskbar bugs on Windows (#328, #69) + * Fixed Window::getPosition() on Linux (#346) + * Unicode characters outside the BMP (> 0xFFFF) are now correctly handled on Windows (#366) + +### Graphics + +**Features** + + * Checking errors in RenderTarget::pushGLStates() to avoid generating false error messages when user leaves unchecked OpenGL errors (#340) + * Optimized Shader::setParameter functions, by using a cache internally (#316, #358) + +**Bugfixes** + + * Fixed bounding rect of sf::Text ignoring whitespaces (#216) + * Solved graphics resources not updated or corrupted when loaded in a thread (#411) + * Fixed white pixel showing on first character of sf::Text (#414) + * sf::Rect::contains and sf::Rect::intersects now handle rectangles with negative dimensions correctly (#219) + * Fixed Shape::setTextureRect not working when called before setTexture + +### Audio + +**Features** + + * loadFromStream functions now explicitly reset the stream (seek(0)) before starting to read (#349) + +**Bugfixes** + + * Added a workaround for a bug in the macOS implementation of OpenAL (unsupported channel count no properly detected) (#201) + * Fixed SoundBuffer::loadFromStream reading past the end of the stream (#214) + +### Network + +**Features** + + * Replaced the deprecated gethostbyname with getaddrinfo (#47) + * Minor improvements to sf::Packet operators (now using strlen and wcslen instead of explicit loops) (#118) + +**Bugfixes** + + * Fixed non-blocking connection with a sf::TcpSocket on Windows + * Fixed TCP packet data corruption in non-blocking mode (#402, #119) + * On Unix systems, a socket disconnection no longer stops the program with signal SIGPIPE (#72) + +## SFML 2.0 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.0 + +No changelog available. *Everything changed.* + +## Older Releases + +See the website for changelogs of older releases: https://www.sfml-dev.org/changelog.php diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index 80ded9cd..00000000 --- a/changelog.txt +++ /dev/null @@ -1,411 +0,0 @@ -SFML 2.3.2 -========== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.3.2 - -General -======= - -* Fixed an issue where FindSFML.cmake couldn't find older versions of SFML (#903) -* Robust alCheck and glCheck macros (#917) -* Fixed FindSFML.cmake to use the uppercase FLAC name (#923) -* Added a CONTRIBUTING file so GitHub shows a message when creating a new issue (#932) - - -Window -====== - -Bugfixes --------- -* [Linux] Fixed an issue where the keypad's key weren't being detected (#910) -* [Linux] Revert to Xlib event handling (#934) -* [Linux] Fixed XK_* inconsistency in InpuImpl.cpp (#947) -* [Linux] Fix _NET_WM_PING messages not being replied to properly (#947) - - -Graphics -======== - -Bugfixes --------- -* Fixed clear bug on RenderTextures (#915) -* Fixed image file extension detection (#929, #930, #931) -* Secure function against random data return (#935, #942) - - -SFML 2.3.1 -========== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.3.1 - -Window -====== - -Bugfixes --------- -* [Android] Make sure a window still exists before trying to access its dimensions (#854) -* [Android] Added Android API level checks (#856) -* [Android] Updated the JNI/event handling code (#906) -* [Linux] Resized events are only spawned when the window size actually changes (#878, #893) -* [Linux] Whitelisted X SHAPE events (#879, #883) -* [Linux] Remap Unix keyboard when user changes layout (#895, #897) -* [Linux] Fix undefined behavior in ewmhSupported() (#892, #901) - - -Graphics -======== - -Bugfixes --------- -* Added support for GL_EXT_texture_edge_clamp for systems that don't expose GL_SGIS_texture_edge_clamp (#880, #882) - - -Audio -===== - -Bugfixes --------- -* [Android] Fixed audio files not loading (and possibly crashing) (#855, #887) - - - -SFML 2.3 -======== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.3 - -General -======= - -* Examples only link against sfml-main in release mode (#610, #766) -* Replaced unsigned int with std::size_t for array indices and sizes (#739) -* Fixed some issues with the Doxygen documentation (#750) -* Added support for EditorConfig (#751) -* Hide success message for CMake in quiet mode (#753) -* Improved documentation for statuses with sf::Ftp (#763) -* Moved stb_image into the extlibs directory (#795) -* Changed the SOVERSION to major.minor (#812) -* Fixed warnings about switch-statements (#863) -* Added missing includes in the general headers (#851) -* [Android] Updated toolchain file and dependencies (#791) -* [Linux] Fixed missing pthread dependency (#794) -* [OS X] Relaxed CMake installation rules regarding framework dependencies (#767) - -Window -====== - -Features --------- -* Added new events for handling high-precision scrolling (#95, #810, #837) -* Switched from Xlib to XCB (#200, #319, #694, #780, #813, #825) -* Added support for OpenGL 3 core context creation (#654, #779) - -Bugfixes --------- -* Fixed glXSwapIntervalSGI being broken for some driver implementations (#727, #779) -* Fixed simultaneous context operations causing crashes on some AMD hardware (#778, #779) -* Fixed joystick identification (#809, #811) -* [iOS] Fixed various issues including stencil bits, device orientation and retina support (#748) -* [iOS] Fixed inconsistency between sf::Touch::getPosition and touch events (#875) -* [Linux] Fixed Alt+F4 not getting triggered in window mode (#274) -* [Linux] Fixed Unix joystick stuff (#838) -* [OS X] Fixed typo in JoystickImpl.cpp to prevent a crash (#762, #765) -* [OS X] Fixed an issue in InputImpl::getSFOpenGLViewFromSFMLWindow (#782, #792) - -Graphics -======== - -Features --------- -* Replaced GLEW with loader generated by glLoadGen (#779) -* Added a new constructor to sf::Color that takes an sf::Uint32 (#722) -* Updated stb_image to v2.02 (#777) -* Updated FreeType to v2.5.5 (#799, #804) -* Added checks for software OpenGL (#870) - -Bugfixes --------- -* Fixed GL_ARB_compatibility not being detected (#859) -* Fixed pixel format selection (#862) -* Bumped back the OpenGL version requirement to 1.1 (#858) - -Audio -===== - -Features --------- -* Dropped libsndfile and started using Vorbis, FLAC and OGG directly (#604, #757) -* Added a FLAC file to the sound example (#815) - -Bugfixes --------- -* Fixed access violation error in the destructor of sf::AudioDevice (#30, #602) -* [OS X] Fixed threading issue with sf::SoundStream and OpenAL (#541, #831) - -Network -======= - -Bugfixes --------- -* Fixed sf::TcpSocket not handling partial sends properly (#749, #796) - - - -SFML 2.2 -======== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.2 - -General -======= - -* Support for iOS and Android platform (#410, #440) -* Various documentation corrections (#438, #496, #497, #714) -* Fixed support for compilers on Debian FreeBSD (#380, #578) -* Added support for Visual Studio 2013 and proper support for the TDM builds (#482) -* Fixed CMake problems related to FindSFML and cached variables (#637, #684) -* Switched and enforced LF line endings (#708, #712) -* Updated OpenAL to version 1.15.1 (d077210) -* Made compiler and OS variable names much clearer in CMake files (9b0ed30) -* Re-enabled RPATH feature (e157e7a) -* Slight adjustments to the examples (#737) -* [FreeBSD] Various configuration fixes (#577, #578) -* [Linux] Updated FindSFML.cmake to add UDev to SFML's dependencies (#728, #729, #734, #736) -* [OS X] Fixed incorrect symlink in freetype.framework (#519) -* [OS X] CMake module for correct dependencies (#548) -* [OS X] Fixed SFML target for Xcode (#595, #596) -* [OS X] Updated implementation, mainly reverting to non-ARC (#601) -* [OS X] Fixed memory leaks and dead store (#615) -* [OS X] Improved event handling and performance (#617) -* [OS X] Reduced memory usage (#672, #698) -* [OS X] OS X 10.10 support (#691, #699) -* [OS X] Improve flexibility of dependencies' locations (#713) -* [Windows] Removed the hack that copied external libraries into SFML static libraries (dbf01a7) - - -System -====== - -Features --------- -* Added substring and replace functions to sf::String (#21, #355) -* Added toUtfX to sf::String (#501) -* Added fromUtfX functions to set the internal data to a string by converting from another string in a fixed encoding (#196) -* Added modulo operator for sf::Time (#429, #430) -* Added division operator for sf::Time (#453) - -Bugfixes --------- -* Ensured a high resolution for sf::sleep (#439, #475) -* [Windows] Fixed stack unalignment by two internal functions (#412) - - -Window -====== - -Features --------- -* Added window methods to request and to check focus (#518, #525, #613, #723, #735) -* Provide name, manufacturer ID and product ID via sf::Joystick (#152, #528) -* [FreeBSD] Joystick support (#477) -* [OS X] Improved integration with menus and dock actions (#11) -* [OS X] Support for OpenGL 3.2 (#84) -* [OS X] Improved fullscreen support (#343) -* [OS X] Added support for retina displays (#353, #388) -* [Windows] Removed support for Windows 9x (#469) -* [Windows] Fixed typo in Windows keyboard implementation (#516) - -Bugfixes --------- -* sf::Window::create() now also resets framerate limit (#371) -* Fixed OpenGL context leak (#635, #705) -* Fixed various joystick problems (memory leak, accelerometer detected, code refactoring) (#660, #686, #742, #743) -* Optimized sf::Window::waitEvent a bit, no sleep if events are available at first try (ff555d6) -* [Linux] Output error message when XOpenDisplay() fails (#508, #616) -* [Linux] Resize window with setSize when sf::Style::Resize is set (#466) -* [Linux] Fixed broken key repeat on window recreation (#564, #567) -* [OS X] Fixed KeyReleased not being fired in fullscreen mode (#465) -* [OS X] Fixed an issue where disconnecting the keyboard would cause a crash (#467) -* [OS X] Fixed unexpected resizing behavior (#468) -* [OS X] Improved resizing windows (#474) -* [OS X] Fixed memory leak with sf::Window::create() (#484) -* [OS X] Fixed menu shortcuts in fullscreen on OS X (#527) -* [OS X] Improved cursor hiding (#703) -* [OS X] Fixed right click not detected with trackpads (#716, #730) -* [Windows] Fixed joystick POV values (ef1d29b) -* [Windows] Fixed Unicode inconsistency (#635) -* [Windows] Fixed Alt+F4 and mouse clicks issues (#437, #457) -* [Windows] Send MouseButtonReleased event when the mouse is outside of the window (#455, #457) -* [Windows] Fixed sf::Joystick wrong registry usage (#701, #702, #706) - - -Graphics -======== - -Features --------- -* Provide more information about the loaded font in sf::Font (#164) -* Implemented a more flexible blending system (#298) -* Added strikethrough text style (#243, #362, #682) -* Slight optimization for sf::Text::setString (#413) -* Added subtraction operator for sf::Color (#114, #145) -* Optimized sf::Image::flipVertically/flipHorizontally (#555) -* Changed sf::Font measurements from int to float to allow better underline drawing (#693) - -Bugfixes --------- -* Improved text quality for small and pixelated fonts (#228) -* Yet another fix for Intel GPUs with sf::RenderTexture (#418) -* Removed VTab since it causes issues and doesn't have a use nowadays (#442, #445, #460, #588) -* Fixed broken BDF and PCF font formats (#448) -* Fixed compilation issue with newer versions of GCC for sf::Rect (#458) -* Fixed resetGLStates() not explicitly setting the default polygon mode (#480) -* Fixed division-by-zero in sf::RectangleShape (#499) -* Fixed potential memory leak in sf::Font (#509) -* Updated glext and removed glxext (#511, #583) -* Make sure texture unit 0 is active when resetting sf::RenderTarget states (#523, #591) -* Fixed texture rect computation in fonts (#669) -* Improved rendering of underlined text (#593) -* Avoided repeated output of error messages (#566) -* Fixed text rendered with vertical offset on ascent and font size mismatch (#576) -* Fixed rounding problem for viewports (#598) -* Fixed sf::Shader::isAvailable() possibly breaking context management (#211, #603, #608, #603) -* Fixed sf::Texture::getMaximumSize() possibly breaking context management (#666) -* Fixed various sf::Text rendering issues (#692, #699) -* The texture matrix is now reset in sf::Texture::bind(NULL) (7c4b058) -* [Windows] Fixed DPI scaling causing strange window behavior (#679, #681, #688) - - -Audio -===== - -Features --------- -* Added support for selecting the audio capture device (#220, #470) -* Make sf::SoundRecorder processing frequency configurable (#333) -* Added up vector to sf::Listener (#545) - -Bugfixes --------- -* Prevented sf::SoundStream::setPlayingOffset() from restarting playing even when paused (#203, #592) -* Fixed sf::SoundBuffer contents not being able to be updated when still attached to sounds (#354, 367, #390, #589) -* Catch audio format error and prevent division by zero (#529) -* Fixed sf::SoundBuffer returning wrong duration for sounds containing more than ~4.3 million samples (2ff58ed) -* Optimized sf::Listener with a cache (d97e524) - -Network -======= - -Features --------- -* Added support for PUT and DELETE in sf::Http (#257, #312, #607) -* Added support for chunked HTTP transfers (#296, #337) -* Added support for 64-bit integers in sf::Packet (#710) -* Made sf::Ftp::sendCommand() public (2c5cab5) - -Bugfixes --------- -* Checked socket descriptor limit (#153, #628, #683) -* Fixed sf::TcpSocket::connect()'s switching from blocking to non-blocking mode on immediate connection success (#221) -* Fixed FTP download and upload file sizes being limited by available RAM (#565, #590) -* Fixed C++11 compiler warnings for sf::Uint8 (#731, #732) - - - -SFML 2.1 -======== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.1 - -General -======= - -* Updated the Window and OpenGL examples (got rid of GLU and immediate mode) - -Window -====== - -Features --------- -* Now using inotify on Linux to avoid constantly polling joystick connections (#96) -* Add keypad return, equal and period keys support for OS X -* Improved mouse events on OS X regarding fullscreen mode -* Improved mouse events on OS X (#213, #277) -* Improved reactivity of setMousePosition on OS X (#290) -* Added support for right control key on OS X -* Improved TextEntered for OS X (#377) -* Improved the performances of Window::getSize() (the size is now cached) -* Added the WM_CLASS property to SFML windows on Linux -* Fake resize events are no longer sent when the window is moved, on Linux -* Pressing ALT or F10 on Windows no longer steals the focus - -Bugfixes --------- -* Fixed MouseMove event sometimes not generated when holding left button on Windows (#225) -* Fixed ContextSettings ignored when creating a 3.x/4.x OpenGL context on Linux (#258) -* Fixed ContextSettings ignored on Linux when creating a window (#35) -* Fixed windows bigger than the desktop not appearing on Windows (#215) -* Fixed KeyRelease events sometimes not reported on Linux (#404) -* Fixed mouse moved event on OS X when dragging the cursor (#277) -* Fixed KeyRelease event with CMD key pressed (#381) -* Fixed taskbar bugs on Windows (#328, #69) -* Fixed Window::getPosition() on Linux (#346) -* Unicode characters outside the BMP (> 0xFFFF) are now correctly handled on Windows (#366) - -Graphics -======== - -Features --------- -* Checking errors in RenderTarget::pushGLStates() to avoid generating false error messages when user leaves unchecked OpenGL errors (#340) -* Optimized Shader::setParameter functions, by using a cache internally (#316, #358) - -Bugfixes --------- -* Fixed bounding rect of sf::Text ignoring whitespaces (#216) -* Solved graphics resources not updated or corrupted when loaded in a thread (#411) -* Fixed white pixel showing on first character of sf::Text (#414) -* sf::Rect::contains and sf::Rect::intersects now handle rectangles with negative dimensions correctly (#219) -* Fixed Shape::setTextureRect not working when called before setTexture - -Audio -===== - -Features --------- -* loadFromStream functions now explicitly reset the stream (seek(0)) before starting to read (#349) - -Bugfixes --------- -* Added a workaround for a bug in the OS X implementation of OpenAL (unsupported channel count no properly detected) (#201) -* Fixed SoundBuffer::loadFromStream reading past the end of the stream (#214) - -Network -======= - -Features --------- -* Replaced the deprecated gethostbyname with getaddrinfo (#47) -* Minor improvements to sf::Packet operators (now using strlen and wcslen instead of explicit loops) (#118) - -Bugfixes --------- -* Fixed non-blocking connection with a sf::TcpSocket on Windows -* Fixed TCP packet data corruption in non-blocking mode (#402, #119) -* On Unix systems, a socket disconnection no longer stops the program with signal SIGPIPE (#72) - - - -SFML 2.0 -======== - -Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.0 - -No changelog available. Everything changed. - - - -Older Releases -============== - -See the website for changelogs of older releases: http://www.sfml-dev.org/changelog.php diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 08c83ef9..ec382089 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -1,5 +1,5 @@ # detect the OS -if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set(SFML_OS_WINDOWS 1) # don't use the OpenGL ES implementation on Windows @@ -8,15 +8,15 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") # detect the architecture (note: this test won't work for cross-compilation) include(CheckTypeSize) check_type_size(void* SIZEOF_VOID_PTR) - if("${SIZEOF_VOID_PTR}" STREQUAL "4") + if(${SIZEOF_VOID_PTR} STREQUAL "4") set(ARCH_32BITS 1) - elseif("${SIZEOF_VOID_PTR}" STREQUAL "8") + elseif(${SIZEOF_VOID_PTR} STREQUAL "8") set(ARCH_64BITS 1) else() message(FATAL_ERROR "Unsupported architecture") return() endif() -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(SFML_OS_UNIX 1) if(ANDROID) set(SFML_OS_ANDROID 1) @@ -27,22 +27,18 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # don't use the OpenGL ES implementation on Linux set(OPENGL_ES 0) endif() -elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") +elseif(CMAKE_SYSTEM_NAME MATCHES "^k?FreeBSD$") set(SFML_OS_FREEBSD 1) # don't use the OpenGL ES implementation on FreeBSD set(OPENGL_ES 0) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +elseif(CMAKE_SYSTEM_NAME MATCHES "^OpenBSD$") + set(SFML_OS_OPENBSD 1) + # don't use the OpenGL ES implementation on OpenBSD + set(OPENGL_ES 0) +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") if(IOS) set(SFML_OS_IOS 1) - # set the target framework and platforms - set(CMAKE_OSX_SYSROOT "iphoneos") - set(CMAKE_OSX_ARCHITECTURES "armv6;armv7;i386") - set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator") - - # help the compiler detection script below - set(CMAKE_COMPILER_IS_GNUCXX 1) - # use the OpenGL ES implementation on iOS set(OPENGL_ES 1) else() @@ -59,20 +55,32 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") return() endif() endif() -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(SFML_OS_ANDROID 1) # use the OpenGL ES implementation on Android set(OPENGL_ES 1) +# comparing CMAKE_SYSTEM_NAME with "CYGWIN" generates a false warning depending on the CMake version +# let's avoid it so the actual error is more visible +elseif(${CYGWIN}) + message(FATAL_ERROR "Unfortunately SFML doesn't support Cygwin's 'hybrid' status between both Windows and Linux derivatives.\nIf you insist on using the GCC, please use a standalone build of MinGW without the Cygwin environment instead.") else() - message(FATAL_ERROR "Unsupported operating system") + message(FATAL_ERROR "Unsupported operating system or environment") return() endif() +# set pkgconfig install directory +# this could be e.g. macports on mac or msys2 on windows etc. +set(SFML_PKGCONFIG_DIR "/${CMAKE_INSTALL_LIBDIR}/pkgconfig") + +if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD) + set(SFML_PKGCONFIG_DIR "/libdata/pkgconfig") +endif() + # detect the compiler and its version # Note: on some platforms (OS X), CMAKE_COMPILER_IS_GNUCXX is true # even when CLANG is used, therefore the Clang test is done first -if(CMAKE_CXX_COMPILER MATCHES ".*clang[+][+]" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if(CMAKE_CXX_COMPILER MATCHES "clang[+][+]" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # CMAKE_CXX_COMPILER_ID is an internal CMake variable subject to change, # but there is no other way to detect CLang at the moment set(SFML_COMPILER_CLANG 1) @@ -86,7 +94,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) string(REGEX MATCHALL ".*(tdm[64]*-[1-9]).*" SFML_COMPILER_GCC_TDM "${GCC_COMPILER_VERSION}") execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpmachine" OUTPUT_VARIABLE GCC_MACHINE) string(STRIP "${GCC_MACHINE}" GCC_MACHINE) - if(${GCC_MACHINE} MATCHES ".*w64.*") + if(GCC_MACHINE MATCHES ".*w64.*") set(SFML_COMPILER_GCC_W64 1) endif() elseif(MSVC) @@ -101,17 +109,10 @@ elseif(MSVC) set(SFML_MSVC_VERSION 11) elseif(MSVC_VERSION EQUAL 1800) set(SFML_MSVC_VERSION 12) + elseif(MSVC_VERSION EQUAL 1900) + set(SFML_MSVC_VERSION 14) endif() else() message(FATAL_ERROR "Unsupported compiler") return() endif() - -# define the install directory for miscellaneous files -if(SFML_OS_WINDOWS OR SFML_OS_IOS) - set(INSTALL_MISC_DIR .) -elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_MACOSX) - set(INSTALL_MISC_DIR share/SFML) -elseif(SFML_OS_ANDROID) - set(INSTALL_MISC_DIR ${ANDROID_NDK}/sources/sfml) -endif() diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 0cf88266..36fc5bab 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -1,17 +1,67 @@ include(CMakeParseArguments) +# This little macro lets you set any Xcode specific property +macro (sfml_set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) +endmacro () + +# set the appropriate standard library on each platform for the given target +# example: sfml_set_stdlib(sfml-system) +function(sfml_set_stdlib target) + # for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled + if(SFML_OS_WINDOWS AND SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") + if(SFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM) + target_link_libraries(${target} PRIVATE "-static-libgcc" "-static-libstdc++") + elseif(NOT SFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM) + target_link_libraries(${target} PRIVATE "-shared-libgcc" "-shared-libstdc++") + endif() + endif() + + if (SFML_OS_MACOSX) + if (${CMAKE_GENERATOR} MATCHES "Xcode") + sfml_set_xcode_property(${target} CLANG_CXX_LIBRARY "libc++") + else() + target_compile_options(${target} PRIVATE "-stdlib=libc++") + target_link_libraries(${target} PRIVATE "-stdlib=libc++") + endif() + endif() +endfunction() + +function(sfml_set_common_ios_properties target) + # enable automatic reference counting on iOS + sfml_set_xcode_property(${target} CLANG_ENABLE_OBJC_ARC YES) + sfml_set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "${SFML_IOS_DEPLOYMENT_TARGET}") + sfml_set_xcode_property(${target} CODE_SIGN_IDENTITY "${SFML_CODE_SIGN_IDENTITY}") + + get_target_property(target_type ${target} TYPE) + if (target_type STREQUAL "EXECUTABLE") + set_target_properties(${target} PROPERTIES + MACOSX_BUNDLE TRUE # Bare executables are not usable on iOS, only bundle applications + MACOSX_BUNDLE_GUI_IDENTIFIER "org.sfml-dev.${target}" # If missing, trying to launch an example in simulator will make Xcode < 9.3 crash + MACOSX_BUNDLE_BUNDLE_NAME "${target}" + MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" + ) + endif() +endfunction() + # add a new target which is a SFML library -# ex: sfml_add_library(sfml-graphics -# SOURCES sprite.cpp image.cpp ... -# DEPENDS sfml-window sfml-system -# EXTERNAL_LIBS opengl freetype ...) +# example: sfml_add_library(sfml-graphics +# SOURCES sprite.cpp image.cpp ... +# [STATIC]) # Always create a static library and ignore BUILD_SHARED_LIBS macro(sfml_add_library target) # parse the arguments - cmake_parse_arguments(THIS "" "" "SOURCES;DEPENDS;EXTERNAL_LIBS" ${ARGN}) + cmake_parse_arguments(THIS "STATIC" "" "SOURCES" ${ARGN}) + if (NOT "${THIS_UNPARSED_ARGUMENTS}" STREQUAL "") + message(FATAL_ERROR "Extra unparsed arguments when calling sfml_add_library: ${THIS_UNPARSED_ARGUMENTS}") + endif() # create the target - add_library(${target} ${THIS_SOURCES}) + if (THIS_STATIC) + add_library(${target} STATIC ${THIS_SOURCES}) + else() + add_library(${target} ${THIS_SOURCES}) + endif() # define the export symbol of the module string(REPLACE "-" "_" NAME_UPPER "${target}") @@ -19,7 +69,7 @@ macro(sfml_add_library target) set_target_properties(${target} PROPERTIES DEFINE_SYMBOL ${NAME_UPPER}_EXPORTS) # adjust the output file prefix/suffix to match our conventions - if(BUILD_SHARED_LIBS) + if(BUILD_SHARED_LIBS AND NOT THIS_STATIC) if(SFML_OS_WINDOWS) # include the major version number in Windows shared library names (but not import library names) set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) @@ -37,6 +87,7 @@ macro(sfml_add_library target) set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -s-d) set_target_properties(${target} PROPERTIES RELEASE_POSTFIX -s) set_target_properties(${target} PROPERTIES MINSIZEREL_POSTFIX -s) + set_target_properties(${target} PROPERTIES RELWITHDEBINFO_POSTFIX -s) endif() # set the version and soversion of the target (for compatible systems -- mostly Linuxes) @@ -49,12 +100,28 @@ macro(sfml_add_library target) # set the target's folder (for IDEs that support it, e.g. Visual Studio) set_target_properties(${target} PROPERTIES FOLDER "SFML") - # for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled - if(SFML_OS_WINDOWS AND SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") - if(SFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM) - set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++") - elseif(NOT SFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM) - set_target_properties(${target} PROPERTIES LINK_FLAGS "-shared-libgcc -shared-libstdc++") + # set the target flags to use the appropriate C++ standard library + sfml_set_stdlib(${target}) + + # For Visual Studio on Windows, export debug symbols (PDB files) to lib directory + if(SFML_GENERATE_PDB) + # PDB files are only generated in Debug and RelWithDebInfo configurations, find out which one + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(SFML_PDB_POSTFIX "-d") + else() + set(SFML_PDB_POSTFIX "") + endif() + + if(BUILD_SHARED_LIBS AND NOT THIS_STATIC) + # DLLs export debug symbols in the linker PDB (the compiler PDB is an intermediate file) + set_target_properties(${target} PROPERTIES + PDB_NAME "${target}${SFML_PDB_POSTFIX}" + PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") + else() + # Static libraries have no linker PDBs, thus the compiler PDBs are relevant + set_target_properties(${target} PROPERTIES + COMPILE_PDB_NAME "${target}-s${SFML_PDB_POSTFIX}" + COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") endif() endif() @@ -64,13 +131,8 @@ macro(sfml_add_library target) set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden) endif() - # link the target to its SFML dependencies - if(THIS_DEPENDS) - target_link_libraries(${target} ${THIS_DEPENDS}) - endif() - # build frameworks or dylibs - if(SFML_OS_MACOSX AND BUILD_SHARED_LIBS) + if(SFML_OS_MACOSX AND BUILD_SHARED_LIBS AND NOT THIS_STATIC) if(SFML_BUILD_FRAMEWORKS) # adapt target to build frameworks instead of dylibs set_target_properties(${target} PROPERTIES @@ -82,14 +144,21 @@ macro(sfml_add_library target) endif() # adapt install directory to allow distributing dylibs/frameworks in user's frameworks/application bundle - set_target_properties(${target} PROPERTIES - BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@rpath") + # but only if cmake rpath options aren't set + if(NOT CMAKE_SKIP_RPATH AND NOT CMAKE_SKIP_INSTALL_RPATH AND NOT CMAKE_INSTALL_RPATH AND NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH AND NOT CMAKE_INSTALL_NAME_DIR) + set_target_properties(${target} PROPERTIES INSTALL_NAME_DIR "@rpath") + if(NOT CMAKE_SKIP_BUILD_RPATH) + if (CMAKE_VERSION VERSION_LESS 3.9) + set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) + else() + set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE) + endif() + endif() + endif() endif() - # enable automatic reference counting on iOS if (SFML_OS_IOS) - set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) + sfml_set_common_ios_properties(${target}) endif() # sfml-activity library is our bootstrap activity and must not depend on stlport_shared @@ -104,37 +173,71 @@ macro(sfml_add_library target) endif() endif() - # link the target to its external dependencies - if(THIS_EXTERNAL_LIBS) - target_link_libraries(${target} ${THIS_EXTERNAL_LIBS}) + # add the install rule + install(TARGETS ${target} EXPORT SFMLConfigExport + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT bin + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + FRAMEWORK DESTINATION "." COMPONENT bin) + + # add /include as public include directory + target_include_directories(${target} + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/src) + + if (SFML_BUILD_FRAMEWORKS) + target_include_directories(${target} INTERFACE $) + else() + target_include_directories(${target} INTERFACE $) + endif() + + # define SFML_STATIC if the build type is not set to 'shared' + if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(${target} PUBLIC "SFML_STATIC") endif() - # add the install rule - install(TARGETS ${target} - RUNTIME DESTINATION bin COMPONENT bin - LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT bin - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel - FRAMEWORK DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX} COMPONENT bin) endmacro() # add a new target which is a SFML example -# ex: sfml_add_example(ftp -# SOURCES ftp.cpp ... -# DEPENDS sfml-network sfml-system) +# example: sfml_add_example(ftp +# SOURCES ftp.cpp ... +# BUNDLE_RESOURCES MainMenu.nib ... # Files to be added in target but not installed next to the executable +# DEPENDS sfml-network +# RESOURCES_DIR resources) # A directory to install next to the executable and sources macro(sfml_add_example target) # parse the arguments - cmake_parse_arguments(THIS "GUI_APP" "" "SOURCES;DEPENDS" ${ARGN}) + cmake_parse_arguments(THIS "GUI_APP" "RESOURCES_DIR" "SOURCES;BUNDLE_RESOURCES;DEPENDS" ${ARGN}) # set a source group for the source files source_group("" FILES ${THIS_SOURCES}) + # check whether resources must be added in target + set(target_input ${THIS_SOURCES}) + if(THIS_BUNDLE_RESOURCES) + set(target_input ${target_input} ${THIS_BUNDLE_RESOURCES}) + endif() + # create the target if(THIS_GUI_APP AND SFML_OS_WINDOWS AND NOT DEFINED CMAKE_CONFIGURATION_TYPES AND ${CMAKE_BUILD_TYPE} STREQUAL "Release") - add_executable(${target} WIN32 ${THIS_SOURCES}) - target_link_libraries(${target} sfml-main) + add_executable(${target} WIN32 ${target_input}) + target_link_libraries(${target} PRIVATE sfml-main) + elseif(THIS_GUI_APP AND SFML_OS_IOS) + + # For iOS apps we need the launch screen storyboard, + # and a custom info.plist to use it + SET(LAUNCH_SCREEN "${CMAKE_SOURCE_DIR}/examples/assets/LaunchScreen.storyboard") + SET(LOGO "${CMAKE_SOURCE_DIR}/examples/assets/logo.png") + SET(INFO_PLIST "${CMAKE_SOURCE_DIR}/examples/assets/info.plist") + SET(ICONS "${CMAKE_SOURCE_DIR}/examples/assets/icon.icns") + add_executable(${target} MACOSX_BUNDLE ${target_input} ${LAUNCH_SCREEN} ${LOGO} ${ICONS}) + set(RESOURCES ${LAUNCH_SCREEN} ${LOGO} ${ICONS}) + set_target_properties(${target} PROPERTIES RESOURCE "${RESOURCES}" + MACOSX_BUNDLE_INFO_PLIST ${INFO_PLIST} + MACOSX_BUNDLE_ICON_FILE icon.icns) + target_link_libraries(${target} PRIVATE sfml-main) else() - add_executable(${target} ${THIS_SOURCES}) + add_executable(${target} ${target_input}) endif() # set the debug suffix @@ -143,61 +246,182 @@ macro(sfml_add_example target) # set the target's folder (for IDEs that support it, e.g. Visual Studio) set_target_properties(${target} PROPERTIES FOLDER "Examples") - # for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled - if(SFML_OS_WINDOWS AND SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") - if(SFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM) - set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++") - elseif(NOT SFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM) - set_target_properties(${target} PROPERTIES LINK_FLAGS "-shared-libgcc -shared-libstdc++") - endif() - endif() + # set the target flags to use the appropriate C++ standard library + sfml_set_stdlib(${target}) + + # set the Visual Studio startup path for debugging + set_target_properties(${target} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) # link the target to its SFML dependencies if(THIS_DEPENDS) - target_link_libraries(${target} ${THIS_DEPENDS}) + target_link_libraries(${target} PRIVATE ${THIS_DEPENDS}) endif() - # add the install rule - install(TARGETS ${target} - RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples - BUNDLE DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples) - - # install the example's source code - install(FILES ${THIS_SOURCES} - DESTINATION ${INSTALL_MISC_DIR}/examples/${target} - COMPONENT examples) - - # install the example's resources as well - set(EXAMPLE_RESOURCES "${CMAKE_SOURCE_DIR}/examples/${target}/resources") - if(EXISTS ${EXAMPLE_RESOURCES}) - install(DIRECTORY ${EXAMPLE_RESOURCES} - DESTINATION ${INSTALL_MISC_DIR}/examples/${target} - COMPONENT examples) + if (SFML_OS_IOS) + sfml_set_common_ios_properties(${target}) endif() endmacro() -# macro to find packages on the host OS -# this is the same as in the toolchain file, which is here for Nsight Tegra VS -# since it won't use the Android toolchain file -if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") - macro(find_host_package) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) - if(CMAKE_HOST_WIN32) - set(WIN32 1) - set(UNIX) - elseif(CMAKE_HOST_APPLE) - set(APPLE 1) - set(UNIX) - endif() - find_package(${ARGN}) - set(WIN32) - set(APPLE) - set(UNIX 1) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - endmacro() -endif() +# add a new target which is a SFML test +# example: sfml_add_test(sfml-test +# ftp.cpp ... +# sfml-network) +function(sfml_add_test target SOURCES DEPENDS) + + # set a source group for the source files + source_group("" FILES ${SOURCES}) + + # create the target + add_executable(${target} ${SOURCES}) + + # set the target's folder (for IDEs that support it, e.g. Visual Studio) + set_target_properties(${target} PROPERTIES FOLDER "Tests") + + # link the target to its SFML dependencies + if(DEPENDS) + target_link_libraries(${target} PRIVATE ${DEPENDS}) + endif() + + # Add the test + add_test(${target} ${target}) + + # If building shared libs on windows we must copy the dependencies into the folder + if (WIN32 AND BUILD_SHARED_LIBS) + foreach (DEPENDENCY ${DEPENDS}) + add_custom_command(TARGET ${target} PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + $ + $) + endforeach() + endif() +endfunction() + +# Create an interface library for an external dependency. This virtual target can provide +# link specifications and include directories to be used by dependees. +# The created INTERFACE library is tagged for export to be part of the generated SFMLConfig +# Usage: sfml_add_external(target_name +# [INCLUDE "extlibs/include"] +# [LINK "extlibs/libfoo/libfoo.a"]) +function(sfml_add_external) + list(GET ARGN 0 target) + list(REMOVE_AT ARGN 0) + + if (TARGET ${target}) + message(FATAL_ERROR "Target '${target}' is already defined") + endif() + + cmake_parse_arguments(THIS "" "" "INCLUDE;LINK" ${ARGN}) + if (THIS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown arguments when calling sfml_import_library: ${THIS_UNPARSED_ARGUMENTS}") + endif() + + add_library(${target} INTERFACE) + + if (THIS_INCLUDE) + foreach(include_dir IN LISTS THIS_INCLUDE) + if (NOT include_dir) + message(FATAL_ERROR "No path given for include dir ${THIS_INCLUDE}") + endif() + target_include_directories(${target} INTERFACE "$") + endforeach() + endif() + + if (THIS_LINK) + foreach(link_item IN LISTS THIS_LINK) + if (NOT link_item) + message(FATAL_ERROR "Missing item in ${THIS_LINK}") + endif() + target_link_libraries(${target} INTERFACE "$") + endforeach() + endif() + + install(TARGETS ${target} EXPORT SFMLConfigExport) +endfunction() + +# Find the requested package and make an INTERFACE library from it +# The created INTERFACE library is tagged for export to be part of the generated SFMLConfig +# Usage: sfml_find_package(wanted_target_name +# [INCLUDE "OPENGL_INCLUDE_DIR"] +# [LINK "OPENGL_gl_LIBRARY"]) +function(sfml_find_package) + list(GET ARGN 0 target) + list(REMOVE_AT ARGN 0) + + if (TARGET ${target}) + message(FATAL_ERROR "Target '${target}' is already defined") + endif() + + cmake_parse_arguments(THIS "" "" "INCLUDE;LINK" ${ARGN}) + if (THIS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown arguments when calling sfml_import_library: ${THIS_UNPARSED_ARGUMENTS}") + endif() + + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") + if (SFML_OS_IOS) + find_host_package(${target} REQUIRED) + else() + find_package(${target} REQUIRED) + endif() + + # Make sure to interpret the items in INCLUDE and LINK parameters. sfml_add_external() + # does not interpret given items in order to also accept parameters that must not be interpreted + set(LINK_LIST "") + if (THIS_LINK) + foreach(link_item IN LISTS THIS_LINK) + list(APPEND LINK_LIST "${${link_item}}") + endforeach() + endif() + + set(INCLUDE_LIST "") + if (THIS_INCLUDE) + foreach(include_dir IN LISTS THIS_INCLUDE) + list(APPEND INCLUDE_LIST "${${include_dir}}") + endforeach() + endif() + + sfml_add_external(${target} INCLUDE ${INCLUDE_LIST} LINK ${LINK_LIST}) +endfunction() + +# Generate a SFMLConfig.cmake file (and associated files) from the targets registered against +# the EXPORT name "SFMLConfigExport" (EXPORT parameter of install(TARGETS)) +function(sfml_export_targets) + # CMAKE_CURRENT_LIST_DIR or CMAKE_CURRENT_SOURCE_DIR not usable for files that are to be included like this one + set(CURRENT_DIR "${PROJECT_SOURCE_DIR}/cmake") + + include(CMakePackageConfigHelpers) + write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/SFMLConfigVersion.cmake" + VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} + COMPATIBILITY SameMajorVersion) + + if (BUILD_SHARED_LIBS) + set(config_name "Shared") + else() + set(config_name "Static") + endif() + set(targets_config_filename "SFML${config_name}Targets.cmake") + + export(EXPORT SFMLConfigExport + FILE "${CMAKE_CURRENT_BINARY_DIR}/${targets_config_filename}") + + if (SFML_BUILD_FRAMEWORKS) + set(config_package_location "SFML.framework/Resources/CMake") + else() + set(config_package_location ${CMAKE_INSTALL_LIBDIR}/cmake/SFML) + endif() + configure_package_config_file("${CURRENT_DIR}/SFMLConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfig.cmake" + INSTALL_DESTINATION "${config_package_location}") + configure_package_config_file("${CURRENT_DIR}/SFMLConfigDependencies.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfigDependencies.cmake" + INSTALL_DESTINATION "${config_package_location}") + + + install(EXPORT SFMLConfigExport + FILE ${targets_config_filename} + DESTINATION ${config_package_location}) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfigDependencies.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfigVersion.cmake" + DESTINATION ${config_package_location} + COMPONENT devel) +endfunction() diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake deleted file mode 100644 index 871f8662..00000000 --- a/cmake/Modules/FindSFML.cmake +++ /dev/null @@ -1,368 +0,0 @@ -# This script locates the SFML library -# ------------------------------------ -# -# Usage -# ----- -# -# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main). -# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing. -# example: -# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules -# -# You can enforce a specific version, either MAJOR.MINOR or only MAJOR. -# If nothing is specified, the version won't be checked (i.e. any version will be accepted). -# example: -# find_package(SFML COMPONENTS ...) // no specific version required -# find_package(SFML 2 COMPONENTS ...) // any 2.x version -# find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater -# -# By default, the dynamic libraries of SFML will be found. To find the static ones instead, -# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). -# Since you have to link yourself all the SFML dependencies when you link it statically, the following -# additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed -# description below). -# In case of static linking, the SFML_STATIC macro will also be defined by this script. -# example: -# set(SFML_STATIC_LIBRARIES TRUE) -# find_package(SFML 2 COMPONENTS network system) -# -# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless -# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details. -# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which -# are available for both release and debug modes. -# -# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable -# to tell CMake where SFML is. -# -# Output -# ------ -# -# This script defines the following variables: -# - For each specified module XXX (system, window, graphics, network, audio, main): -# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found) -# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found) -# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary) -# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found -# - SFML_XXX_DEPENDENCIES: the list of libraries the module depends on, in case of static linking -# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules -# - SFML_FOUND: true if all the required modules are found -# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file) -# - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking -# -# example: -# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED) -# include_directories(${SFML_INCLUDE_DIR}) -# add_executable(myapp ...) -# target_link_libraries(myapp ${SFML_LIBRARIES}) - -# define the SFML_STATIC macro if static build was chosen -if(SFML_STATIC_LIBRARIES) - add_definitions(-DSFML_STATIC) -endif() - -# define the list of search paths for headers and libraries -set(FIND_SFML_PATHS - ${SFML_ROOT} - $ENV{SFML_ROOT} - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt) - -# find the SFML include directory -find_path(SFML_INCLUDE_DIR SFML/Config.hpp - PATH_SUFFIXES include - PATHS ${FIND_SFML_PATHS}) - -# check the version number -set(SFML_VERSION_OK TRUE) -if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR) - # extract the major and minor version numbers from SFML/Config.hpp - # we have to handle framework a little bit differently: - if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework") - set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp") - else() - set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp") - endif() - FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS) - STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}") - if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$") - set(SFML_VERSION_PATCH 0) - endif() - math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}") - - # if we could extract them, compare with the requested version number - if (SFML_VERSION_MAJOR) - # transform version numbers to an integer - math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}") - - # compare them - if(SFML_VERSION LESS SFML_REQUESTED_VERSION) - set(SFML_VERSION_OK FALSE) - endif() - else() - # SFML version is < 2.0 - if (SFML_REQUESTED_VERSION GREATER 10900) - set(SFML_VERSION_OK FALSE) - set(SFML_VERSION_MAJOR 1) - set(SFML_VERSION_MINOR x) - set(SFML_VERSION_PATCH x) - endif() - endif() -endif() - -# find the requested modules -set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found -foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS}) - string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER) - string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER) - set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}) - - # no suffix for sfml-main, it is always a static library - if(FIND_SFML_COMPONENT_LOWER STREQUAL "main") - # release library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE - NAMES ${FIND_SFML_COMPONENT_NAME} - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - - # debug library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG - NAMES ${FIND_SFML_COMPONENT_NAME}-d - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - else() - # static release library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE - NAMES ${FIND_SFML_COMPONENT_NAME}-s - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - - # static debug library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG - NAMES ${FIND_SFML_COMPONENT_NAME}-s-d - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - - # dynamic release library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE - NAMES ${FIND_SFML_COMPONENT_NAME} - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - - # dynamic debug library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG - NAMES ${FIND_SFML_COMPONENT_NAME}-d - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_PATHS}) - - # choose the entries that fit the requested link type - if(SFML_STATIC_LIBRARIES) - if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE}) - endif() - if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG}) - endif() - else() - if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE}) - endif() - if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG}) - endif() - endif() - endif() - - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - # library found - set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE) - - # if both are found, set SFML_XXX_LIBRARY to contain both - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG} - optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - endif() - - # if only one debug/release variant is found, set the other to be equal to the found one - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - # debug and not release - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}) - endif() - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG) - # release and not debug - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - endif() - else() - # library not found - set(SFML_FOUND FALSE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "") - set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY") - endif() - - # mark as advanced - MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG) - - # add to the global list of libraries - set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}") -endforeach() - -# in case of static linking, we must also define the list of all the dependencies of SFML libraries -if(SFML_STATIC_LIBRARIES) - - # detect the OS - if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(FIND_SFML_OS_WINDOWS 1) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(FIND_SFML_OS_LINUX 1) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - set(FIND_SFML_OS_FREEBSD 1) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(FIND_SFML_OS_MACOSX 1) - endif() - - # start with an empty list - set(SFML_DEPENDENCIES) - set(FIND_SFML_DEPENDENCIES_NOTFOUND) - - # macro that searches for a 3rd-party library - macro(find_sfml_dependency output friendlyname) - # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions - find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH) - if(${${output}} STREQUAL "${output}-NOTFOUND") - unset(output) - set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}") - endif() - endmacro() - - # sfml-system - list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT) - if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1) - - # update the list -- these are only system libraries, no need to find them - if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX) - set(SFML_SYSTEM_DEPENDENCIES "pthread") - endif() - if(FIND_SFML_OS_LINUX) - set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt") - endif() - if(FIND_SFML_OS_WINDOWS) - set(SFML_SYSTEM_DEPENDENCIES "winmm") - endif() - set(SFML_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} ${SFML_DEPENDENCIES}) - endif() - - # sfml-network - list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT) - if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1) - - # update the list -- these are only system libraries, no need to find them - if(FIND_SFML_OS_WINDOWS) - set(SFML_NETWORK_DEPENDENCIES "ws2_32") - endif() - set(SFML_DEPENDENCIES ${SFML_NETWORK_DEPENDENCIES} ${SFML_DEPENDENCIES}) - endif() - - # sfml-window - list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT) - if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1) - - # find libraries - if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) - find_sfml_dependency(X11_LIBRARY "X11" X11) - find_sfml_dependency(LIBXCB_LIBRARIES "XCB" xcb libxcb) - find_sfml_dependency(X11_XCB_LIBRARY "X11-xcb" X11-xcb libX11-xcb) - find_sfml_dependency(XCB_RANDR_LIBRARY "xcb-randr" xcb-randr libxcb-randr) - find_sfml_dependency(XCB_IMAGE_LIBRARY "xcb-image" xcb-image libxcb-image) - endif() - - if(FIND_SFML_OS_LINUX) - find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev) - endif() - - # update the list - if(FIND_SFML_OS_WINDOWS) - set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32") - elseif(FIND_SFML_OS_LINUX) - set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} ${UDEV_LIBRARIES}) - elseif(FIND_SFML_OS_FREEBSD) - set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} "usbhid") - elseif(FIND_SFML_OS_MACOSX) - set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon") - endif() - set(SFML_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${SFML_DEPENDENCIES}) - endif() - - # sfml-graphics - list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT) - if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1) - - # find libraries - find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype) - find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg) - - # update the list - set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) - set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES}) - endif() - - # sfml-audio - list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT) - if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1) - - # find libraries - find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32) - find_sfml_dependency(OGG_LIBRARY "Ogg" ogg) - find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis) - find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile) - find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc) - find_sfml_dependency(FLAC_LIBRARY "FLAC" FLAC) - - # update the list - set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY}) - set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES}) - endif() - -endif() - -# handle errors -if(NOT SFML_VERSION_OK) - # SFML version not ok - set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH})") - set(SFML_FOUND FALSE) -elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND) - set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})") - set(SFML_FOUND FALSE) -elseif(NOT SFML_FOUND) - # include directory or library not found - set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})") -endif() -if (NOT SFML_FOUND) - if(SFML_FIND_REQUIRED) - # fatal error - message(FATAL_ERROR ${FIND_SFML_ERROR}) - elseif(NOT SFML_FIND_QUIETLY) - # error but continue - message("${FIND_SFML_ERROR}") - endif() -endif() - -# handle success -if(SFML_FOUND AND NOT SFML_FIND_QUIETLY) - message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}") -endif() diff --git a/cmake/Modules/FindUDev.cmake b/cmake/Modules/FindUDev.cmake index 9ae3cf80..467bd693 100644 --- a/cmake/Modules/FindUDev.cmake +++ b/cmake/Modules/FindUDev.cmake @@ -50,3 +50,4 @@ ELSE (UDEV_FOUND) ENDIF (UDev_FIND_REQUIRED) ENDIF (UDEV_FOUND) +mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARIES) diff --git a/cmake/Modules/FindVorbis.cmake b/cmake/Modules/FindVORBIS.cmake similarity index 63% rename from cmake/Modules/FindVorbis.cmake rename to cmake/Modules/FindVORBIS.cmake index 645bba76..e285411a 100644 --- a/cmake/Modules/FindVorbis.cmake +++ b/cmake/Modules/FindVORBIS.cmake @@ -12,13 +12,18 @@ find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) find_library(OGG_LIBRARY NAMES ogg) find_library(VORBIS_LIBRARY NAMES vorbis) -find_library(VORBISFILE_LIBRARY NAMES vorbisfile) -find_library(VORBISENC_LIBRARY NAMES vorbisenc) +if (NOT SFML_OS_IOS) + find_library(VORBISFILE_LIBRARY NAMES vorbisfile) + find_library(VORBISENC_LIBRARY NAMES vorbisenc) + set(VORBIS_LIBRARIES ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY}) +else() + set(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${OGG_LIBRARY}) +endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY OGG_LIBRARY VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR) + +find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_LIBRARIES VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR) set(VORBIS_INCLUDE_DIRS ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR}) -set(VORBIS_LIBRARIES ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY}) mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY) diff --git a/cmake/Modules/FindXCB.cmake b/cmake/Modules/FindXCB.cmake deleted file mode 100644 index d6914610..00000000 --- a/cmake/Modules/FindXCB.cmake +++ /dev/null @@ -1,97 +0,0 @@ -# Try to find libxcb -# -# -# Once done this will define: -# LIBXCB_FOUND - True if xcb was found -# LIBXCB_INCLUDE_DIRS - Directories containing the headers -# LIBXCB_LIBRARIES - List of libraries to link to -# -# Also for each requested component: -# LIBXCB_${UPPER_COMPONENT_NAME}_FOUND -# LIBXCB_${UPPER_COMPONENT_NAME}_INCLUDE_DIRS -# LIBXCB_${UPPER_COMPONENT_NAME}_LIBRARIES - -include(FindPackageHandleStandardArgs) - -IF(NOT WIN32) - IF(LIBXCB_LIBRARIES AND LIBXCB_INCLUDE_DIR) - set(XCB_FIND_QUIETLY TRUE) - ENDIF() - - # Find xcb - FIND_PATH(LIBXCB_INCLUDE_DIR xcb/xcb.h) - FIND_LIBRARY(LIBXCB_LIBRARY NAMES xcb libxcb) - - # Add xcb info to LIBXCB_LIBRARIES and LIBXCB_INCLUDE_DIRS - SET(LIBXCB_LIBRARIES ${LIBXCB_LIBRARY}) - SET(LIBXCB_INCLUDE_DIRS ${LIBXCB_INCLUDE_DIR}) - - find_package_handle_standard_args(LIBXCB DEFAULT_MSG - LIBXCB_LIBRARY LIBXCB_INCLUDE_DIR) - - mark_as_advanced(LIBXCB_LIBRARY LIBXCB_INCLUDE_DIR) - - # Check whether we should search for XLIB_XCB - set(FIND_XLIB_XCB FALSE) - FOREACH(XCB_COMPONENT ${XCB_FIND_COMPONENTS}) - # Generate upper string of the component name - string(TOUPPER ${XCB_COMPONENT} XCB_COMPONENT_UPPER) - - IF(${XCB_COMPONENT_UPPER} MATCHES "XLIB_XCB") - set(FIND_XLIB_XCB TRUE) - ELSE() - # XCB_COMPONENTS is generated to be a copy of XCB_FIND_COMPONENTS - # without XLIB_XCB (for later component search) - set(XCB_COMPONENTS ${XCB_COMPONENTS} ${XCB_COMPONENT}) - ENDIF() - ENDFOREACH() - - # Find XLIB_XCB if requested - IF(FIND_XLIB_XCB) - FIND_PATH(XLIB_XCB_INCLUDE_DIR X11/Xlib-xcb.h) - FIND_LIBRARY(XLIB_XCB_LIBRARY NAMES X11-xcb libX11-xcb) - - SET(XLIB_XCB_LIBRARIES ${XLIB_XCB_LIBRARY}) - SET(XLIB_XCB_INCLUDE_DIRS ${XLIB_XCB_INCLUDE_DIR}) - - find_package_handle_standard_args(XLIB_XCB DEFAULT_MSG - XLIB_XCB_LIBRARY LIBXCB_INCLUDE_DIR) - - mark_as_advanced(XLIB_XCB_LIBRARY XLIB_XCB_INCLUDE_DIR) - - # Add xlib_xcb info to LIBXCB_LIBRARIES and LIBXCB_INCLUDE_DIRS - set(LIBXCB_LIBRARIES ${LIBXCB_LIBRARIES} ${XLIB_XCB_LIBRARIES}) - set(LIBXCB_INCLUDE_DIRS ${LIBXCB_INCLUDE_DIRS} ${XLIB_XCB_INCLUDE_DIR}) - - if(NOT XLIB_XCB_FOUND) - message(FATAL_ERROR "XlibXcb library not found") - endif() - ELSE() - # Add component name to the component list - set(${XCB_COMPONENTS} ${XCB_FIND_COMPONENTS}) - ENDIF() - - # Loop through requested xcb components (does not contain xlib_xcb) - FOREACH(XCB_COMPONENT ${XCB_COMPONENTS}) - # Generate lower and upper string of the component name - string(TOLOWER ${XCB_COMPONENT} XCB_COMPONENT_LOWER) - string(TOUPPER ${XCB_COMPONENT} XCB_COMPONENT_UPPER) - - # Find the specific component - FIND_LIBRARY(LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY - NAMES libxcb-${XCB_COMPONENT_LOWER} xcb-${XCB_COMPONENT_LOWER}) - - find_package_handle_standard_args(LIBXCB_${XCB_COMPONENT_UPPER} DEFAULT_MSG - LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY LIBXCB_INCLUDE_DIR) - - mark_as_advanced(LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY) - - # Append the component's library path to LIBXCB_LIBRARIES - set(LIBXCB_LIBRARIES ${LIBXCB_LIBRARIES} ${LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY}) - - if(NOT LIBXCB_${XCB_COMPONENT_UPPER}_FOUND) - message(FATAL_ERROR "xcb-${XCB_COMPONENT_LOWER} not found") - endif() - ENDFOREACH() - -endif() diff --git a/cmake/SFMLConfig.cmake.in b/cmake/SFMLConfig.cmake.in new file mode 100644 index 00000000..86527b73 --- /dev/null +++ b/cmake/SFMLConfig.cmake.in @@ -0,0 +1,148 @@ +# This script provides the SFML libraries as imported targets +# ------------------------------------ +# +# Usage +# ----- +# +# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main). +# If none is given, no imported target will be created and you won't be able to link to SFML libraries. +# example: +# find_package(SFML COMPONENTS graphics window system) # find the graphics, window and system modules +# +# You can enforce a specific version, either MAJOR.MINOR or only MAJOR. +# If nothing is specified, the version won't be checked (i.e. any version will be accepted). +# example: +# find_package(SFML COMPONENTS ...) # no specific version required +# find_package(SFML 2 COMPONENTS ...) # any 2.x version +# find_package(SFML 2.4 COMPONENTS ...) # version 2.4 or greater +# +# By default, the dynamic libraries of SFML will be found. To find the static ones instead, +# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). +# You don't need to deal with SFML's dependencies when linking your targets against SFML libraries, +# they will all be configured automatically, even if you use SFML static libraries. +# example: +# set(SFML_STATIC_LIBRARIES TRUE) +# find_package(SFML 2 COMPONENTS network system) +# +# On macOS by default CMake will search for frameworks. If you want to use static libraries and have installed +# both SFML frameworks and SFML static libraries, your must set CMAKE_FIND_FRAMEWORK to "NEVER" or "LAST" +# in addition to setting SFML_STATIC_LIBRARIES to TRUE. Otherwise CMake will check the frameworks bundle config and +# fail after finding out that it does not provide static libraries. Please refer to CMake documentation for more details. +# +# Additionally, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which +# are available for both release and debug modes. +# +# If SFML is not installed in a standard path, you can use the SFML_DIR CMake variable +# to tell CMake where SFML's config file is located (PREFIX/lib/cmake/SFML for a library-based installation, +# and PREFIX/SFML.framework/Resources/CMake on macOS for a framework-based installation). +# +# Output +# ------ +# +# This script defines the following variables: +# - For each specified module XXX (system, window, graphics, network, audio, main): +# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found +# - SFML_FOUND: true if all the required modules are found +# +# And the following targets: +# - For each specified module XXX (system, window, graphics, network, audio, main): +# - sfml-XXX +# The SFML targets are the same for both Debug and Release build configurations and will automatically provide +# correct settings based on your currently active build configuration. The SFML targets name also do not change +# when using dynamic or static SFML libraries. +# +# When linking against a SFML target, you do not need to specify indirect dependencies. For example, linking +# against sfml-graphics will also automatically link against sfml-window and sfml-system. +# +# example: +# find_package(SFML 2 COMPONENTS graphics audio REQUIRED) +# add_executable(myapp ...) +# target_link_libraries(myapp sfml-graphics sfml-audio) + +if (NOT SFML_FIND_COMPONENTS) + message(FATAL_ERROR "find_package(SFML) called with no component") +endif() + +set(FIND_SFML_PATHS + "${CMAKE_CURRENT_LIST_DIR}/../.." + ${SFML_ROOT} + $ENV{SFML_ROOT} + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt) + +find_path(SFML_DOC_DIR SFML.tag + PATH_SUFFIXES SFML/doc share/doc/SFML + PATHS ${FIND_SFML_PATHS}) + + +# Update requested components (eg. request window component if graphics component was requested) +set(FIND_SFML_SYSTEM_DEPENDENCIES "") +set(FIND_SFML_MAIN_DEPENDENCIES "") +set(FIND_SFML_AUDIO_DEPENDENCIES system) +set(FIND_SFML_NETWORK_DEPENDENCIES system) +set(FIND_SFML_WINDOW_DEPENDENCIES system) +set(FIND_SFML_GRAPHICS_DEPENDENCIES window system) +set(FIND_SFML_ADDITIONAL_COMPONENTS "") +foreach(component ${SFML_FIND_COMPONENTS}) + string(TOUPPER "${component}" UPPER_COMPONENT) + list(APPEND FIND_SFML_ADDITIONAL_COMPONENTS ${FIND_SFML_${UPPER_COMPONENT}_DEPENDENCIES}) +endforeach() +list(APPEND SFML_FIND_COMPONENTS ${FIND_SFML_ADDITIONAL_COMPONENTS}) +list(REMOVE_DUPLICATES SFML_FIND_COMPONENTS) + +# Choose which target definitions must be imported +if (SFML_STATIC_LIBRARIES) + set(SFML_IS_FRAMEWORK_INSTALL "@SFML_BUILD_FRAMEWORKS@") + if (SFML_IS_FRAMEWORK_INSTALL) + message(WARNING "Static frameworks are not supported by SFML. Clear SFML_DIR cache entry, \ +and either change SFML_STATIC_LIBRARIES or CMAKE_FIND_FRAMEWORK before calling find_package(SFML)") + endif() + set(config_name "Static") +else() + set(config_name "Shared") +endif() +set(targets_config_file "${CMAKE_CURRENT_LIST_DIR}/SFML${config_name}Targets.cmake") + +# Generate imported targets for SFML and its dependencies +if (EXISTS "${targets_config_file}") + # Set SFML_FOUND to TRUE by default, may be overwritten by one of the includes below + set(SFML_FOUND TRUE) + include("${targets_config_file}") + include("${CMAKE_CURRENT_LIST_DIR}/SFMLConfigDependencies.cmake") + + if (SFML_FOUND) + foreach (component ${SFML_FIND_COMPONENTS}) + string(TOUPPER "${component}" UPPER_COMPONENT) + if (TARGET sfml-${component}) + set(SFML_${UPPER_COMPONENT}_FOUND TRUE) + else() + set(FIND_SFML_ERROR "Found SFML but requested component '${component}' is missing in the config defined in ${SFML_DIR}.") + set(SFML_${UPPER_COMPONENT}_FOUND FALSE) + set(SFML_FOUND FALSE) + endif() + endforeach() + endif() +else() + set(FIND_SFML_ERROR "Requested SFML configuration (${config_name}) was not found") + set(SFML_FOUND FALSE) +endif() + +if (NOT SFML_FOUND) + if(SFML_FIND_REQUIRED) + # fatal error + message(FATAL_ERROR "${FIND_SFML_ERROR}") + elseif(NOT SFML_FIND_QUIETLY) + # error but continue + message(STATUS "${FIND_SFML_ERROR}") + endif() +endif() + +if (SFML_FOUND AND NOT SFML_FIND_QUIETLY) + message(STATUS "Found SFML @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ in ${CMAKE_CURRENT_LIST_DIR}") +endif() diff --git a/cmake/SFMLConfigDependencies.cmake.in b/cmake/SFMLConfigDependencies.cmake.in new file mode 100644 index 00000000..c5813bd6 --- /dev/null +++ b/cmake/SFMLConfigDependencies.cmake.in @@ -0,0 +1,87 @@ + +if (CMAKE_VERSION VERSION_LESS 3.5.2) + include(CMakeParseArguments) +endif() + +# in case of static linking, we must also define the list of all the dependencies of SFML libraries +if(SFML_STATIC_LIBRARIES) + # detect the OS + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(FIND_SFML_OS_WINDOWS 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(FIND_SFML_OS_LINUX 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(FIND_SFML_OS_FREEBSD 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if (DEFINED IOS) + set(FIND_SFML_OS_IOS 1) + else() + set(FIND_SFML_OS_MACOSX 1) + endif() + endif() + + # start with an empty list + set(FIND_SFML_DEPENDENCIES_NOTFOUND) + + # macro that searches for a 3rd-party library + function(sfml_bind_dependency) + cmake_parse_arguments(THIS "" "TARGET;FRIENDLY_NAME" "SEARCH_NAMES" ${ARGN}) + if (THIS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown arguments when calling sfml_bind_dependency: ${THIS_UNPARSED_ARGUMENTS}") + endif() + + # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions + find_library(${THIS_FRIENDLY_NAME}_LIB NAMES ${THIS_SEARCH_NAMES} + PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH) + mark_as_advanced(${THIS_FRIENDLY_NAME}_LIB) + if(${THIS_FRIENDLY_NAME}_LIB) + set_property(TARGET ${THIS_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${${THIS_FRIENDLY_NAME}_LIB}") + else() + set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${THIS_FRIENDLY_NAME}" PARENT_SCOPE) + endif() + endfunction() + + # sfml-window + list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT_INDEX) + if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1) + if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11") + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr") + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xcursor" SEARCH_NAMES "Xcursor") + endif() + + if(FIND_SFML_OS_LINUX) + sfml_bind_dependency(TARGET UDev FRIENDLY_NAME "UDev" SEARCH_NAMES "udev" "libudev") + endif() + + if (FIND_SFML_OS_WINDOWS) + set_property(TARGET OpenGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "OpenGL32") + elseif(NOT FIND_SFML_OS_IOS) + sfml_bind_dependency(TARGET OpenGL FRIENDLY_NAME "OpenGL" SEARCH_NAMES "OpenGL" "GL") + endif() + endif() + + # sfml-graphics + list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT_INDEX) + if(FIND_SFML_GRAPHICS_COMPONENT_INDEX GREATER -1) + sfml_bind_dependency(TARGET Freetype FRIENDLY_NAME "FreeType" SEARCH_NAMES "freetype") + endif() + + # sfml-audio + list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT_INDEX) + if(FIND_SFML_AUDIO_COMPONENT_INDEX GREATER -1) + sfml_bind_dependency(TARGET OpenAL FRIENDLY_NAME "OpenAL" SEARCH_NAMES "OpenAL" "openal" "openal32") + if (NOT FIND_SFML_OS_IOS) + sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "VorbisFile" SEARCH_NAMES "vorbisfile") + sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "VorbisEnc" SEARCH_NAMES "vorbisenc") + endif() + sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "Vorbis" SEARCH_NAMES "vorbis") + sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "Ogg" SEARCH_NAMES "ogg") + sfml_bind_dependency(TARGET FLAC FRIENDLY_NAME "FLAC" SEARCH_NAMES "FLAC") + endif() + + if (FIND_SFML_DEPENDENCIES_NOTFOUND) + set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})") + set(SFML_FOUND FALSE) + endif() +endif() diff --git a/cmake/toolchains/android.toolchain.cmake b/cmake/toolchains/android.toolchain.cmake deleted file mode 100644 index 1eeebe57..00000000 --- a/cmake/toolchains/android.toolchain.cmake +++ /dev/null @@ -1,1712 +0,0 @@ -# Copyright (c) 2010-2011, Ethan Rublee -# Copyright (c) 2011-2014, Andrey Kamaev -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -# ------------------------------------------------------------------------------ -# Android CMake toolchain file, for use with the Android NDK r5-r10d -# Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended). -# See home page: https://github.com/taka-no-me/android-cmake -# -# Usage Linux: -# $ export ANDROID_NDK=/absolute/path/to/the/android-ndk -# $ mkdir build && cd build -# $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake .. -# $ make -j8 -# -# Usage Windows: -# You need native port of make to build your project. -# Android NDK r7 (and newer) already has make.exe on board. -# For older NDK you have to install it separately. -# For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm -# -# $ SET ANDROID_NDK=C:\absolute\path\to\the\android-ndk -# $ mkdir build && cd build -# $ cmake.exe -G"MinGW Makefiles" -# -DCMAKE_TOOLCHAIN_FILE=path\to\the\android.toolchain.cmake -# -DCMAKE_MAKE_PROGRAM="%ANDROID_NDK%\prebuilt\windows\bin\make.exe" .. -# $ cmake.exe --build . -# -# -# Options (can be set as cmake parameters: -D=): -# ANDROID_NDK=/opt/android-ndk - path to the NDK root. -# Can be set as environment variable. Can be set only at first cmake run. -# -# ANDROID_ABI=armeabi-v7a - specifies the target Application Binary -# Interface (ABI). This option nearly matches to the APP_ABI variable -# used by ndk-build tool from Android NDK. -# -# Possible targets are: -# "armeabi" - ARMv5TE based CPU with software floating point operations -# "armeabi-v7a" - ARMv7 based devices with hardware FPU instructions -# this ABI target is used by default -# "armeabi-v7a with NEON" - same as armeabi-v7a, but -# sets NEON as floating-point unit -# "armeabi-v7a with VFPV3" - same as armeabi-v7a, but -# sets VFPV3 as floating-point unit (has 32 registers instead of 16) -# "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP -# "x86" - IA-32 instruction set -# "mips" - MIPS32 instruction set -# -# 64-bit ABIs for NDK r10 and newer: -# "arm64-v8a" - ARMv8 AArch64 instruction set -# "x86_64" - Intel64 instruction set (r1) -# "mips64" - MIPS64 instruction set (r6) -# -# ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for. -# Option is read-only when standalone toolchain is used. -# Note: building for "android-L" requires explicit configuration. -# -# ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler -# toolchain to be used. The list of possible values depends on the NDK -# version. For NDK r10c the possible values are: -# -# * aarch64-linux-android-4.9 -# * aarch64-linux-android-clang3.4 -# * aarch64-linux-android-clang3.5 -# * arm-linux-androideabi-4.6 -# * arm-linux-androideabi-4.8 -# * arm-linux-androideabi-4.9 (default) -# * arm-linux-androideabi-clang3.4 -# * arm-linux-androideabi-clang3.5 -# * mips64el-linux-android-4.9 -# * mips64el-linux-android-clang3.4 -# * mips64el-linux-android-clang3.5 -# * mipsel-linux-android-4.6 -# * mipsel-linux-android-4.8 -# * mipsel-linux-android-4.9 -# * mipsel-linux-android-clang3.4 -# * mipsel-linux-android-clang3.5 -# * x86-4.6 -# * x86-4.8 -# * x86-4.9 -# * x86-clang3.4 -# * x86-clang3.5 -# * x86_64-4.9 -# * x86_64-clang3.4 -# * x86_64-clang3.5 -# -# ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions -# instead of Thumb. Is not available for "armeabi-v6 with VFP" -# (is forced to be ON) ABI. -# -# ANDROID_NO_UNDEFINED=ON - set ON to show all undefined symbols as linker -# errors even if they are not used. -# -# ANDROID_SO_UNDEFINED=OFF - set ON to allow undefined symbols in shared -# libraries. Automatically turned for NDK r5x and r6x due to GLESv2 -# problems. -# -# ANDROID_STL=gnustl_static - specify the runtime to use. -# -# Possible values are: -# none -> Do not configure the runtime. -# system -> Use the default minimal system C++ runtime library. -# Implies -fno-rtti -fno-exceptions. -# Is not available for standalone toolchain. -# system_re -> Use the default minimal system C++ runtime library. -# Implies -frtti -fexceptions. -# Is not available for standalone toolchain. -# gabi++_static -> Use the GAbi++ runtime as a static library. -# Implies -frtti -fno-exceptions. -# Available for NDK r7 and newer. -# Is not available for standalone toolchain. -# gabi++_shared -> Use the GAbi++ runtime as a shared library. -# Implies -frtti -fno-exceptions. -# Available for NDK r7 and newer. -# Is not available for standalone toolchain. -# stlport_static -> Use the STLport runtime as a static library. -# Implies -fno-rtti -fno-exceptions for NDK before r7. -# Implies -frtti -fno-exceptions for NDK r7 and newer. -# Is not available for standalone toolchain. -# stlport_shared -> Use the STLport runtime as a shared library. -# Implies -fno-rtti -fno-exceptions for NDK before r7. -# Implies -frtti -fno-exceptions for NDK r7 and newer. -# Is not available for standalone toolchain. -# gnustl_static -> Use the GNU STL as a static library. -# Implies -frtti -fexceptions. -# gnustl_shared -> Use the GNU STL as a shared library. -# Implies -frtti -fno-exceptions. -# Available for NDK r7b and newer. -# Silently degrades to gnustl_static if not available. -# c++_static -> Use libc++ as a static library. -# c++_shared -> Use libc++ as a shared library. -# -# ANDROID_STL_FORCE_FEATURES=ON - turn rtti and exceptions support based on -# chosen runtime. If disabled, then the user is responsible for settings -# these options. -# -# What?: -# android-cmake toolchain searches for NDK/toolchain in the following order: -# ANDROID_NDK - cmake parameter -# ANDROID_NDK - environment variable -# ANDROID_STANDALONE_TOOLCHAIN - cmake parameter -# ANDROID_STANDALONE_TOOLCHAIN - environment variable -# ANDROID_NDK - default locations -# ANDROID_STANDALONE_TOOLCHAIN - default locations -# -# Make sure to do the following in your scripts: -# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" ) -# SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" ) -# The flags will be prepopulated with critical flags, so don't loose them. -# Also be aware that toolchain also sets configuration-specific compiler -# flags and linker flags. -# -# ANDROID and BUILD_ANDROID will be set to true, you may test any of these -# variables to make necessary Android-specific configuration changes. -# -# Also ARMEABI or ARMEABI_V7A or X86 or MIPS or ARM64_V8A or X86_64 or MIPS64 -# will be set true, mutually exclusive. NEON option will be set true -# if VFP is set to NEON. -# -# ------------------------------------------------------------------------------ - -cmake_minimum_required( VERSION 2.6.3 ) - -if( DEFINED CMAKE_CROSSCOMPILING ) - # subsequent toolchain loading is not really needed - return() -endif() - -if( CMAKE_TOOLCHAIN_FILE ) - # touch toolchain variable to suppress "unused variable" warning -endif() - -# inherit settings in recursive loads -get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) -if( _CMAKE_IN_TRY_COMPILE ) - include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL ) -endif() - -# this one is important -if( CMAKE_VERSION VERSION_GREATER "3.0.99" ) - set( CMAKE_SYSTEM_NAME Android ) -else() - set( CMAKE_SYSTEM_NAME Linux ) -endif() - -# this one not so much -set( CMAKE_SYSTEM_VERSION 1 ) - -# rpath makes low sense for Android -set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" ) -set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." ) - -# NDK search paths -set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" ) -if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS ) - if( CMAKE_HOST_WIN32 ) - file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS ) - set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}" "$ENV{SystemDrive}/NVPACK" ) - else() - file( TO_CMAKE_PATH "$ENV{HOME}" ANDROID_NDK_SEARCH_PATHS ) - set( ANDROID_NDK_SEARCH_PATHS /opt "${ANDROID_NDK_SEARCH_PATHS}/NVPACK" ) - endif() -endif() -if( NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH ) - set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain ) -endif() - -# known ABIs -set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" ) -set( ANDROID_SUPPORTED_ABIS_arm64 "arm64-v8a" ) -set( ANDROID_SUPPORTED_ABIS_x86 "x86" ) -set( ANDROID_SUPPORTED_ABIS_x86_64 "x86_64" ) -set( ANDROID_SUPPORTED_ABIS_mips "mips" ) -set( ANDROID_SUPPORTED_ABIS_mips64 "mips64" ) - -# API level defaults -set( ANDROID_DEFAULT_NDK_API_LEVEL 8 ) -set( ANDROID_DEFAULT_NDK_API_LEVEL_arm64 21 ) -set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 ) -set( ANDROID_DEFAULT_NDK_API_LEVEL_x86_64 21 ) -set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 ) -set( ANDROID_DEFAULT_NDK_API_LEVEL_mips64 21 ) - - -macro( __LIST_FILTER listvar regex ) - if( ${listvar} ) - foreach( __val ${${listvar}} ) - if( __val MATCHES "${regex}" ) - list( REMOVE_ITEM ${listvar} "${__val}" ) - endif() - endforeach() - endif() -endmacro() - -macro( __INIT_VARIABLE var_name ) - set( __test_path 0 ) - foreach( __var ${ARGN} ) - if( __var STREQUAL "PATH" ) - set( __test_path 1 ) - break() - endif() - endforeach() - - if( __test_path AND NOT EXISTS "${${var_name}}" ) - unset( ${var_name} CACHE ) - endif() - - if( " ${${var_name}}" STREQUAL " " ) - set( __values 0 ) - foreach( __var ${ARGN} ) - if( __var STREQUAL "VALUES" ) - set( __values 1 ) - elseif( NOT __var STREQUAL "PATH" ) - if( __var MATCHES "^ENV_.*$" ) - string( REPLACE "ENV_" "" __var "${__var}" ) - set( __value "$ENV{${__var}}" ) - elseif( DEFINED ${__var} ) - set( __value "${${__var}}" ) - elseif( __values ) - set( __value "${__var}" ) - else() - set( __value "" ) - endif() - - if( NOT " ${__value}" STREQUAL " " AND (NOT __test_path OR EXISTS "${__value}") ) - set( ${var_name} "${__value}" ) - break() - endif() - endif() - endforeach() - unset( __value ) - unset( __values ) - endif() - - if( __test_path ) - file( TO_CMAKE_PATH "${${var_name}}" ${var_name} ) - endif() - unset( __test_path ) -endmacro() - -macro( __DETECT_NATIVE_API_LEVEL _var _path ) - set( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" ) - file( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" ) - if( NOT __apiFileContent ) - message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." ) - endif() - string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" ) - unset( __apiFileContent ) - unset( __ndkApiLevelRegex ) -endmacro() - -macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root ) - if( EXISTS "${_root}" ) - file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" ) - __LIST_FILTER( __gccExePath "^[.].*" ) - list( LENGTH __gccExePath __gccExePathsCount ) - if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE ) - message( WARNING "Could not determine machine name for compiler from ${_root}" ) - set( ${_var} "" ) - else() - get_filename_component( __gccExeName "${__gccExePath}" NAME_WE ) - string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" ) - endif() - unset( __gccExePath ) - unset( __gccExePathsCount ) - unset( __gccExeName ) - else() - set( ${_var} "" ) - endif() -endmacro() - - -# fight against cygwin -set( ANDROID_FORBID_SYGWIN TRUE CACHE BOOL "Prevent cmake from working under cygwin and using cygwin tools") -mark_as_advanced( ANDROID_FORBID_SYGWIN ) -if( ANDROID_FORBID_SYGWIN ) - if( CYGWIN ) - message( FATAL_ERROR "Android NDK and android-cmake toolchain are not welcome Cygwin. It is unlikely that this cmake toolchain will work under cygwin. But if you want to try then you can set cmake variable ANDROID_FORBID_SYGWIN to FALSE and rerun cmake." ) - endif() - - if( CMAKE_HOST_WIN32 ) - # remove cygwin from PATH - set( __new_path "$ENV{PATH}") - __LIST_FILTER( __new_path "cygwin" ) - set(ENV{PATH} "${__new_path}") - unset(__new_path) - endif() -endif() - - -# detect current host platform -if( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64" OR CMAKE_HOST_APPLE) ) - set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" ) - mark_as_advanced( ANDROID_NDK_HOST_X64 ) -endif() - -set( TOOL_OS_SUFFIX "" ) -if( CMAKE_HOST_APPLE ) - set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" ) - set( ANDROID_NDK_HOST_SYSTEM_NAME2 "darwin-x86" ) -elseif( CMAKE_HOST_WIN32 ) - set( ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64" ) - set( ANDROID_NDK_HOST_SYSTEM_NAME2 "windows" ) - set( TOOL_OS_SUFFIX ".exe" ) -elseif( CMAKE_HOST_UNIX ) - set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64" ) - set( ANDROID_NDK_HOST_SYSTEM_NAME2 "linux-x86" ) -else() - message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" ) -endif() - -if( NOT ANDROID_NDK_HOST_X64 ) - set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) -endif() - -# see if we have path to Android NDK -if( NOT ANDROID_NDK AND NOT ANDROID_STANDALONE_TOOLCHAIN ) - __INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK ) -endif() -if( NOT ANDROID_NDK ) - # see if we have path to Android standalone toolchain - __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN ) - - if( NOT ANDROID_STANDALONE_TOOLCHAIN ) - #try to find Android NDK in one of the the default locations - set( __ndkSearchPaths ) - foreach( __ndkSearchPath ${ANDROID_NDK_SEARCH_PATHS} ) - foreach( suffix ${ANDROID_SUPPORTED_NDK_VERSIONS} ) - list( APPEND __ndkSearchPaths "${__ndkSearchPath}/android-ndk${suffix}" ) - endforeach() - endforeach() - __INIT_VARIABLE( ANDROID_NDK PATH VALUES ${__ndkSearchPaths} ) - unset( __ndkSearchPaths ) - - if( ANDROID_NDK ) - message( STATUS "Using default path for Android NDK: ${ANDROID_NDK}" ) - message( STATUS " If you prefer to use a different location, please define a cmake or environment variable: ANDROID_NDK" ) - else() - #try to find Android standalone toolchain in one of the the default locations - __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH ) - - if( ANDROID_STANDALONE_TOOLCHAIN ) - message( STATUS "Using default path for standalone toolchain ${ANDROID_STANDALONE_TOOLCHAIN}" ) - message( STATUS " If you prefer to use a different location, please define the variable: ANDROID_STANDALONE_TOOLCHAIN" ) - endif( ANDROID_STANDALONE_TOOLCHAIN ) - endif( ANDROID_NDK ) - endif( NOT ANDROID_STANDALONE_TOOLCHAIN ) -endif( NOT ANDROID_NDK ) - -# remember found paths -if( ANDROID_NDK ) - get_filename_component( ANDROID_NDK "${ANDROID_NDK}" ABSOLUTE ) - set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE ) - set( BUILD_WITH_ANDROID_NDK True ) - if( EXISTS "${ANDROID_NDK}/RELEASE.TXT" ) - file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX "r[0-9]+[a-z]?" ) - string( REGEX MATCH "r([0-9]+)([a-z]?)" ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" ) - else() - set( ANDROID_NDK_RELEASE "r1x" ) - set( ANDROID_NDK_RELEASE_FULL "unreleased" ) - endif() - string( REGEX REPLACE "r([0-9]+)([a-z]?)" "\\1*1000" ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE}" ) - string( FIND " abcdefghijklmnopqastuvwxyz" "${CMAKE_MATCH_2}" __ndkReleaseLetterNum ) - math( EXPR ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE_NUM}+${__ndkReleaseLetterNum}" ) -elseif( ANDROID_STANDALONE_TOOLCHAIN ) - get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE ) - # try to detect change - if( CMAKE_AR ) - string( LENGTH "${ANDROID_STANDALONE_TOOLCHAIN}" __length ) - string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidStandaloneToolchainPreviousPath ) - if( NOT __androidStandaloneToolchainPreviousPath STREQUAL ANDROID_STANDALONE_TOOLCHAIN ) - message( FATAL_ERROR "It is not possible to change path to the Android standalone toolchain on subsequent run." ) - endif() - unset( __androidStandaloneToolchainPreviousPath ) - unset( __length ) - endif() - set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" FORCE ) - set( BUILD_WITH_STANDALONE_TOOLCHAIN True ) -else() - list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH) - message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolchain. - You should either set an environment variable: - export ANDROID_NDK=~/my-android-ndk - or - export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain - or put the toolchain or NDK in the default path: - sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}/android-ndk - sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}" ) -endif() - -# android NDK layout -if( BUILD_WITH_ANDROID_NDK ) - if( NOT DEFINED ANDROID_NDK_LAYOUT ) - # try to automatically detect the layout - if( EXISTS "${ANDROID_NDK}/RELEASE.TXT") - set( ANDROID_NDK_LAYOUT "RELEASE" ) - elseif( EXISTS "${ANDROID_NDK}/../../linux-x86/toolchain/" ) - set( ANDROID_NDK_LAYOUT "LINARO" ) - elseif( EXISTS "${ANDROID_NDK}/../../gcc/" ) - set( ANDROID_NDK_LAYOUT "ANDROID" ) - endif() - endif() - set( ANDROID_NDK_LAYOUT "${ANDROID_NDK_LAYOUT}" CACHE STRING "The inner layout of NDK" ) - mark_as_advanced( ANDROID_NDK_LAYOUT ) - if( ANDROID_NDK_LAYOUT STREQUAL "LINARO" ) - set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment - set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../${ANDROID_NDK_HOST_SYSTEM_NAME}/toolchain" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" ) - elseif( ANDROID_NDK_LAYOUT STREQUAL "ANDROID" ) - set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment - set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../gcc/${ANDROID_NDK_HOST_SYSTEM_NAME}/arm" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" ) - else() # ANDROID_NDK_LAYOUT STREQUAL "RELEASE" - set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/toolchains" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME2}" ) - endif() - get_filename_component( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK_TOOLCHAINS_PATH}" ABSOLUTE ) - - # try to detect change of NDK - if( CMAKE_AR ) - string( LENGTH "${ANDROID_NDK_TOOLCHAINS_PATH}" __length ) - string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidNdkPreviousPath ) - if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK_TOOLCHAINS_PATH ) - message( FATAL_ERROR "It is not possible to change the path to the NDK on subsequent CMake run. You must remove all generated files from your build folder first. - " ) - endif() - unset( __androidNdkPreviousPath ) - unset( __length ) - endif() -endif() - - -# get all the details about standalone toolchain -if( BUILD_WITH_STANDALONE_TOOLCHAIN ) - __DETECT_NATIVE_API_LEVEL( ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot/usr/include/android/api-level.h" ) - set( ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} ) - set( __availableToolchains "standalone" ) - __DETECT_TOOLCHAIN_MACHINE_NAME( __availableToolchainMachines "${ANDROID_STANDALONE_TOOLCHAIN}" ) - if( NOT __availableToolchainMachines ) - message( FATAL_ERROR "Could not determine machine name of your toolchain. Probably your Android standalone toolchain is broken." ) - endif() - if( __availableToolchainMachines MATCHES x86_64 ) - set( __availableToolchainArchs "x86_64" ) - elseif( __availableToolchainMachines MATCHES i686 ) - set( __availableToolchainArchs "x86" ) - elseif( __availableToolchainMachines MATCHES aarch64 ) - set( __availableToolchainArchs "arm64" ) - elseif( __availableToolchainMachines MATCHES arm ) - set( __availableToolchainArchs "arm" ) - elseif( __availableToolchainMachines MATCHES mips64el ) - set( __availableToolchainArchs "mips64" ) - elseif( __availableToolchainMachines MATCHES mipsel ) - set( __availableToolchainArchs "mips" ) - endif() - execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion - OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE ) - string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" ) - if( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}" ) - list( APPEND __availableToolchains "standalone-clang" ) - list( APPEND __availableToolchainMachines ${__availableToolchainMachines} ) - list( APPEND __availableToolchainArchs ${__availableToolchainArchs} ) - list( APPEND __availableToolchainCompilerVersions ${__availableToolchainCompilerVersions} ) - endif() -endif() - -macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath ) - foreach( __toolchain ${${__availableToolchainsLst}} ) - if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" ) - SET( __toolchainVersionRegex "^TOOLCHAIN_VERSION[\t ]+:=[\t ]+(.*)$" ) - FILE( STRINGS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}/setup.mk" __toolchainVersionStr REGEX "${__toolchainVersionRegex}" ) - if( __toolchainVersionStr ) - string( REGEX REPLACE "${__toolchainVersionRegex}" "\\1" __toolchainVersionStr "${__toolchainVersionStr}" ) - string( REGEX REPLACE "-clang3[.][0-9]$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" ) - else() - string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" ) - endif() - unset( __toolchainVersionStr ) - unset( __toolchainVersionRegex ) - else() - set( __gcc_toolchain "${__toolchain}" ) - endif() - __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" ) - if( __machine ) - string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" ) - if( __machine MATCHES x86_64 ) - set( __arch "x86_64" ) - elseif( __machine MATCHES i686 ) - set( __arch "x86" ) - elseif( __machine MATCHES aarch64 ) - set( __arch "arm64" ) - elseif( __machine MATCHES arm ) - set( __arch "arm" ) - elseif( __machine MATCHES mips64el ) - set( __arch "mips64" ) - elseif( __machine MATCHES mipsel ) - set( __arch "mips" ) - else() - set( __arch "" ) - endif() - #message("machine: !${__machine}!\narch: !${__arch}!\nversion: !${__version}!\ntoolchain: !${__toolchain}!\n") - if (__arch) - list( APPEND __availableToolchainMachines "${__machine}" ) - list( APPEND __availableToolchainArchs "${__arch}" ) - list( APPEND __availableToolchainCompilerVersions "${__version}" ) - list( APPEND ${__availableToolchainsVar} "${__toolchain}" ) - endif() - endif() - unset( __gcc_toolchain ) - endforeach() -endmacro() - -# get all the details about NDK -if( BUILD_WITH_ANDROID_NDK ) - file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" ) - string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" ) - set( __availableToolchains "" ) - set( __availableToolchainMachines "" ) - set( __availableToolchainArchs "" ) - set( __availableToolchainCompilerVersions "" ) - if( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_TOOLCHAIN_NAME}/" ) - # do not go through all toolchains if we know the name - set( __availableToolchainsLst "${ANDROID_TOOLCHAIN_NAME}" ) - __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" ) - if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 ) - __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" ) - if( __availableToolchains ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} ) - endif() - endif() - endif() - if( NOT __availableToolchains ) - file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK_TOOLCHAINS_PATH}" "${ANDROID_NDK_TOOLCHAINS_PATH}/*" ) - if( __availableToolchains ) - list(SORT __availableToolchainsLst) # we need clang to go after gcc - endif() - __LIST_FILTER( __availableToolchainsLst "^[.]" ) - __LIST_FILTER( __availableToolchainsLst "llvm" ) - __LIST_FILTER( __availableToolchainsLst "renderscript" ) - __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" ) - if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 ) - __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" ) - if( __availableToolchains ) - set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} ) - endif() - endif() - endif() - if( NOT __availableToolchains ) - message( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." ) - endif() -endif() - -# build list of available ABIs -set( ANDROID_SUPPORTED_ABIS "" ) -set( __uniqToolchainArchNames ${__availableToolchainArchs} ) -list( REMOVE_DUPLICATES __uniqToolchainArchNames ) -list( SORT __uniqToolchainArchNames ) -foreach( __arch ${__uniqToolchainArchNames} ) - list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} ) -endforeach() -unset( __uniqToolchainArchNames ) -if( NOT ANDROID_SUPPORTED_ABIS ) - message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." ) -endif() - -# choose target ABI -__INIT_VARIABLE( ANDROID_ABI VALUES ${ANDROID_SUPPORTED_ABIS} ) -# verify that target ABI is supported -list( FIND ANDROID_SUPPORTED_ABIS "${ANDROID_ABI}" __androidAbiIdx ) -if( __androidAbiIdx EQUAL -1 ) - string( REPLACE ";" "\", \"" PRINTABLE_ANDROID_SUPPORTED_ABIS "${ANDROID_SUPPORTED_ABIS}" ) - message( FATAL_ERROR "Specified ANDROID_ABI = \"${ANDROID_ABI}\" is not supported by this cmake toolchain or your NDK/toolchain. - Supported values are: \"${PRINTABLE_ANDROID_SUPPORTED_ABIS}\" - " ) -endif() -unset( __androidAbiIdx ) - -# set target ABI options -if( ANDROID_ABI STREQUAL "x86" ) - set( X86 true ) - set( ANDROID_NDK_ABI_NAME "x86" ) - set( ANDROID_ARCH_NAME "x86" ) - set( ANDROID_LLVM_TRIPLE "i686-none-linux-android" ) - set( CMAKE_SYSTEM_PROCESSOR "i686" ) -elseif( ANDROID_ABI STREQUAL "x86_64" ) - set( X86 true ) - set( X86_64 true ) - set( ANDROID_NDK_ABI_NAME "x86_64" ) - set( ANDROID_ARCH_NAME "x86_64" ) - set( CMAKE_SYSTEM_PROCESSOR "x86_64" ) - set( ANDROID_LLVM_TRIPLE "x86_64-none-linux-android" ) -elseif( ANDROID_ABI STREQUAL "mips64" ) - set( MIPS64 true ) - set( ANDROID_NDK_ABI_NAME "mips64" ) - set( ANDROID_ARCH_NAME "mips64" ) - set( ANDROID_LLVM_TRIPLE "mips64el-none-linux-android" ) - set( CMAKE_SYSTEM_PROCESSOR "mips64" ) -elseif( ANDROID_ABI STREQUAL "mips" ) - set( MIPS true ) - set( ANDROID_NDK_ABI_NAME "mips" ) - set( ANDROID_ARCH_NAME "mips" ) - set( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" ) - set( CMAKE_SYSTEM_PROCESSOR "mips" ) -elseif( ANDROID_ABI STREQUAL "arm64-v8a" ) - set( ARM64_V8A true ) - set( ANDROID_NDK_ABI_NAME "arm64-v8a" ) - set( ANDROID_ARCH_NAME "arm64" ) - set( ANDROID_LLVM_TRIPLE "aarch64-none-linux-android" ) - set( CMAKE_SYSTEM_PROCESSOR "aarch64" ) - set( VFPV3 true ) - set( NEON true ) -elseif( ANDROID_ABI STREQUAL "armeabi" ) - set( ARMEABI true ) - set( ANDROID_NDK_ABI_NAME "armeabi" ) - set( ANDROID_ARCH_NAME "arm" ) - set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" ) - set( CMAKE_SYSTEM_PROCESSOR "armv5te" ) -elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" ) - set( ARMEABI_V6 true ) - set( ANDROID_NDK_ABI_NAME "armeabi" ) - set( ANDROID_ARCH_NAME "arm" ) - set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" ) - set( CMAKE_SYSTEM_PROCESSOR "armv6" ) - # need always fallback to older platform - set( ARMEABI true ) -elseif( ANDROID_ABI STREQUAL "armeabi-v7a") - set( ARMEABI_V7A true ) - set( ANDROID_NDK_ABI_NAME "armeabi-v7a" ) - set( ANDROID_ARCH_NAME "arm" ) - set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" ) - set( CMAKE_SYSTEM_PROCESSOR "armv7-a" ) -elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" ) - set( ARMEABI_V7A true ) - set( ANDROID_NDK_ABI_NAME "armeabi-v7a" ) - set( ANDROID_ARCH_NAME "arm" ) - set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" ) - set( CMAKE_SYSTEM_PROCESSOR "armv7-a" ) - set( VFPV3 true ) -elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" ) - set( ARMEABI_V7A true ) - set( ANDROID_NDK_ABI_NAME "armeabi-v7a" ) - set( ANDROID_ARCH_NAME "arm" ) - set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" ) - set( CMAKE_SYSTEM_PROCESSOR "armv7-a" ) - set( VFPV3 true ) - set( NEON true ) -else() - message( SEND_ERROR "Unknown ANDROID_ABI=\"${ANDROID_ABI}\" is specified." ) -endif() - -if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" ) - # really dirty hack - # it is not possible to change CMAKE_SYSTEM_PROCESSOR after the first run... - file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" ) -endif() - -if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 ) - __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD VALUES OFF ) - set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE ) - mark_as_advanced( ANDROID_FORCE_ARM_BUILD ) -else() - unset( ANDROID_FORCE_ARM_BUILD CACHE ) -endif() - -# choose toolchain -if( ANDROID_TOOLCHAIN_NAME ) - list( FIND __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" __toolchainIdx ) - if( __toolchainIdx EQUAL -1 ) - list( SORT __availableToolchains ) - string( REPLACE ";" "\n * " toolchains_list "${__availableToolchains}" ) - set( toolchains_list " * ${toolchains_list}") - message( FATAL_ERROR "Specified toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain. -To configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\n${toolchains_list}\n" ) - endif() - list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch ) - if( NOT __toolchainArch STREQUAL ANDROID_ARCH_NAME ) - message( SEND_ERROR "Selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." ) - endif() -else() - set( __toolchainIdx -1 ) - set( __applicableToolchains "" ) - set( __toolchainMaxVersion "0.0.0" ) - list( LENGTH __availableToolchains __availableToolchainsCount ) - math( EXPR __availableToolchainsCount "${__availableToolchainsCount}-1" ) - foreach( __idx RANGE ${__availableToolchainsCount} ) - list( GET __availableToolchainArchs ${__idx} __toolchainArch ) - if( __toolchainArch STREQUAL ANDROID_ARCH_NAME ) - list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion ) - string( REPLACE "x" "99" __toolchainVersion "${__toolchainVersion}") - if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion ) - set( __toolchainMaxVersion "${__toolchainVersion}" ) - set( __toolchainIdx ${__idx} ) - endif() - endif() - endforeach() - unset( __availableToolchainsCount ) - unset( __toolchainMaxVersion ) - unset( __toolchainVersion ) -endif() -unset( __toolchainArch ) -if( __toolchainIdx EQUAL -1 ) - message( FATAL_ERROR "No one of available compiler toolchains is able to compile for ${ANDROID_ARCH_NAME} platform." ) -endif() -list( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME ) -list( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME ) -list( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION ) - -unset( __toolchainIdx ) -unset( __availableToolchains ) -unset( __availableToolchainMachines ) -unset( __availableToolchainArchs ) -unset( __availableToolchainCompilerVersions ) - -# choose native API level -__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL ) -string( REPLACE "android-" "" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" ) -string( STRIP "${ANDROID_NATIVE_API_LEVEL}" ANDROID_NATIVE_API_LEVEL ) -# adjust API level -set( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} ) -foreach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} ) - if( (__level LESS ANDROID_NATIVE_API_LEVEL OR __level STREQUAL ANDROID_NATIVE_API_LEVEL) AND NOT __level LESS __real_api_level ) - set( __real_api_level ${__level} ) - endif() -endforeach() -if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL STREQUAL __real_api_level ) - message( STATUS "Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'") - set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} ) -endif() -unset(__real_api_level) -# validate -list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx ) -if( __levelIdx EQUAL -1 ) - message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain." ) -else() - if( BUILD_WITH_ANDROID_NDK ) - __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" ) - if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL AND NOT __realApiLevel GREATER 9000 ) - message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." ) - endif() - unset( __realApiLevel ) - endif() - set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE ) - set( CMAKE_ANDROID_API ${ANDROID_NATIVE_API_LEVEL} ) - if( CMAKE_VERSION VERSION_GREATER "2.8" ) - list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS ) - set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} ) - endif() -endif() -unset( __levelIdx ) - - -# remember target ABI -set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE ) -if( CMAKE_VERSION VERSION_GREATER "2.8" ) - list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} ) - set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} ) -endif() - - -# runtime choice (STL, rtti, exceptions) -if( NOT ANDROID_STL ) - set( ANDROID_STL gnustl_static ) -endif() -set( ANDROID_STL "${ANDROID_STL}" CACHE STRING "C++ runtime" ) -set( ANDROID_STL_FORCE_FEATURES ON CACHE BOOL "automatically configure rtti and exceptions support based on C++ runtime" ) -mark_as_advanced( ANDROID_STL ANDROID_STL_FORCE_FEATURES ) - -if( BUILD_WITH_ANDROID_NDK ) - if( NOT "${ANDROID_STL}" MATCHES "^(none|system|system_re|gabi\\+\\+_static|gabi\\+\\+_shared|stlport_static|stlport_shared|gnustl_static|gnustl_shared|c\\+\\+_static|c\\+\\+_shared)$") - message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\". -The possible values are: - none -> Do not configure the runtime. - system -> Use the default minimal system C++ runtime library. - system_re -> Same as system but with rtti and exceptions. - gabi++_static -> Use the GAbi++ runtime as a static library. - gabi++_shared -> Use the GAbi++ runtime as a shared library. - stlport_static -> Use the STLport runtime as a static library. - stlport_shared -> Use the STLport runtime as a shared library. - gnustl_static -> (default) Use the GNU STL as a static library. - gnustl_shared -> Use the GNU STL as a shared library. - c++_static -> Use libc++ as a static library. - c++_shared -> Use libc++ as a shared library. -" ) - endif() -elseif( BUILD_WITH_STANDALONE_TOOLCHAIN ) - if( NOT "${ANDROID_STL}" MATCHES "^(none|gnustl_static|gnustl_shared)$") - message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\". -The possible values are: - none -> Do not configure the runtime. - gnustl_static -> (default) Use the GNU STL as a static library. - gnustl_shared -> Use the GNU STL as a shared library. -" ) - endif() -endif() - -unset( ANDROID_RTTI ) -unset( ANDROID_EXCEPTIONS ) -unset( ANDROID_STL_INCLUDE_DIRS ) -unset( __libstl ) -unset( __libsupcxx ) - -if( NOT _CMAKE_IN_TRY_COMPILE AND ANDROID_NDK_RELEASE STREQUAL "r7b" AND ARMEABI_V7A AND NOT VFPV3 AND ANDROID_STL MATCHES "gnustl" ) - message( WARNING "The GNU STL armeabi-v7a binaries from NDK r7b can crash non-NEON devices. The files provided with NDK r7b were not configured properly, resulting in crashes on Tegra2-based devices and others when trying to use certain floating-point functions (e.g., cosf, sinf, expf). -You are strongly recommended to switch to another NDK release. -" ) -endif() - -if( NOT _CMAKE_IN_TRY_COMPILE AND X86 AND ANDROID_STL MATCHES "gnustl" AND ANDROID_NDK_RELEASE STREQUAL "r6" ) - message( WARNING "The x86 system header file from NDK r6 has incorrect definition for ptrdiff_t. You are recommended to upgrade to a newer NDK release or manually patch the header: -See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc8093df6fee54454b8bcab6c2 - diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h - index 5e28c64..65892a1 100644 - --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h - +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h - @@ -51,7 +51,11 @@ typedef long int ssize_t; - #endif - #ifndef _PTRDIFF_T - #define _PTRDIFF_T - -typedef long ptrdiff_t; - +# ifdef __ANDROID__ - + typedef int ptrdiff_t; - +# else - + typedef long ptrdiff_t; - +# endif - #endif -" ) -endif() - - -# setup paths and STL for standalone toolchain -if( BUILD_WITH_STANDALONE_TOOLCHAIN ) - set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" ) - set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" ) - set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" ) - - if( NOT ANDROID_STL STREQUAL "none" ) - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/include/c++/${ANDROID_COMPILER_VERSION}" ) - if( NOT EXISTS "${ANDROID_STL_INCLUDE_DIRS}" ) - # old location ( pre r8c ) - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" ) - endif() - if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" ) - list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" ) - elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" ) - list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" ) - else() - list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" ) - endif() - # always search static GNU STL to get the location of libsupc++.a - if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" ) - elseif( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" ) - elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" ) - elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" ) - endif() - if( __libstl ) - set( __libsupcxx "${__libstl}/libsupc++.a" ) - set( __libstl "${__libstl}/libstdc++.a" ) - endif() - if( NOT EXISTS "${__libsupcxx}" ) - message( FATAL_ERROR "The required libstdsupc++.a is missing in your standalone toolchain. - Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c. - You need to either upgrade to newer NDK or manually copy - $ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a - to - ${__libsupcxx} - " ) - endif() - if( ANDROID_STL STREQUAL "gnustl_shared" ) - if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" ) - elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" ) - elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" ) - set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" ) - endif() - endif() - endif() -endif() - -# clang -if( "${ANDROID_TOOLCHAIN_NAME}" STREQUAL "standalone-clang" ) - set( ANDROID_COMPILER_IS_CLANG 1 ) - execute_process( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}") -elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" ) - string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}") - string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-${ANDROID_COMPILER_VERSION}" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" ) - if( NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}/bin/clang${TOOL_OS_SUFFIX}" ) - message( FATAL_ERROR "Could not find the Clang compiler driver" ) - endif() - set( ANDROID_COMPILER_IS_CLANG 1 ) - set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" ) -else() - set( ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" ) - unset( ANDROID_COMPILER_IS_CLANG CACHE ) -endif() - -string( REPLACE "." "" _clang_name "clang${ANDROID_CLANG_VERSION}" ) -if( NOT EXISTS "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" ) - set( _clang_name "clang" ) -endif() - -# setup paths and STL for NDK -if( BUILD_WITH_ANDROID_NDK ) - set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" ) - set( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" ) - - if( ANDROID_STL STREQUAL "none" ) - # do nothing - elseif( ANDROID_STL STREQUAL "system" ) - set( ANDROID_RTTI OFF ) - set( ANDROID_EXCEPTIONS OFF ) - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" ) - elseif( ANDROID_STL STREQUAL "system_re" ) - set( ANDROID_RTTI ON ) - set( ANDROID_EXCEPTIONS ON ) - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" ) - elseif( ANDROID_STL MATCHES "gabi" ) - if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7 - message( FATAL_ERROR "gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.") - endif() - set( ANDROID_RTTI ON ) - set( ANDROID_EXCEPTIONS OFF ) - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/gabi++/include" ) - set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${ANDROID_NDK_ABI_NAME}/libgabi++_static.a" ) - elseif( ANDROID_STL MATCHES "stlport" ) - if( NOT ANDROID_NDK_RELEASE_NUM LESS 8004 ) # before r8d - set( ANDROID_EXCEPTIONS ON ) - else() - set( ANDROID_EXCEPTIONS OFF ) - endif() - if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7 - set( ANDROID_RTTI OFF ) - else() - set( ANDROID_RTTI ON ) - endif() - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" ) - set( __libstl "${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}/libstlport_static.a" ) - elseif( ANDROID_STL MATCHES "gnustl" ) - set( ANDROID_EXCEPTIONS ON ) - set( ANDROID_RTTI ON ) - if( EXISTS "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" ) - if( ARMEABI_V7A AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.7" AND ANDROID_NDK_RELEASE STREQUAL "r8d" ) - # gnustl binary for 4.7 compiler is buggy :( - # TODO: look for right fix - set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" ) - else() - set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" ) - endif() - else() - set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++" ) - endif() - set( ANDROID_STL_INCLUDE_DIRS "${__libstl}/include" "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include" "${__libstl}/include/backward" ) - if( EXISTS "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" ) - set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" ) - else() - set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libstdc++.a" ) - endif() - elseif( ANDROID_STL MATCHES "c\\+\\+_shared" OR ANDROID_STL MATCHES "c\\+\\+_static" ) - set( ANDROID_EXCEPTIONS ON ) - set( ANDROID_RTTI ON ) - set( ANDROID_CXX_ROOT "${ANDROID_NDK}/sources/cxx-stl/" ) - set( ANDROID_LLVM_ROOT "${ANDROID_CXX_ROOT}/llvm-libc++" ) - if( X86 ) - set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/gabi++/include" ) - else() - set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/llvm-libc++abi/include" ) - endif() - set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_LLVM_ROOT}/libcxx/include" - "${ANDROID_ABI_INCLUDE_DIRS}" ) - # android support sfiles - include_directories ( SYSTEM ${ANDROID_NDK}/sources/android/support/include ) - if( ANDROID_STL MATCHES "c\\+\\+_shared" AND EXISTS "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_shared.so" ) - set( __libstl "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_shared.so" ) - elseif( ANDROID_STL MATCHES "c\\+\\+_static" AND EXISTS "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" ) - set( __libstl "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" ) - else() - message( "c++ library doesn't exist" ) - endif() - else() - message( FATAL_ERROR "Unknown runtime: ${ANDROID_STL}" ) - endif() - # find libsupc++.a - rtti & exceptions - if( ANDROID_STL STREQUAL "system_re" OR ANDROID_STL MATCHES "gnustl" ) - set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r8b or newer - if( NOT EXISTS "${__libsupcxx}" ) - set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r7-r8 - endif() - if( NOT EXISTS "${__libsupcxx}" ) # before r7 - if( ARMEABI_V7A ) - if( ANDROID_FORCE_ARM_BUILD ) - set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a" ) - else() - set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a" ) - endif() - elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD ) - set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a" ) - else() - set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a" ) - endif() - endif() - if( NOT EXISTS "${__libsupcxx}") - message( ERROR "Could not find libsupc++.a for a chosen platform. Either your NDK is not supported or is broken.") - endif() - endif() -endif() - - -# case of shared STL linkage -if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl ) - string( REPLACE "_static.a" "_shared.so" __libstl "${__libstl}" ) - # TODO: check if .so file exists before the renaming -endif() - - -# ccache support -__INIT_VARIABLE( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE ) -if( _ndk_ccache ) - if( DEFINED NDK_CCACHE AND NOT EXISTS NDK_CCACHE ) - unset( NDK_CCACHE CACHE ) - endif() - find_program( NDK_CCACHE "${_ndk_ccache}" DOC "The path to ccache binary") -else() - unset( NDK_CCACHE CACHE ) -endif() -unset( _ndk_ccache ) - - -# setup the cross-compiler -if( NOT CMAKE_C_COMPILER ) - if( NDK_CCACHE AND NOT ANDROID_SYSROOT MATCHES "[ ;\"]" ) - set( CMAKE_C_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C compiler" ) - set( CMAKE_CXX_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C++ compiler" ) - if( ANDROID_COMPILER_IS_CLANG ) - set( CMAKE_C_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler") - set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler") - else() - set( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler") - set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler") - endif() - else() - if( ANDROID_COMPILER_IS_CLANG ) - set( CMAKE_C_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler") - set( CMAKE_CXX_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler") - else() - set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" ) - set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" ) - endif() - endif() - set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "assembler" ) - set( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" ) - set( CMAKE_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}" CACHE PATH "archive" ) - set( CMAKE_LINKER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}" CACHE PATH "linker" ) - set( CMAKE_NM "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}" CACHE PATH "nm" ) - set( CMAKE_OBJCOPY "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" ) - set( CMAKE_OBJDUMP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" ) - set( CMAKE_RANLIB "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}" CACHE PATH "ranlib" ) -endif() - -set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" ) -if( CMAKE_VERSION VERSION_LESS 2.8.5 ) - set( CMAKE_ASM_COMPILER_ARG1 "-c" ) -endif() -if( APPLE ) - find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool ) - if( NOT CMAKE_INSTALL_NAME_TOOL ) - message( FATAL_ERROR "Could not find install_name_tool, please check your installation." ) - endif() - mark_as_advanced( CMAKE_INSTALL_NAME_TOOL ) -endif() - -# Force set compilers because standard identification works badly for us -include( CMakeForceCompiler ) -CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU ) -if( ANDROID_COMPILER_IS_CLANG ) - set( CMAKE_C_COMPILER_ID Clang ) -endif() -set( CMAKE_C_PLATFORM_ID Linux ) -if( X86_64 OR MIPS64 OR ARM64_V8A ) - set( CMAKE_C_SIZEOF_DATA_PTR 8 ) -else() - set( CMAKE_C_SIZEOF_DATA_PTR 4 ) -endif() -set( CMAKE_C_HAS_ISYSROOT 1 ) -set( CMAKE_C_COMPILER_ABI ELF ) -CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU ) -if( ANDROID_COMPILER_IS_CLANG ) - set( CMAKE_CXX_COMPILER_ID Clang) -endif() -set( CMAKE_CXX_PLATFORM_ID Linux ) -set( CMAKE_CXX_SIZEOF_DATA_PTR ${CMAKE_C_SIZEOF_DATA_PTR} ) -set( CMAKE_CXX_HAS_ISYSROOT 1 ) -set( CMAKE_CXX_COMPILER_ABI ELF ) -set( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C ) -# force ASM compiler (required for CMake < 2.8.5) -set( CMAKE_ASM_COMPILER_ID_RUN TRUE ) -set( CMAKE_ASM_COMPILER_ID GNU ) -set( CMAKE_ASM_COMPILER_WORKS TRUE ) -set( CMAKE_ASM_COMPILER_FORCED TRUE ) -set( CMAKE_COMPILER_IS_GNUASM 1) -set( CMAKE_ASM_SOURCE_FILE_EXTENSIONS s S asm ) - -foreach( lang C CXX ASM ) - if( ANDROID_COMPILER_IS_CLANG ) - set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} ) - else() - set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_COMPILER_VERSION} ) - endif() -endforeach() - -# flags and definitions -remove_definitions( -DANDROID ) -add_definitions( -DANDROID ) - -if( ANDROID_SYSROOT MATCHES "[ ;\"]" ) - if( CMAKE_HOST_WIN32 ) - # try to convert path to 8.3 form - file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "@echo %~s1" ) - execute_process( COMMAND "$ENV{ComSpec}" /c "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "${ANDROID_SYSROOT}" - OUTPUT_VARIABLE __path OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE __result ERROR_QUIET ) - if( __result EQUAL 0 ) - file( TO_CMAKE_PATH "${__path}" ANDROID_SYSROOT ) - set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" ) - else() - set( ANDROID_CXX_FLAGS "--sysroot=\"${ANDROID_SYSROOT}\"" ) - endif() - else() - set( ANDROID_CXX_FLAGS "'--sysroot=${ANDROID_SYSROOT}'" ) - endif() - if( NOT _CMAKE_IN_TRY_COMPILE ) - # quotes can break try_compile and compiler identification - message(WARNING "Path to your Android NDK (or toolchain) has non-alphanumeric symbols.\nThe build might be broken.\n") - endif() -else() - set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" ) -endif() - -# NDK flags -if (ARM64_V8A ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" ) - set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" ) - set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" ) - if( NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" ) - endif() -elseif( ARMEABI OR ARMEABI_V7A) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" ) - if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 ) - set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" ) - set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" ) - if( NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64" ) - endif() - else() - # always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI - set( ANDROID_CXX_FLAGS_RELEASE "-marm -fomit-frame-pointer -fstrict-aliasing" ) - set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" ) - if( NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" ) - endif() - endif() -elseif( X86 OR X86_64 ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" ) - if( NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" ) - endif() - set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" ) - set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" ) -elseif( MIPS OR MIPS64 ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -funwind-tables -fmessage-length=0" ) - set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" ) - set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer" ) - if( NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" ) - set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" ) - endif() -elseif() - set( ANDROID_CXX_FLAGS_RELEASE "" ) - set( ANDROID_CXX_FLAGS_DEBUG "" ) -endif() - -set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" ) # good/necessary when porting desktop libraries - -if( NOT X86 AND NOT ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "-Wno-psabi ${ANDROID_CXX_FLAGS}" ) -endif() - -if( NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.6" ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -no-canonical-prefixes" ) # see https://android-review.googlesource.com/#/c/47564/ -endif() - -# ABI-specific flags -if( ARMEABI_V7A ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -mfloat-abi=softfp" ) - if( NEON ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon" ) - elseif( VFPV3 ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" ) - else() - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" ) - endif() -elseif( ARMEABI_V6 ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # vfp == vfpv2 -elseif( ARMEABI ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float" ) -endif() - -if( ANDROID_STL MATCHES "gnustl" AND (EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}") ) - set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " ) - set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) - set( CMAKE_CXX_LINK_EXECUTABLE " -o " ) -else() - set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " ) - set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) - set( CMAKE_CXX_LINK_EXECUTABLE " -o " ) -endif() - -# STL -if( EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}" ) - if( EXISTS "${__libstl}" ) - set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libstl}\"" ) - set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libstl}\"" ) - set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libstl}\"" ) - endif() - if( EXISTS "${__libsupcxx}" ) - set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" ) - set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" ) - set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libsupcxx}\"" ) - # C objects: - set( CMAKE_C_CREATE_SHARED_LIBRARY " -o " ) - set( CMAKE_C_CREATE_SHARED_MODULE " -o " ) - set( CMAKE_C_LINK_EXECUTABLE " -o " ) - set( CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" ) - set( CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" ) - set( CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} \"${__libsupcxx}\"" ) - endif() - if( ANDROID_STL MATCHES "gnustl" ) - if( NOT EXISTS "${ANDROID_LIBM_PATH}" ) - set( ANDROID_LIBM_PATH -lm ) - endif() - set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} ${ANDROID_LIBM_PATH}" ) - set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} ${ANDROID_LIBM_PATH}" ) - set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${ANDROID_LIBM_PATH}" ) - endif() -endif() - -# variables controlling optional build flags -if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7 - # libGLESv2.so in NDK's prior to r7 refers to missing external symbols. - # So this flag option is required for all projects using OpenGL from native. - __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON ) -else() - __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF ) -endif() -__INIT_VARIABLE( ANDROID_NO_UNDEFINED VALUES ON ) -__INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING VALUES ON ) -__INIT_VARIABLE( ANDROID_GOLD_LINKER VALUES ON ) -__INIT_VARIABLE( ANDROID_NOEXECSTACK VALUES ON ) -__INIT_VARIABLE( ANDROID_RELRO VALUES ON ) - -set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Show all undefined symbols as linker errors" ) -set( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" ) -set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Put each function in separate section and enable garbage collection of unused input sections at link time" ) -set( ANDROID_GOLD_LINKER ${ANDROID_GOLD_LINKER} CACHE BOOL "Enables gold linker" ) -set( ANDROID_NOEXECSTACK ${ANDROID_NOEXECSTACK} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" ) -set( ANDROID_RELRO ${ANDROID_RELRO} CACHE BOOL "Enables RELRO - a memory corruption mitigation technique" ) -mark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO ) - -# linker flags -set( ANDROID_LINKER_FLAGS "" ) - -if( ARMEABI_V7A ) - # this is *required* to use the following linker flags that routes around - # a CPU bug in some Cortex-A8 implementations: - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8" ) -endif() - -if( ANDROID_NO_UNDEFINED ) - if( MIPS ) - # there is some sysroot-related problem in mips linker... - if( NOT ANDROID_SYSROOT MATCHES "[ ;\"]" ) - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib" ) - endif() - else() - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined" ) - endif() -endif() - -if( ANDROID_SO_UNDEFINED ) - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-allow-shlib-undefined" ) -endif() - -if( ANDROID_FUNCTION_LEVEL_LINKING ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" ) - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" ) -endif() - -if( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" ) - if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002) AND (ARMEABI OR ARMEABI_V7A OR X86) ) - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" ) - elseif( ANDROID_NDK_RELEASE_NUM GREATER 8002 ) # after r8b - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" ) - elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE ) - message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342 - On Linux and OS X host platform you can workaround this problem using gold linker (default). - Rerun cmake with -DANDROID_GOLD_LINKER=ON option in case of problems. -" ) - endif() -endif() # version 4.6 - -if( ANDROID_NOEXECSTACK ) - if( ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack" ) - else() - set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" ) - endif() - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack" ) -endif() - -if( ANDROID_RELRO ) - set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now" ) -endif() - -if( ANDROID_COMPILER_IS_CLANG ) - set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} -Qunused-arguments ${ANDROID_CXX_FLAGS}" ) - if( BUILD_WITH_ANDROID_NDK ) - set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" ) - endif() -endif() - -# cache flags -set( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" ) -set( CMAKE_C_FLAGS "" CACHE STRING "c flags" ) -set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c++ Release flags" ) -set( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c Release flags" ) -set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c++ Debug flags" ) -set( CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c Debug flags" ) -set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared linker flags" ) -set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags" ) -set( CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "executable linker flags" ) - -# put flags to cache (for debug purpose only) -set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" CACHE INTERNAL "Android specific c/c++ flags" ) -set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE}" CACHE INTERNAL "Android specific c/c++ Release flags" ) -set( ANDROID_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG}" CACHE INTERNAL "Android specific c/c++ Debug flags" ) -set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Android specific c/c++ linker flags" ) - -# finish flags -set( CMAKE_CXX_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" ) -set( CMAKE_C_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" ) -set( CMAKE_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}" ) -set( CMAKE_C_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}" ) -set( CMAKE_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG}" ) -set( CMAKE_C_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG}" ) -set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" ) -set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" ) -set( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" ) - -if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" ) - set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" ) - set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" ) - set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" ) -endif() - -# pie/pic -if( NOT (ANDROID_NATIVE_API_LEVEL LESS 16) AND (NOT DEFINED ANDROID_APP_PIE OR ANDROID_APP_PIE) AND (CMAKE_VERSION VERSION_GREATER 2.8.8) ) - set( CMAKE_POSITION_INDEPENDENT_CODE TRUE ) - set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie") -else() - set( CMAKE_POSITION_INDEPENDENT_CODE FALSE ) - set( CMAKE_CXX_FLAGS "-fpic ${CMAKE_CXX_FLAGS}" ) - set( CMAKE_C_FLAGS "-fpic ${CMAKE_C_FLAGS}" ) -endif() - -# configure rtti -if( DEFINED ANDROID_RTTI AND ANDROID_STL_FORCE_FEATURES ) - if( ANDROID_RTTI ) - set( CMAKE_CXX_FLAGS "-frtti ${CMAKE_CXX_FLAGS}" ) - else() - set( CMAKE_CXX_FLAGS "-fno-rtti ${CMAKE_CXX_FLAGS}" ) - endif() -endif() - -# configure exceptios -if( DEFINED ANDROID_EXCEPTIONS AND ANDROID_STL_FORCE_FEATURES ) - if( ANDROID_EXCEPTIONS ) - set( CMAKE_CXX_FLAGS "-fexceptions ${CMAKE_CXX_FLAGS}" ) - set( CMAKE_C_FLAGS "-fexceptions ${CMAKE_C_FLAGS}" ) - else() - set( CMAKE_CXX_FLAGS "-fno-exceptions ${CMAKE_CXX_FLAGS}" ) - set( CMAKE_C_FLAGS "-fno-exceptions ${CMAKE_C_FLAGS}" ) - endif() -endif() - -# global includes and link directories -include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} ) -get_filename_component(__android_install_path "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" ABSOLUTE) # avoid CMP0015 policy warning -link_directories( "${__android_install_path}" ) - -# detect if need link crtbegin_so.o explicitly -if( NOT DEFINED ANDROID_EXPLICIT_CRT_LINK ) - set( __cmd "${CMAKE_CXX_CREATE_SHARED_LIBRARY}" ) - string( REPLACE "" "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" __cmd "${__cmd}" ) - string( REPLACE "" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" __cmd "${__cmd}" ) - string( REPLACE "" "${CMAKE_CXX_FLAGS}" __cmd "${__cmd}" ) - string( REPLACE "" "" __cmd "${__cmd}" ) - string( REPLACE "" "${CMAKE_SHARED_LINKER_FLAGS}" __cmd "${__cmd}" ) - string( REPLACE "" "-shared" __cmd "${__cmd}" ) - string( REPLACE "" "" __cmd "${__cmd}" ) - string( REPLACE "" "" __cmd "${__cmd}" ) - string( REPLACE "" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain_crtlink_test.so" __cmd "${__cmd}" ) - string( REPLACE "" "\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" __cmd "${__cmd}" ) - string( REPLACE "" "" __cmd "${__cmd}" ) - separate_arguments( __cmd ) - foreach( __var ANDROID_NDK ANDROID_NDK_TOOLCHAINS_PATH ANDROID_STANDALONE_TOOLCHAIN ) - if( ${__var} ) - set( __tmp "${${__var}}" ) - separate_arguments( __tmp ) - string( REPLACE "${__tmp}" "${${__var}}" __cmd "${__cmd}") - endif() - endforeach() - string( REPLACE "'" "" __cmd "${__cmd}" ) - string( REPLACE "\"" "" __cmd "${__cmd}" ) - execute_process( COMMAND ${__cmd} RESULT_VARIABLE __cmd_result OUTPUT_QUIET ERROR_QUIET ) - if( __cmd_result EQUAL 0 ) - set( ANDROID_EXPLICIT_CRT_LINK ON ) - else() - set( ANDROID_EXPLICIT_CRT_LINK OFF ) - endif() -endif() - -if( ANDROID_EXPLICIT_CRT_LINK ) - set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" ) - set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" ) -endif() - -# setup output directories -set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" ) - -if( DEFINED LIBRARY_OUTPUT_PATH_ROOT - OR EXISTS "${CMAKE_SOURCE_DIR}/AndroidManifest.xml" - OR (EXISTS "${CMAKE_SOURCE_DIR}/../AndroidManifest.xml" AND EXISTS "${CMAKE_SOURCE_DIR}/../jni/") ) - set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "Root for binaries output, set this to change where Android libs are installed to" ) - if( NOT _CMAKE_IN_TRY_COMPILE ) - if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" ) - set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" ) - else() - set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" ) - endif() - set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for Android libs" ) - endif() -endif() - -# copy shaed stl library to build directory -if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" AND DEFINED LIBRARY_OUTPUT_PATH ) - get_filename_component( __libstlname "${__libstl}" NAME ) - execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess ) - if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}") - message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" ) - endif() - unset( __fileCopyProcess ) - unset( __libstlname ) -endif() - - -# set these global flags for cmake client scripts to change behavior -set( ANDROID True ) -set( BUILD_ANDROID True ) - -# where is the target environment -set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" ) - -# only search for libraries and includes in the ndk toolchain -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) - - -# macro to find packages on the host OS -macro( find_host_package ) - set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) - set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER ) - set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER ) - if( CMAKE_HOST_WIN32 ) - SET( WIN32 1 ) - SET( UNIX ) - elseif( CMAKE_HOST_APPLE ) - SET( APPLE 1 ) - SET( UNIX ) - endif() - find_package( ${ARGN} ) - SET( WIN32 ) - SET( APPLE ) - SET( UNIX 1 ) - set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY ) - set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) - set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) -endmacro() - - -# macro to find programs on the host OS -macro( find_host_program ) - set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) - set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER ) - set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER ) - if( CMAKE_HOST_WIN32 ) - SET( WIN32 1 ) - SET( UNIX ) - elseif( CMAKE_HOST_APPLE ) - SET( APPLE 1 ) - SET( UNIX ) - endif() - find_program( ${ARGN} ) - SET( WIN32 ) - SET( APPLE ) - SET( UNIX 1 ) - set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY ) - set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) - set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) -endmacro() - - -# export toolchain settings for the try_compile() command -if( NOT _CMAKE_IN_TRY_COMPILE ) - set( __toolchain_config "") - foreach( __var NDK_CCACHE LIBRARY_OUTPUT_PATH_ROOT ANDROID_FORBID_SYGWIN - ANDROID_NDK_HOST_X64 - ANDROID_NDK - ANDROID_NDK_LAYOUT - ANDROID_STANDALONE_TOOLCHAIN - ANDROID_TOOLCHAIN_NAME - ANDROID_ABI - ANDROID_NATIVE_API_LEVEL - ANDROID_STL - ANDROID_STL_FORCE_FEATURES - ANDROID_FORCE_ARM_BUILD - ANDROID_NO_UNDEFINED - ANDROID_SO_UNDEFINED - ANDROID_FUNCTION_LEVEL_LINKING - ANDROID_GOLD_LINKER - ANDROID_NOEXECSTACK - ANDROID_RELRO - ANDROID_LIBM_PATH - ANDROID_EXPLICIT_CRT_LINK - ANDROID_APP_PIE - ) - if( DEFINED ${__var} ) - if( ${__var} MATCHES " ") - set( __toolchain_config "${__toolchain_config}set( ${__var} \"${${__var}}\" CACHE INTERNAL \"\" )\n" ) - else() - set( __toolchain_config "${__toolchain_config}set( ${__var} ${${__var}} CACHE INTERNAL \"\" )\n" ) - endif() - endif() - endforeach() - file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android.toolchain.config.cmake" "${__toolchain_config}" ) - unset( __toolchain_config ) -endif() - - -# force cmake to produce / instead of \ in build commands for Ninja generator -if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 ) - # it is a bad hack after all - # CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW - set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW - set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion - enable_language( C ) - enable_language( CXX ) - # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it - unset( MINGW ) -endif() - - -# Variables controlling behavior or set by cmake toolchain: -# ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips", "arm64-v8a", "x86_64", "mips64" -# ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14,15,16,17,18,19,21 (depends on NDK version) -# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none -# ANDROID_FORBID_SYGWIN : ON/OFF -# ANDROID_NO_UNDEFINED : ON/OFF -# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version) -# ANDROID_FUNCTION_LEVEL_LINKING : ON/OFF -# ANDROID_GOLD_LINKER : ON/OFF -# ANDROID_NOEXECSTACK : ON/OFF -# ANDROID_RELRO : ON/OFF -# ANDROID_FORCE_ARM_BUILD : ON/OFF -# ANDROID_STL_FORCE_FEATURES : ON/OFF -# ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product//obj/lib/libm.so) to workaround unresolved `sincos` -# Can be set only at the first run: -# ANDROID_NDK : path to your NDK install -# NDK_CCACHE : path to your ccache executable -# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain -# ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems) -# ANDROID_NDK_LAYOUT : the inner NDK structure (RELEASE, LINARO, ANDROID) -# LIBRARY_OUTPUT_PATH_ROOT : -# ANDROID_STANDALONE_TOOLCHAIN -# -# Primary read-only variables: -# ANDROID : always TRUE -# ARMEABI : TRUE for arm v6 and older devices -# ARMEABI_V6 : TRUE for arm v6 -# ARMEABI_V7A : TRUE for arm v7a -# ARM64_V8A : TRUE for arm64-v8a -# NEON : TRUE if NEON unit is enabled -# VFPV3 : TRUE if VFP version 3 is enabled -# X86 : TRUE if configured for x86 -# X86_64 : TRUE if configured for x86_64 -# MIPS : TRUE if configured for mips -# MIPS64 : TRUE if configured for mips64 -# BUILD_WITH_ANDROID_NDK : TRUE if NDK is used -# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used -# ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform -# ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI -# ANDROID_NDK_RELEASE : from r5 to r10d; set only for NDK -# ANDROID_NDK_RELEASE_NUM : numeric ANDROID_NDK_RELEASE version (1000*major+minor) -# ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI -# ANDROID_SYSROOT : path to the compiler sysroot -# TOOL_OS_SUFFIX : "" or ".exe" depending on host platform -# ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used -# -# Secondary (less stable) read-only variables: -# ANDROID_COMPILER_VERSION : GCC version used (not Clang version) -# ANDROID_CLANG_VERSION : version of clang compiler if clang is used -# ANDROID_CXX_FLAGS : C/C++ compiler flags required by Android platform -# ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI -# ANDROID_TOOLCHAIN_MACHINE_NAME : "arm-linux-androideabi", "arm-eabi" or "i686-android-linux" -# ANDROID_TOOLCHAIN_ROOT : path to the top level of toolchain (standalone or placed inside NDK) -# ANDROID_CLANG_TOOLCHAIN_ROOT : path to clang tools -# ANDROID_SUPPORTED_NATIVE_API_LEVELS : list of native API levels found inside NDK -# ANDROID_STL_INCLUDE_DIRS : stl include paths -# ANDROID_RTTI : if rtti is enabled by the runtime -# ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime -# ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used -# -# Defaults: -# ANDROID_DEFAULT_NDK_API_LEVEL -# ANDROID_DEFAULT_NDK_API_LEVEL_${ARCH} -# ANDROID_NDK_SEARCH_PATHS -# ANDROID_SUPPORTED_ABIS_${ARCH} -# ANDROID_SUPPORTED_NDK_VERSIONS \ No newline at end of file diff --git a/cmake/toolchains/iOS.toolchain.cmake b/cmake/toolchains/iOS.toolchain.cmake new file mode 100644 index 00000000..c697857f --- /dev/null +++ b/cmake/toolchains/iOS.toolchain.cmake @@ -0,0 +1,188 @@ +# Copyright (c) 2016, Bogdan Cristea +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake +# files which are included with CMake 2.8.4 +# It has been altered for iOS development + +# Options: +# +# IOS_PLATFORM = OS (default) or SIMULATOR +# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders +# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch. +# SIMULATOR - used to build for the Simulator platforms, which have an x86_64 arch. +# +# IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder +# By default this location is automatcially chosen based on the IOS_PLATFORM value above. +# If set manually, it will override the default location and force the user of a particular Developer Platform +# +# IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder +# By default this location is automatcially chosen based on the IOS_DEVELOPER_ROOT value. +# In this case it will always be the most up-to-date SDK found in the IOS_DEVELOPER_ROOT path. +# If set manually, this will force the use of a specific SDK version + +# Macros: +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE) +# A convenience macro for setting xcode specific properties on targets +# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1") +# +# find_host_package (PROGRAM ARGS) +# A macro used to find executable programs on the host system, not within the iOS environment. +# Thanks to the android-cmake project for providing the command + +# Standard settings +set (CMAKE_SYSTEM_NAME Darwin) +set (CMAKE_SYSTEM_VERSION 1) +set (UNIX True) +set (APPLE True) +set (IOS True) + +# Required as of cmake 2.8.10 +set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE) + +# Determine the cmake host system version so we know where to find the iOS SDKs +find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) +if (CMAKE_UNAME) + exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") +endif (CMAKE_UNAME) + +set(CMAKE_C_COMPILER /usr/bin/clang CACHE FILEPATH "" FORCE) +set(CMAKE_CXX_COMPILER /usr/bin/clang++ CACHE FILEPATH "" FORCE) +set(CMAKE_AR ar CACHE FILEPATH "" FORCE) + +# Skip the platform compiler checks for cross compiling +set (CMAKE_CXX_COMPILER_WORKS TRUE) +set (CMAKE_C_COMPILER_WORKS TRUE) + +# All iOS/Darwin specific settings - some may be redundant +set (CMAKE_SHARED_LIBRARY_PREFIX "lib") +set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set (CMAKE_SHARED_MODULE_PREFIX "lib") +set (CMAKE_SHARED_MODULE_SUFFIX ".so") +set (CMAKE_MODULE_EXISTS 1) +set (CMAKE_DL_LIBS "") + +set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") +set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +# Hidden visibilty is required for cxx on iOS +set (CMAKE_C_FLAGS_INIT "") +set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden") + +set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") +set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + +set (CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") +set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") +set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") + +# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree +# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache +# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun) +# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex +if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) +endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + +# Setup iOS platform unless specified manually with IOS_PLATFORM +if (NOT DEFINED IOS_PLATFORM) + set (IOS_PLATFORM "OS") +endif (NOT DEFINED IOS_PLATFORM) +set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform: OS or SIMULATOR") + +# Check the platform selection and setup for developer root +if (IOS_PLATFORM STREQUAL OS) + set (IOS_PLATFORM_LOCATION "iPhoneOS.platform") + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") +elseif (IOS_PLATFORM STREQUAL SIMULATOR) + set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform") + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") +else () + message (FATAL_ERROR "Unsupported IOS_PLATFORM value '${IOS_PLATFORM}' selected. Please choose OS or SIMULATOR") +endif () + +# Setup iOS developer location unless specified manually with IOS_DEVELOPER_ROOT +exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE XCODE_DEVELOPER_DIR) +set (IOS_DEVELOPER_ROOT "${XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer" CACHE PATH "Location of iOS Platform") + +# Find and use the most recent iOS sdk unless specified manually with IOS_SDK_ROOT +if (NOT DEFINED IOS_SDK_ROOT) + file (GLOB _IOS_SDKS "${IOS_DEVELOPER_ROOT}/SDKs/*") + if (_IOS_SDKS) + list (SORT _IOS_SDKS) + list (REVERSE _IOS_SDKS) + list (GET _IOS_SDKS 0 IOS_SDK_ROOT) + else (_IOS_SDKS) + message (FATAL_ERROR "No iOS SDK's found in default search path ${IOS_DEVELOPER_ROOT}. Manually set IOS_SDK_ROOT or install the iOS SDK.") + endif (_IOS_SDKS) + message (STATUS "Toolchain using default iOS SDK: ${IOS_SDK_ROOT}") +endif (NOT DEFINED IOS_SDK_ROOT) +set (IOS_SDK_ROOT ${IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK") + +# Set the sysroot default to the most recent SDK +set (CMAKE_OSX_SYSROOT ${IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support") + +# set the architecture for iOS +if (${IOS_PLATFORM} STREQUAL OS) + set (OSX_UNIVERSAL true) + set (IOS_ARCH arm64) +elseif (${IOS_PLATFORM} STREQUAL SIMULATOR) + set (IOS_ARCH x86_64) +endif (${IOS_PLATFORM} STREQUAL OS) + +set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS" FORCE) + +# Set the find root to the iOS developer roots and to user defined paths +set (CMAKE_FIND_ROOT_PATH ${IOS_DEVELOPER_ROOT} ${IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS find search path root") + +# default to searching for frameworks first +set (CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +set (CMAKE_SYSTEM_FRAMEWORK_PATH + ${IOS_SDK_ROOT}/System/Library/Frameworks + ${IOS_SDK_ROOT}/System/Library/PrivateFrameworks + ${IOS_SDK_ROOT}/Developer/Library/Frameworks +) + +# only search the iOS sdks, not the remainder of the host filesystem +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + + +# This macro lets you find executable programs on the host system +macro (find_host_package) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set (IOS FALSE) + + find_package(${ARGN}) + + set (IOS TRUE) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro (find_host_package) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index df02266d..d67f9062 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -52,11 +52,14 @@ add_custom_target(doc ALL WORKING_DIRECTORY ${DOXYGEN_INPUT_DIR}) # setup install rules +install(FILES ${DOXYGEN_OUTPUT_DIR}/SFML.tag + DESTINATION ${CMAKE_INSTALL_DOCDIR} + COMPONENT doc) install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html - DESTINATION ${INSTALL_MISC_DIR}/doc + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) if(DOXYGEN_HHC_PROGRAM) install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm - DESTINATION ${INSTALL_MISC_DIR}/doc + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) endif() diff --git a/doc/doxyfile.in b/doc/doxyfile.in index 47622e6f..104ff75b 100644 --- a/doc/doxyfile.in +++ b/doc/doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.8 +# Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -20,8 +20,8 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -46,10 +46,10 @@ PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -60,7 +60,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = "@DOXYGEN_OUTPUT_DIR@" -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -145,7 +145,7 @@ ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -215,9 +215,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -236,9 +236,27 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. -ALIASES = +#--------------------------------------------------------------------------- +# SFML specific aliases +#--------------------------------------------------------------------------- + +# sfplatform{platform(s)} +# sfplatform{platform(s), header} +# +# Warns the user that some specific class or function is only available on +# specific platforms. +# +# This shouldn't be used for incomplete implementations. It's meant for things +# that will never appear on another platform, e.g. Android's native activity. +# +# If a header is given, the user is informed, that this header must be included +# for the mentioned element to be defined. + +ALIASES = "sfplatform{1}=
Platform Limitation
This is only available on \1.
" \ + "sfplatform{2}=
Platform Limitation
This is only available on \1 and to use it, you'll have to specifically include \2 in your code.
" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" @@ -286,7 +304,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -301,12 +319,21 @@ EXTENSION_MAPPING = # case of backward compatibilities issues. # The default value is: YES. -MARKDOWN_SUPPORT = NO +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -328,7 +355,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -346,13 +373,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -411,7 +445,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -421,35 +455,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -474,21 +508,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -502,7 +536,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -511,12 +545,19 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -544,14 +585,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -596,27 +637,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -641,8 +680,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -687,7 +726,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -695,7 +734,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to @@ -706,7 +745,7 @@ CITE_BIB_FILES = QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -714,7 +753,7 @@ QUIET = NO WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -731,12 +770,18 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -760,7 +805,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = "@DOXYGEN_INPUT_DIR@/include/SFML" \ @@ -769,7 +814,7 @@ INPUT = "@DOXYGEN_INPUT_DIR@/include/SFML" \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -777,12 +822,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = *.hpp @@ -801,9 +851,10 @@ RECURSIVE = YES EXCLUDE = -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded # from the input. +# The default value is: NO. EXCLUDE_SYMLINKS = NO @@ -874,6 +925,10 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -883,11 +938,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -947,7 +1006,7 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -967,7 +1026,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -994,27 +1053,6 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. -# The default value is: NO. - -# Generates warnings with Clang -#CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -# Generates warnings with Clang -#CLANG_OPTIONS = - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1031,7 +1069,7 @@ ALPHABETICAL_INDEX = YES # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -COLS_IN_ALPHA_INDEX = 5 +COLS_IN_ALPHA_INDEX = 3 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag @@ -1045,7 +1083,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1107,18 +1145,14 @@ HTML_FOOTER = "@DOXYGEN_INPUT_DIR@/doc/footer.html" HTML_STYLESHEET = "@DOXYGEN_INPUT_DIR@/doc/doxygen.css" -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1135,9 +1169,9 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1166,12 +1200,24 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1195,12 +1241,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1263,28 +1309,28 @@ GENERATE_HTMLHELP = @DOXYGEN_GENERATE_HTMLHELP@ CHM_FILE = ../SFML.chm # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = "@DOXYGEN_HHC_PROGRAM@" -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1316,7 +1362,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1324,8 +1370,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1333,23 +1378,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1398,7 +1441,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1426,7 +1469,7 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1442,7 +1485,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1454,8 +1497,8 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1481,11 +1524,11 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example @@ -1541,9 +1584,9 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1554,9 +1597,9 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1592,7 +1635,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1623,7 +1666,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1641,9 +1684,12 @@ COMPACT_LATEX = NO PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1658,9 +1704,9 @@ EXTRA_PACKAGES = # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, # $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string, -# for the replacement values of the other commands the user is refered to -# HTML_HEADER. +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = @@ -1676,6 +1722,17 @@ LATEX_HEADER = LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1694,7 +1751,7 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1729,17 +1786,25 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1754,7 +1819,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1791,11 +1856,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1839,7 +1914,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1853,7 +1928,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1866,7 +1941,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1880,7 +1955,7 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the # program listings (including syntax highlighting and cross-referencing # information) to the DOCBOOK output. Note that enabling this will significantly # increase the size of the DOCBOOK output. @@ -1893,10 +1968,10 @@ DOCBOOK_PROGRAMLISTING = NO # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1905,7 +1980,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1913,7 +1988,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1921,9 +1996,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1943,14 +2018,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1966,7 +2041,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2000,7 +2075,9 @@ PREDEFINED = SFML_SYSTEM_API \ SFML_NETWORK_API \ SFML_WINDOW_API \ SFML_AUDIO_API \ - SFML_GRAPHICS_API + SFML_GRAPHICS_API \ + SFML_DEPRECATED \ + SFML_DOXYGEN # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2044,22 +2121,23 @@ TAGFILES = # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = @DOXYGEN_OUTPUT_DIR@/SFML.tag -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2076,7 +2154,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2101,7 +2179,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2174,7 +2252,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2226,7 +2304,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2237,7 +2316,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2260,11 +2340,15 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2312,10 +2396,19 @@ DIAFILE_DIRS = # PlantUML is not used or called during a preprocessing step. Doxygen will # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -# This tag requires that the tag HAVE_DOT is set to YES. PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2352,7 +2445,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2369,7 +2462,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/doc/doxygen.css b/doc/doxygen.css index ed4e6e40..9c2fc6a2 100644 --- a/doc/doxygen.css +++ b/doc/doxygen.css @@ -415,6 +415,10 @@ table.memberdecls { margin-left: 9px; } +.memtitle { + display: none; +} + .memnav { background-color: #EBEFF6; border: 1px solid #A3B4D7; @@ -1440,4 +1444,7 @@ div.contents ul li { border-width: 11px; top: 50%; margin-top: -11px; -} \ No newline at end of file +} +.arrow { + cursor: pointer; +} diff --git a/doc/footer.html b/doc/footer.html index 0e7569af..c9cd9375 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -1,7 +1,7 @@