Compare commits
4 Commits
upstream-r
...
master
Author | SHA1 | Date | |
---|---|---|---|
f12dd8f3c3 | |||
|
92d390139b | ||
|
ad006a3daa | ||
|
0bd2da935b |
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2
|
FindSDL2
|
||||||
--------
|
--------
|
||||||
@ -206,7 +237,7 @@ endif()
|
|||||||
# But for non-OSX systems, I will use the CMake Threads package.
|
# But for non-OSX systems, I will use the CMake Threads package.
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
find_package(Threads QUIET)
|
find_package(Threads QUIET)
|
||||||
if(NOT CMAKE_THREAD_LIBS_INIT)
|
if(NOT Threads_FOUND)
|
||||||
set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).")
|
set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).")
|
||||||
if(SDL2_FIND_REQUIRED)
|
if(SDL2_FIND_REQUIRED)
|
||||||
message(FATAL_ERROR ${SDL2_THREADS_NOT_FOUND})
|
message(FATAL_ERROR ${SDL2_THREADS_NOT_FOUND})
|
||||||
@ -243,7 +274,7 @@ if(SDL2_LIBRARY)
|
|||||||
# So I use a temporary variable until the end so I can set the
|
# So I use a temporary variable until the end so I can set the
|
||||||
# "real" variable in one-shot.
|
# "real" variable in one-shot.
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(SDL2_LIBRARIES ${SDL2_LIBRARIES} "-framework Cocoa")
|
set(SDL2_LIBRARIES ${SDL2_LIBRARIES} -framework Cocoa)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For threads, as mentioned Apple doesn't need this.
|
# For threads, as mentioned Apple doesn't need this.
|
||||||
@ -277,16 +308,23 @@ if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
|
|||||||
unset(SDL2_VERSION_PATCH)
|
unset(SDL2_VERSION_PATCH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
||||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
||||||
VERSION_VAR SDL2_VERSION_STRING)
|
VERSION_VAR SDL2_VERSION_STRING)
|
||||||
|
|
||||||
if(SDL2MAIN_LIBRARY)
|
if(SDL2MAIN_LIBRARY)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2main
|
if(${CMAKE_VERSION} VERSION_LESS "3.19.2")
|
||||||
REQUIRED_VARS SDL2MAIN_LIBRARY SDL2_INCLUDE_DIR
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2main
|
||||||
VERSION_VAR SDL2_VERSION_STRING)
|
REQUIRED_VARS SDL2MAIN_LIBRARY SDL2_INCLUDE_DIR
|
||||||
|
VERSION_VAR SDL2_VERSION_STRING)
|
||||||
|
else()
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2main
|
||||||
|
REQUIRED_VARS SDL2MAIN_LIBRARY SDL2_INCLUDE_DIR
|
||||||
|
VERSION_VAR SDL2_VERSION_STRING
|
||||||
|
NAME_MISMATCHED)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -312,7 +350,7 @@ if(SDL2_FOUND)
|
|||||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||||
# For more details, please see above.
|
# For more details, please see above.
|
||||||
set_property(TARGET SDL2::Core APPEND PROPERTY
|
set_property(TARGET SDL2::Core APPEND PROPERTY
|
||||||
INTERFACE_LINK_OPTIONS "-framework Cocoa")
|
INTERFACE_LINK_OPTIONS -framework Cocoa)
|
||||||
else()
|
else()
|
||||||
# For threads, as mentioned Apple doesn't need this.
|
# For threads, as mentioned Apple doesn't need this.
|
||||||
# For more details, please see above.
|
# For more details, please see above.
|
||||||
|
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2_gfx
|
FindSDL2_gfx
|
||||||
--------------
|
--------------
|
||||||
@ -165,7 +196,7 @@ endif()
|
|||||||
set(SDL2_GFX_LIBRARIES ${SDL2_GFX_LIBRARY})
|
set(SDL2_GFX_LIBRARIES ${SDL2_GFX_LIBRARY})
|
||||||
set(SDL2_GFX_INCLUDE_DIRS ${SDL2_GFX_INCLUDE_DIR})
|
set(SDL2_GFX_INCLUDE_DIRS ${SDL2_GFX_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_gfx
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_gfx
|
||||||
REQUIRED_VARS SDL2_GFX_LIBRARIES SDL2_GFX_INCLUDE_DIRS
|
REQUIRED_VARS SDL2_GFX_LIBRARIES SDL2_GFX_INCLUDE_DIRS
|
||||||
|
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2_image
|
FindSDL2_image
|
||||||
--------------
|
--------------
|
||||||
@ -165,7 +196,7 @@ endif()
|
|||||||
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY})
|
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY})
|
||||||
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR})
|
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
|
||||||
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
|
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
|
||||||
|
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2_mixer
|
FindSDL2_mixer
|
||||||
--------------
|
--------------
|
||||||
@ -163,7 +194,7 @@ endif()
|
|||||||
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
|
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
|
||||||
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})
|
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
|
||||||
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
|
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
|
||||||
|
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2_net
|
FindSDL2_net
|
||||||
------------
|
------------
|
||||||
@ -165,7 +196,7 @@ endif()
|
|||||||
set(SDL2_NET_LIBRARIES ${SDL2_NET_LIBRARY})
|
set(SDL2_NET_LIBRARIES ${SDL2_NET_LIBRARY})
|
||||||
set(SDL2_NET_INCLUDE_DIRS ${SDL2_NET_INCLUDE_DIR})
|
set(SDL2_NET_INCLUDE_DIRS ${SDL2_NET_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_net
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_net
|
||||||
REQUIRED_VARS SDL2_NET_LIBRARIES SDL2_NET_INCLUDE_DIRS
|
REQUIRED_VARS SDL2_NET_LIBRARIES SDL2_NET_INCLUDE_DIRS
|
||||||
|
@ -1,6 +1,37 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
# Copyright 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
|
# Copyright 2000-2019 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
# * 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.
|
||||||
|
|
||||||
|
# * Neither the name of Kitware, Inc. nor the names of 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.
|
||||||
|
|
||||||
#[=======================================================================[.rst:
|
#[=======================================================================[.rst:
|
||||||
FindSDL2_ttf
|
FindSDL2_ttf
|
||||||
------------
|
------------
|
||||||
@ -165,7 +196,7 @@ endif()
|
|||||||
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
|
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
|
||||||
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
|
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
|
||||||
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
|
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
|
||||||
|
29
README.md
29
README.md
@ -44,8 +44,33 @@ The improvements made to these modules are as follows:
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
There is two approaches that can be adopted: A legacy approach and a modern
|
In order to use the SDL2 CMake modules, we have to clone this repository in a
|
||||||
approach. Both of them are supported.
|
sud-directory `cmake/sdl2` in our project as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd <PROJECT_DIR>
|
||||||
|
git clone https://gitlab.com/aminosbh/sdl2-cmake-modules.git cmake/sdl2
|
||||||
|
rm -rf cmake/sdl2/.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if we are using git for our project, we can add this repository as a
|
||||||
|
submodule as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd <PROJECT_DIR>
|
||||||
|
git submodule add https://gitlab.com/aminosbh/sdl2-cmake-modules.git cmake/sdl2
|
||||||
|
git commit -m "Add SDL2 CMake modules"
|
||||||
|
```
|
||||||
|
|
||||||
|
Then we should specify the modules path in the main CMakeLists.txt file like
|
||||||
|
the following:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2)
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, we can use the SDL2 modules. There is two approaches that can be
|
||||||
|
adopted: A legacy approach and a modern approach. Both of them are supported.
|
||||||
|
|
||||||
### Modern CMake
|
### Modern CMake
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user