Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the SDL2 CMake modules #190

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 0 additions & 173 deletions cmake/FindSDL2.cmake

This file was deleted.

100 changes: 0 additions & 100 deletions cmake/FindSDL2_image.cmake

This file was deleted.

29 changes: 21 additions & 8 deletions cmake/FindSDL2_ttf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,28 @@
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.

find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
Expand Down
12 changes: 6 additions & 6 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ if (SDL2_FOUND AND SDL2_ttf_FOUND)
add_executable(counter-sdl2 EXCLUDE_FROM_ALL
counter/sdl2/main.cpp)
target_include_directories(counter-sdl2 SYSTEM PUBLIC
${SDL2_INCLUDE_DIR}
${SDL2_INCLUDE_DIRS}
${SDL2_TTF_INCLUDE_DIR})
target_link_libraries(counter-sdl2
lager-debugger-example
${SDL2_LIBRARY}
${SDL2_LIBRARIES}
${SDL2_TTF_LIBRARIES})
add_dependencies(examples counter-sdl2)

add_executable(autopong EXCLUDE_FROM_ALL
autopong/autopong.cpp
autopong/sdl2/main.cpp)
target_include_directories(autopong SYSTEM PUBLIC
${SDL2_INCLUDE_DIR}
${SDL2_INCLUDE_DIRS}
${SDL2_TTF_INCLUDE_DIR})
target_link_libraries(autopong
lager-debugger-example
${SDL2_LIBRARY}
${SDL2_LIBRARIES}
${SDL2_TTF_LIBRARIES})
add_dependencies(examples autopong)

Expand All @@ -88,11 +88,11 @@ if (SDL2_FOUND AND SDL2_ttf_FOUND)
autopong/sdl2/main.cpp)
target_compile_definitions(autopong-debug PUBLIC DEBUGGER)
target_include_directories(autopong-debug SYSTEM PUBLIC
${SDL2_INCLUDE_DIR}
${SDL2_INCLUDE_DIRS}
${SDL2_TTF_INCLUDE_DIR})
target_link_libraries(autopong-debug
lager-debugger-example
${SDL2_LIBRARY}
${SDL2_LIBRARIES}
${SDL2_TTF_LIBRARIES})
add_dependencies(examples autopong-debug)
endif()
Expand Down
Loading