Skip to content

Commit

Permalink
add SDL files
Browse files Browse the repository at this point in the history
  • Loading branch information
spiroskou committed Aug 17, 2024
1 parent 3232ccb commit f2e6822
Show file tree
Hide file tree
Showing 129 changed files with 61,364 additions and 58 deletions.
33 changes: 27 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,43 @@ cmake_minimum_required (VERSION 3.8)

project ("OpenChess")

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# SDL2 paths
set(SDL2_DIR "${CMAKE_SOURCE_DIR}/SDL/SDL2-devel-2.30.4-VC/SDL2-2.30.4/")
set(SDL2_INCLUDE_DIR "${SDL2_DIR}/include")
set(SDL2_LIBRARY "${SDL2_DIR}/lib/x64/SDL2.lib") # Adjust if you have a different lib name
set(SDL2MAIN_LIBRARY "${SDL2_DIR}/lib/x64/SDL2main.lib")

find_package(SDL2 REQUIRED CONFIG)
find_package(SDL2_image REQUIRED)
# SDL2_image paths
set(SDL2_IMAGE_DIR "${CMAKE_SOURCE_DIR}/SDL/SDL2_image-2.8.2")
set(SDL2_IMAGE_INCLUDE_DIR "${SDL2_IMAGE_DIR}/include")
set(SDL2_IMAGE_LIBRARY "${SDL2_IMAGE_DIR}/lib/x64/SDL2_image.lib") # Adjust similarly

# Print the variables to see their values
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS})
include_directories(Board Pieces)
include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR})
include_directories(Pieces Board)

# Add source to this project's executable.
add_executable (OpenChess "main.cpp" "Pieces/Piece.h" "Pieces/King.h" "Pieces/King.cpp" "Pieces/Rook.h" "Pieces/Rook.cpp" "Pieces/Queen.h" "Pieces/Queen.cpp" "Pieces/Pawn.h" "Pieces/Pawn.cpp" "Pieces/Bishop.h" "Pieces/Bishop.cpp" "Pieces/Knight.h" "Pieces/Knight.cpp" "Board/Board.cpp" "Board/Board.h" "ChessSDL.cpp" "ChessSDL.h" "Pieces/Piece.cpp")

target_link_libraries(OpenChess ${SDL2_LIBRARIES} SDL2_image::SDL2_image)
target_link_libraries(OpenChess ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARY} ${SDL2MAIN_LIBRARY})

if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET OpenChess PROPERTY CXX_STANDARD 20)
endif()

if(WIN32)
set_target_properties(OpenChess PROPERTIES
WIN32_EXECUTABLE YES
)
endif()

add_custom_command(TARGET OpenChess POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${SDL2_DIR}/lib/x64/SDL2.dll"
$<TARGET_FILE_DIR:OpenChess>)
add_custom_command(TARGET OpenChess POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${SDL2_IMAGE_DIR}/lib/x64/SDL2_image.dll"
$<TARGET_FILE_DIR:OpenChess>)

# TODO: Add tests and install targets if needed.
16 changes: 16 additions & 0 deletions SDL/SDL2-devel-2.30.4-VC/SDL2-2.30.4/BUGS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Bugs are now managed in the SDL issue tracker, here:

https://github.com/libsdl-org/SDL/issues

You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.


You may also find help at the SDL forums/mailing list:

https://discourse.libsdl.org/

Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.

20 changes: 20 additions & 0 deletions SDL/SDL2-devel-2.30.4-VC/SDL2-2.30.4/COPYING.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

13 changes: 13 additions & 0 deletions SDL/SDL2-devel-2.30.4-VC/SDL2-2.30.4/README-SDL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Please distribute this file with the SDL runtime environment:

The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.

The Simple DirectMedia Layer library source code is available from:
https://www.libsdl.org/

This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html

21 changes: 21 additions & 0 deletions SDL/SDL2-devel-2.30.4-VC/SDL2-2.30.4/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Simple DirectMedia Layer

(SDL)

Version 2.0

---
https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
Sam Lantinga (slouken@libsdl.org)
Loading

0 comments on commit f2e6822

Please sign in to comment.