Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
35e776c6e2 |
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,9 +1,6 @@
|
||||
# ---> KDevelop4
|
||||
#*.kdev4
|
||||
#.kdev4/
|
||||
|
||||
# ---> build artifacts
|
||||
build/*
|
||||
*.kdev4
|
||||
.kdev4/
|
||||
|
||||
# ---> C++
|
||||
# Prerequisites
|
||||
@ -92,6 +89,3 @@ Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
# CMake artifacts
|
||||
CMakeCache.txt
|
||||
|
||||
|
@ -1,94 +0,0 @@
|
||||
<<<<<<< HEAD
|
||||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00 \x00B\x00e\x00a\x00g\x00l\x00e\x00R\x00e\x00s\x00c\x00u\x00e\x00.\x00g\x00i\x00t)
|
||||
|
||||
[CMake]
|
||||
Build Directory Count=1
|
||||
Current Build Directory Index-Host System=0
|
||||
|
||||
[CMake][CMake Build Directory 0]
|
||||
Build Directory Path=/home/ayoungblood/BeagleRescue.git/build
|
||||
Build Type=Release
|
||||
CMake Binary=/usr/bin/cmake
|
||||
CMake Executable=/usr/bin/cmake
|
||||
Environment Profile=
|
||||
Extra Arguments=
|
||||
Install Directory=
|
||||
Runtime=Host System
|
||||
|
||||
[CustomDefinesAndIncludes][ProjectPath0]
|
||||
Path=.
|
||||
parseAmbiguousAsCPP=true
|
||||
parserArguments=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c++17
|
||||
parserArgumentsC=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c99
|
||||
parserArgumentsCuda=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c++11
|
||||
parserArgumentsOpenCL=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -cl-std=CL1.1
|
||||
|
||||
[CustomDefinesAndIncludes][ProjectPath0][Compiler]
|
||||
Name=GCC
|
||||
|
||||
[Launch]
|
||||
Launch Configurations=Launch Configuration 0
|
||||
|
||||
[Launch][Launch Configuration 0]
|
||||
Configured Launch Modes=execute,debug
|
||||
Configured Launchers=nativeAppLauncher,lldb
|
||||
Name=BeagleRescue
|
||||
Type=Native Application
|
||||
|
||||
[Launch][Launch Configuration 0][Data]
|
||||
Arguments=
|
||||
Break on Start=false
|
||||
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00)
|
||||
Dependency Action=Nothing
|
||||
EnvironmentGroup=
|
||||
Executable=file:///home/ayoungblood/BeagleRescue.git/build/BeagleRescue
|
||||
External Terminal=konsole --noclose --workdir %workdir -e %exe
|
||||
Kill Before Executing Again=4194304
|
||||
LLDB Arguments=
|
||||
LLDB Config Script=
|
||||
LLDB Environment=
|
||||
LLDB Executable=
|
||||
LLDB Inherit System Env=true
|
||||
LLDB Remote Debugging=false
|
||||
LLDB Remote Path=
|
||||
LLDB Remote Server=
|
||||
Project Target=BeagleRescue,BeagleRescue
|
||||
Start With=ApplicationOutput
|
||||
Use External Terminal=false
|
||||
Working Directory=file:///home/ayoungblood/BeagleRescue.git
|
||||
isExecutable=true
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
||||
||||||| 8aa7974
|
||||
=======
|
||||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00 \x00B\x00e\x00a\x00g\x00l\x00e\x00R\x00e\x00s\x00c\x00u\x00e\x00.\x00g\x00i\x00t)
|
||||
|
||||
[CMake]
|
||||
Build Directory Count=1
|
||||
Current Build Directory Index-Host System=0
|
||||
|
||||
[CMake][CMake Build Directory 0]
|
||||
Build Directory Path=/home/ayoungblood/projects/BeagleRescue.git/build
|
||||
Build Type=Release
|
||||
CMake Binary=/usr/bin/cmake
|
||||
CMake Executable=/usr/bin/cmake
|
||||
Environment Profile=
|
||||
Extra Arguments=
|
||||
Install Directory=
|
||||
Runtime=Host System
|
||||
|
||||
[Launch]
|
||||
Launch Configurations=Launch Configuration 0
|
||||
|
||||
[Launch][Launch Configuration 0]
|
||||
Configured Launch Modes=execute
|
||||
Configured Launchers=nativeAppLauncher
|
||||
Name=New Compiled Binary Launcher
|
||||
Type=Native Application
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
||||
>>>>>>> a3d13f32a5f0e4e11c618a4c3d524fd52fc0ed08
|
@ -1,51 +0,0 @@
|
||||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x18\x00B\x00e\x00a\x00g\x00l\x00e\x00R\x00e\x00s\x00c\x00u\x00e)
|
||||
|
||||
[CMake]
|
||||
Build Directory Count=2
|
||||
Current Build Directory Index-Host System=0
|
||||
Temporary Build Directory Index=1
|
||||
|
||||
[CMake][CMake Build Directory 0]
|
||||
Build Directory Path=/home/ayoungblood/projects/BeagleRescue/build
|
||||
Build Type=Release
|
||||
CMake Binary=/usr/bin/cmake
|
||||
CMake Executable=/usr/bin/cmake
|
||||
Environment Profile=
|
||||
Extra Arguments=
|
||||
Install Directory=/usr/local
|
||||
Runtime=Host System
|
||||
|
||||
[CMake][CMake Build Directory 1]
|
||||
Build Directory Path=/home/ayoungblood/Projects/BeagleRescue/build
|
||||
Build Type=Release
|
||||
CMake Binary=/usr/bin/cmake
|
||||
CMake Executable=/usr/bin/cmake
|
||||
Environment Profile=
|
||||
Extra Arguments=
|
||||
Install Directory=
|
||||
|
||||
[Launch]
|
||||
Launch Configurations=Launch Configuration 0
|
||||
|
||||
[Launch][Launch Configuration 0]
|
||||
Configured Launch Modes=execute
|
||||
Configured Launchers=nativeAppLauncher
|
||||
Name=BeagleRescue
|
||||
Type=Native Application
|
||||
|
||||
[Launch][Launch Configuration 0][Data]
|
||||
Arguments=
|
||||
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00)
|
||||
Dependency Action=Nothing
|
||||
EnvironmentGroup=
|
||||
Executable=file:///home/ayoungblood/Projects/BeagleRescue
|
||||
External Terminal=konsole --noclose --workdir %workdir -e %exe
|
||||
Kill Before Executing Again=4194304
|
||||
Project Target=BeagleRescue,BeagleRescue
|
||||
Use External Terminal=false
|
||||
Working Directory=file:///home/ayoungblood/projects/BeagleRescue
|
||||
isExecutable=true
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
@ -1,28 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.25.1)
|
||||
project(KaijuSaveEarth VERSION 1.0.0 )
|
||||
|
||||
#set(CMAKE_CXX_STANDARD 11) # old requirements
|
||||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to be used") # new requirements for tileson
|
||||
set(CMAKE_CXX_REQUIRED ON)
|
||||
|
||||
include(FetchContent)
|
||||
include(FindPkgConfig)
|
||||
|
||||
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
|
||||
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)
|
||||
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer>=2.0.0)
|
||||
project(BeagleRescue)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# Point to our own cmake modules
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/sdl2)
|
||||
|
||||
# Find SDL2
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(SDL2_mixer REQUIRED)
|
||||
|
||||
# Add global definitions
|
||||
add_definitions("-Wall")
|
||||
include_directories(${PROJECT_NAME} ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS} ${SDL2MIXER_INCLUDE_DIRS})
|
||||
#add_custom_target(${TMXPARSER})
|
||||
include_directories(${SDL2_INCLUDE_DIR})
|
||||
|
||||
file(GLOB_RECURSE CSOURCES src/cjson/*.c)
|
||||
file(GLOB_RECURSE CPPSOURCES src/*.cpp)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${CSOURCES} ${CPPSOURCES})
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES} ${SDL2MIXER_LIBRARIES})
|
||||
add_executable(BeagleRescue src/game/Main.cpp)
|
||||
install(TARGETS BeagleRescue DESTINATION bin)
|
||||
target_link_libraries(BeagleRescue ${SDL2_LIBRARIES} SDL2::Mixer SDL::Image)
|
||||
|
@ -1,5 +0,0 @@
|
||||
[Project]
|
||||
CreatedFrom=CMakeLists.txt
|
||||
Manager=KDevCMakeManager
|
||||
Name=KaijuSaveEarth
|
||||
VersionControl=%{VERSIONCONTROLPLUGIN}
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
MIT License Copyright (c) 2023 Alan Youngblood
|
||||
MIT License Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
608
Makefile
608
Makefile
@ -1,608 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
.PHONY : default_target
|
||||
|
||||
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||
.NOTPARALLEL:
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : %,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : SCCS/s.%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : s.%
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
# Command-line flag to silence nested $(MAKE).
|
||||
$(VERBOSE)MAKESILENT = -s
|
||||
|
||||
#Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
# The shell in which to execute make rules.
|
||||
SHELL = /bin/sh
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = /usr/bin/cmake
|
||||
|
||||
# The command to remove a file.
|
||||
RM = /usr/bin/cmake -E rm -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = /home/ayoungblood/Projects/BeagleRescue
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = /home/ayoungblood/Projects/BeagleRescue
|
||||
|
||||
#=============================================================================
|
||||
# Targets provided globally by CMake.
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
|
||||
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
|
||||
.PHONY : edit_cache
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache/fast: edit_cache
|
||||
.PHONY : edit_cache/fast
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||
/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||
.PHONY : rebuild_cache
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache/fast: rebuild_cache
|
||||
.PHONY : rebuild_cache/fast
|
||||
|
||||
# Special rule for the target list_install_components
|
||||
list_install_components:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
|
||||
.PHONY : list_install_components
|
||||
|
||||
# Special rule for the target list_install_components
|
||||
list_install_components/fast: list_install_components
|
||||
.PHONY : list_install_components/fast
|
||||
|
||||
# Special rule for the target install
|
||||
install: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
||||
/usr/bin/cmake -P cmake_install.cmake
|
||||
.PHONY : install
|
||||
|
||||
# Special rule for the target install
|
||||
install/fast: preinstall/fast
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
||||
/usr/bin/cmake -P cmake_install.cmake
|
||||
.PHONY : install/fast
|
||||
|
||||
# Special rule for the target install/local
|
||||
install/local: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
||||
.PHONY : install/local
|
||||
|
||||
# Special rule for the target install/local
|
||||
install/local/fast: preinstall/fast
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
||||
.PHONY : install/local/fast
|
||||
|
||||
# Special rule for the target install/strip
|
||||
install/strip: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
||||
.PHONY : install/strip
|
||||
|
||||
# Special rule for the target install/strip
|
||||
install/strip/fast: preinstall/fast
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
||||
.PHONY : install/strip/fast
|
||||
|
||||
# The main all target
|
||||
all: cmake_check_build_system
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/ayoungblood/Projects/BeagleRescue/CMakeFiles /home/ayoungblood/Projects/BeagleRescue//CMakeFiles/progress.marks
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/ayoungblood/Projects/BeagleRescue/CMakeFiles 0
|
||||
.PHONY : all
|
||||
|
||||
# The main clean target
|
||||
clean:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
|
||||
.PHONY : clean
|
||||
|
||||
# The main clean target
|
||||
clean/fast: clean
|
||||
.PHONY : clean/fast
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall: all
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
|
||||
.PHONY : preinstall
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall/fast:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
|
||||
.PHONY : preinstall/fast
|
||||
|
||||
# clear depends
|
||||
depend:
|
||||
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||
.PHONY : depend
|
||||
|
||||
#=============================================================================
|
||||
# Target rules for targets named BeagleRescue
|
||||
|
||||
# Build rule for target.
|
||||
BeagleRescue: cmake_check_build_system
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 BeagleRescue
|
||||
.PHONY : BeagleRescue
|
||||
|
||||
# fast build rule for target.
|
||||
BeagleRescue/fast:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/build
|
||||
.PHONY : BeagleRescue/fast
|
||||
|
||||
src/assetmgr/AssetManager.o: src/assetmgr/AssetManager.cpp.o
|
||||
.PHONY : src/assetmgr/AssetManager.o
|
||||
|
||||
# target to build an object file
|
||||
src/assetmgr/AssetManager.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.o
|
||||
.PHONY : src/assetmgr/AssetManager.cpp.o
|
||||
|
||||
src/assetmgr/AssetManager.i: src/assetmgr/AssetManager.cpp.i
|
||||
.PHONY : src/assetmgr/AssetManager.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/assetmgr/AssetManager.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.i
|
||||
.PHONY : src/assetmgr/AssetManager.cpp.i
|
||||
|
||||
src/assetmgr/AssetManager.s: src/assetmgr/AssetManager.cpp.s
|
||||
.PHONY : src/assetmgr/AssetManager.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/assetmgr/AssetManager.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.s
|
||||
.PHONY : src/assetmgr/AssetManager.cpp.s
|
||||
|
||||
src/assetmgr/GameObject.o: src/assetmgr/GameObject.cpp.o
|
||||
.PHONY : src/assetmgr/GameObject.o
|
||||
|
||||
# target to build an object file
|
||||
src/assetmgr/GameObject.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.o
|
||||
.PHONY : src/assetmgr/GameObject.cpp.o
|
||||
|
||||
src/assetmgr/GameObject.i: src/assetmgr/GameObject.cpp.i
|
||||
.PHONY : src/assetmgr/GameObject.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/assetmgr/GameObject.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.i
|
||||
.PHONY : src/assetmgr/GameObject.cpp.i
|
||||
|
||||
src/assetmgr/GameObject.s: src/assetmgr/GameObject.cpp.s
|
||||
.PHONY : src/assetmgr/GameObject.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/assetmgr/GameObject.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.s
|
||||
.PHONY : src/assetmgr/GameObject.cpp.s
|
||||
|
||||
src/assetmgr/Map.o: src/assetmgr/Map.cpp.o
|
||||
.PHONY : src/assetmgr/Map.o
|
||||
|
||||
# target to build an object file
|
||||
src/assetmgr/Map.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/Map.cpp.o
|
||||
.PHONY : src/assetmgr/Map.cpp.o
|
||||
|
||||
src/assetmgr/Map.i: src/assetmgr/Map.cpp.i
|
||||
.PHONY : src/assetmgr/Map.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/assetmgr/Map.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/Map.cpp.i
|
||||
.PHONY : src/assetmgr/Map.cpp.i
|
||||
|
||||
src/assetmgr/Map.s: src/assetmgr/Map.cpp.s
|
||||
.PHONY : src/assetmgr/Map.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/assetmgr/Map.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/Map.cpp.s
|
||||
.PHONY : src/assetmgr/Map.cpp.s
|
||||
|
||||
src/assetmgr/MusicManager.o: src/assetmgr/MusicManager.cpp.o
|
||||
.PHONY : src/assetmgr/MusicManager.o
|
||||
|
||||
# target to build an object file
|
||||
src/assetmgr/MusicManager.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.o
|
||||
.PHONY : src/assetmgr/MusicManager.cpp.o
|
||||
|
||||
src/assetmgr/MusicManager.i: src/assetmgr/MusicManager.cpp.i
|
||||
.PHONY : src/assetmgr/MusicManager.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/assetmgr/MusicManager.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.i
|
||||
.PHONY : src/assetmgr/MusicManager.cpp.i
|
||||
|
||||
src/assetmgr/MusicManager.s: src/assetmgr/MusicManager.cpp.s
|
||||
.PHONY : src/assetmgr/MusicManager.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/assetmgr/MusicManager.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.s
|
||||
.PHONY : src/assetmgr/MusicManager.cpp.s
|
||||
|
||||
src/assetmgr/TextureManager.o: src/assetmgr/TextureManager.cpp.o
|
||||
.PHONY : src/assetmgr/TextureManager.o
|
||||
|
||||
# target to build an object file
|
||||
src/assetmgr/TextureManager.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.o
|
||||
.PHONY : src/assetmgr/TextureManager.cpp.o
|
||||
|
||||
src/assetmgr/TextureManager.i: src/assetmgr/TextureManager.cpp.i
|
||||
.PHONY : src/assetmgr/TextureManager.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/assetmgr/TextureManager.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.i
|
||||
.PHONY : src/assetmgr/TextureManager.cpp.i
|
||||
|
||||
src/assetmgr/TextureManager.s: src/assetmgr/TextureManager.cpp.s
|
||||
.PHONY : src/assetmgr/TextureManager.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/assetmgr/TextureManager.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.s
|
||||
.PHONY : src/assetmgr/TextureManager.cpp.s
|
||||
|
||||
src/cjson/cJSON.o: src/cjson/cJSON.c.o
|
||||
.PHONY : src/cjson/cJSON.o
|
||||
|
||||
# target to build an object file
|
||||
src/cjson/cJSON.c.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/cjson/cJSON.c.o
|
||||
.PHONY : src/cjson/cJSON.c.o
|
||||
|
||||
src/cjson/cJSON.i: src/cjson/cJSON.c.i
|
||||
.PHONY : src/cjson/cJSON.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/cjson/cJSON.c.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/cjson/cJSON.c.i
|
||||
.PHONY : src/cjson/cJSON.c.i
|
||||
|
||||
src/cjson/cJSON.s: src/cjson/cJSON.c.s
|
||||
.PHONY : src/cjson/cJSON.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/cjson/cJSON.c.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/cjson/cJSON.c.s
|
||||
.PHONY : src/cjson/cJSON.c.s
|
||||
|
||||
src/ecs/ECS.o: src/ecs/ECS.cpp.o
|
||||
.PHONY : src/ecs/ECS.o
|
||||
|
||||
# target to build an object file
|
||||
src/ecs/ECS.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ecs/ECS.cpp.o
|
||||
.PHONY : src/ecs/ECS.cpp.o
|
||||
|
||||
src/ecs/ECS.i: src/ecs/ECS.cpp.i
|
||||
.PHONY : src/ecs/ECS.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/ecs/ECS.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ecs/ECS.cpp.i
|
||||
.PHONY : src/ecs/ECS.cpp.i
|
||||
|
||||
src/ecs/ECS.s: src/ecs/ECS.cpp.s
|
||||
.PHONY : src/ecs/ECS.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/ecs/ECS.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ecs/ECS.cpp.s
|
||||
.PHONY : src/ecs/ECS.cpp.s
|
||||
|
||||
src/game/Collision.o: src/game/Collision.cpp.o
|
||||
.PHONY : src/game/Collision.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/Collision.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.o
|
||||
.PHONY : src/game/Collision.cpp.o
|
||||
|
||||
src/game/Collision.i: src/game/Collision.cpp.i
|
||||
.PHONY : src/game/Collision.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/Collision.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.i
|
||||
.PHONY : src/game/Collision.cpp.i
|
||||
|
||||
src/game/Collision.s: src/game/Collision.cpp.s
|
||||
.PHONY : src/game/Collision.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/Collision.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.s
|
||||
.PHONY : src/game/Collision.cpp.s
|
||||
|
||||
src/game/Game.o: src/game/Game.cpp.o
|
||||
.PHONY : src/game/Game.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/Game.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.o
|
||||
.PHONY : src/game/Game.cpp.o
|
||||
|
||||
src/game/Game.i: src/game/Game.cpp.i
|
||||
.PHONY : src/game/Game.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/Game.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.i
|
||||
.PHONY : src/game/Game.cpp.i
|
||||
|
||||
src/game/Game.s: src/game/Game.cpp.s
|
||||
.PHONY : src/game/Game.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/Game.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.s
|
||||
.PHONY : src/game/Game.cpp.s
|
||||
|
||||
src/game/GameStateManager.o: src/game/GameStateManager.cpp.o
|
||||
.PHONY : src/game/GameStateManager.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/GameStateManager.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/GameStateManager.cpp.o
|
||||
.PHONY : src/game/GameStateManager.cpp.o
|
||||
|
||||
src/game/GameStateManager.i: src/game/GameStateManager.cpp.i
|
||||
.PHONY : src/game/GameStateManager.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/GameStateManager.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/GameStateManager.cpp.i
|
||||
.PHONY : src/game/GameStateManager.cpp.i
|
||||
|
||||
src/game/GameStateManager.s: src/game/GameStateManager.cpp.s
|
||||
.PHONY : src/game/GameStateManager.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/GameStateManager.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/GameStateManager.cpp.s
|
||||
.PHONY : src/game/GameStateManager.cpp.s
|
||||
|
||||
src/game/Main.o: src/game/Main.cpp.o
|
||||
.PHONY : src/game/Main.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/Main.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.o
|
||||
.PHONY : src/game/Main.cpp.o
|
||||
|
||||
src/game/Main.i: src/game/Main.cpp.i
|
||||
.PHONY : src/game/Main.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/Main.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.i
|
||||
.PHONY : src/game/Main.cpp.i
|
||||
|
||||
src/game/Main.s: src/game/Main.cpp.s
|
||||
.PHONY : src/game/Main.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/Main.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.s
|
||||
.PHONY : src/game/Main.cpp.s
|
||||
|
||||
src/game/StateMachine.o: src/game/StateMachine.cpp.o
|
||||
.PHONY : src/game/StateMachine.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/StateMachine.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/StateMachine.cpp.o
|
||||
.PHONY : src/game/StateMachine.cpp.o
|
||||
|
||||
src/game/StateMachine.i: src/game/StateMachine.cpp.i
|
||||
.PHONY : src/game/StateMachine.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/StateMachine.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/StateMachine.cpp.i
|
||||
.PHONY : src/game/StateMachine.cpp.i
|
||||
|
||||
src/game/StateMachine.s: src/game/StateMachine.cpp.s
|
||||
.PHONY : src/game/StateMachine.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/StateMachine.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/StateMachine.cpp.s
|
||||
.PHONY : src/game/StateMachine.cpp.s
|
||||
|
||||
src/game/Vector2D.o: src/game/Vector2D.cpp.o
|
||||
.PHONY : src/game/Vector2D.o
|
||||
|
||||
# target to build an object file
|
||||
src/game/Vector2D.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Vector2D.cpp.o
|
||||
.PHONY : src/game/Vector2D.cpp.o
|
||||
|
||||
src/game/Vector2D.i: src/game/Vector2D.cpp.i
|
||||
.PHONY : src/game/Vector2D.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/game/Vector2D.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Vector2D.cpp.i
|
||||
.PHONY : src/game/Vector2D.cpp.i
|
||||
|
||||
src/game/Vector2D.s: src/game/Vector2D.cpp.s
|
||||
.PHONY : src/game/Vector2D.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/game/Vector2D.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/game/Vector2D.cpp.s
|
||||
.PHONY : src/game/Vector2D.cpp.s
|
||||
|
||||
src/ui/UINineSlice.o: src/ui/UINineSlice.cpp.o
|
||||
.PHONY : src/ui/UINineSlice.o
|
||||
|
||||
# target to build an object file
|
||||
src/ui/UINineSlice.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.o
|
||||
.PHONY : src/ui/UINineSlice.cpp.o
|
||||
|
||||
src/ui/UINineSlice.i: src/ui/UINineSlice.cpp.i
|
||||
.PHONY : src/ui/UINineSlice.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/ui/UINineSlice.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.i
|
||||
.PHONY : src/ui/UINineSlice.cpp.i
|
||||
|
||||
src/ui/UINineSlice.s: src/ui/UINineSlice.cpp.s
|
||||
.PHONY : src/ui/UINineSlice.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/ui/UINineSlice.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.s
|
||||
.PHONY : src/ui/UINineSlice.cpp.s
|
||||
|
||||
src/ui/UIText.o: src/ui/UIText.cpp.o
|
||||
.PHONY : src/ui/UIText.o
|
||||
|
||||
# target to build an object file
|
||||
src/ui/UIText.cpp.o:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.o
|
||||
.PHONY : src/ui/UIText.cpp.o
|
||||
|
||||
src/ui/UIText.i: src/ui/UIText.cpp.i
|
||||
.PHONY : src/ui/UIText.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/ui/UIText.cpp.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.i
|
||||
.PHONY : src/ui/UIText.cpp.i
|
||||
|
||||
src/ui/UIText.s: src/ui/UIText.cpp.s
|
||||
.PHONY : src/ui/UIText.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/ui/UIText.cpp.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles/BeagleRescue.dir/build.make CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.s
|
||||
.PHONY : src/ui/UIText.cpp.s
|
||||
|
||||
# Help Target
|
||||
help:
|
||||
@echo "The following are some of the valid targets for this Makefile:"
|
||||
@echo "... all (the default if no target is provided)"
|
||||
@echo "... clean"
|
||||
@echo "... depend"
|
||||
@echo "... edit_cache"
|
||||
@echo "... install"
|
||||
@echo "... install/local"
|
||||
@echo "... install/strip"
|
||||
@echo "... list_install_components"
|
||||
@echo "... rebuild_cache"
|
||||
@echo "... BeagleRescue"
|
||||
@echo "... src/assetmgr/AssetManager.o"
|
||||
@echo "... src/assetmgr/AssetManager.i"
|
||||
@echo "... src/assetmgr/AssetManager.s"
|
||||
@echo "... src/assetmgr/GameObject.o"
|
||||
@echo "... src/assetmgr/GameObject.i"
|
||||
@echo "... src/assetmgr/GameObject.s"
|
||||
@echo "... src/assetmgr/Map.o"
|
||||
@echo "... src/assetmgr/Map.i"
|
||||
@echo "... src/assetmgr/Map.s"
|
||||
@echo "... src/assetmgr/MusicManager.o"
|
||||
@echo "... src/assetmgr/MusicManager.i"
|
||||
@echo "... src/assetmgr/MusicManager.s"
|
||||
@echo "... src/assetmgr/TextureManager.o"
|
||||
@echo "... src/assetmgr/TextureManager.i"
|
||||
@echo "... src/assetmgr/TextureManager.s"
|
||||
@echo "... src/cjson/cJSON.o"
|
||||
@echo "... src/cjson/cJSON.i"
|
||||
@echo "... src/cjson/cJSON.s"
|
||||
@echo "... src/ecs/ECS.o"
|
||||
@echo "... src/ecs/ECS.i"
|
||||
@echo "... src/ecs/ECS.s"
|
||||
@echo "... src/game/Collision.o"
|
||||
@echo "... src/game/Collision.i"
|
||||
@echo "... src/game/Collision.s"
|
||||
@echo "... src/game/Game.o"
|
||||
@echo "... src/game/Game.i"
|
||||
@echo "... src/game/Game.s"
|
||||
@echo "... src/game/GameStateManager.o"
|
||||
@echo "... src/game/GameStateManager.i"
|
||||
@echo "... src/game/GameStateManager.s"
|
||||
@echo "... src/game/Main.o"
|
||||
@echo "... src/game/Main.i"
|
||||
@echo "... src/game/Main.s"
|
||||
@echo "... src/game/StateMachine.o"
|
||||
@echo "... src/game/StateMachine.i"
|
||||
@echo "... src/game/StateMachine.s"
|
||||
@echo "... src/game/Vector2D.o"
|
||||
@echo "... src/game/Vector2D.i"
|
||||
@echo "... src/game/Vector2D.s"
|
||||
@echo "... src/ui/UINineSlice.o"
|
||||
@echo "... src/ui/UINineSlice.i"
|
||||
@echo "... src/ui/UINineSlice.s"
|
||||
@echo "... src/ui/UIText.o"
|
||||
@echo "... src/ui/UIText.i"
|
||||
@echo "... src/ui/UIText.s"
|
||||
.PHONY : help
|
||||
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
@ -1,8 +1,7 @@
|
||||
# Kaiju Save Earth
|
||||
# Beagle Rescue Game
|
||||
---
|
||||
Low Rez Jam 2023
|
||||
|
||||
A game where you play as a giant monster (Kaiju) who must save all the humans from destroying themselves and the world by catching them and safely stowing them on your back.
|
||||
|
||||
Global Game Jam 2021 theme: Lost and Found
|
||||
A 2D platformer where you rescue lost puppies
|
||||
By:
|
||||
Alan Youngblood
|
||||
Simon Zaleski
|
||||
|
@ -1,338 +0,0 @@
|
||||
{ "columns":10,
|
||||
"image":"..\/..\/..\/Projects\/BeagleRescue\/assets\/maps\/br-tiles.png",
|
||||
"imageheight":80,
|
||||
"imagewidth":160,
|
||||
"margin":0,
|
||||
"name":"br-tiles",
|
||||
"spacing":0,
|
||||
"tilecount":50,
|
||||
"tiledversion":"1.8.2",
|
||||
"tileheight":16,
|
||||
"tiles":[
|
||||
{
|
||||
"id":10,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":11,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":12,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":13,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":15,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":19,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":20,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":21,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":28,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":43,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":2,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"height":14.2813,
|
||||
"id":3,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":14.4375,
|
||||
"x":0.96875,
|
||||
"y":0.875
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":44,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":45,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"id":2,
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"type":"tileset",
|
||||
"version":"1.8"
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
{"requests": [{"kind": "codemodel", "version": 2}, {"kind": "cmakeFiles", "version": 1}]}
|
Binary file not shown.
@ -1,66 +0,0 @@
|
||||
# ninja log v5
|
||||
5 1257 1680995986388821260 CMakeFiles/BeagleRescue.dir/src/ecs/ECS.cpp.o 2b68ee632af548aa
|
||||
4 4614 1680995989752187549 CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.o eb4c2e382e340f10
|
||||
4 68 1666035599307923948 libtmx-parser/liblibtmxparser.a 4a03bfde239caf5d
|
||||
1829 5506 1680995990645529632 CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.o 2e1a08cbe2ad039c
|
||||
5 803 1665858094321634764 CMakeFiles/BeagleRescue.dir/libtmx-parser/src/base64.cpp.o 4bbee0e045ced8b2
|
||||
8176 8273 1680995073021895354 libtmx-parser/liblibtmxparser.so 9df69ecfe8aa882a
|
||||
3771 6588 1680995071338547771 libtmx-parser/CMakeFiles/libtmxparser.dir/libs/tinyxml2/tinyxml2.cpp.o 96043e32043d331c
|
||||
13 8224 1680995993362222899 CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.o 4ba02c1268a57ad0
|
||||
5 3446 1665858096961659219 CMakeFiles/BeagleRescue.dir/libtmx-parser/src/tmxparser.cpp.o 15f574a728100366
|
||||
4 1896 1680995987032160899 CMakeFiles/BeagleRescue.dir/src/cjson/cJSON.c.o 77f7fe5671dba050
|
||||
5 4075 1680995989215515625 CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.o 811f88fdfc09263c
|
||||
6990 7109 1680995071858552173 libtmx-parser/libs/tinyxml2/xmltest c7f1f4ebf26757c2
|
||||
4036 6875 1680995071625216864 libtmx-parser/libs/tinyxml2/CMakeFiles/tinyxml2.dir/tinyxml2.cpp.o 660491a0c7495e62
|
||||
1258 5876 1680995991015533256 CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.o 203c7ee19411f630
|
||||
2059 8176 1680995072928561230 libtmx-parser/CMakeFiles/libtmxparser.dir/src/tmxparser.cpp.o ead5f95e0e72b1e0
|
||||
4 794 1665858094311634671 CMakeFiles/BeagleRescue.dir/libtmx-parser/libs/tinyxml2/xmltest.cpp.o ee2e170a3bac274c
|
||||
6978 6990 1680995071728551073 libtmx-parser/libs/tinyxml2/libtinyxml2.so d0fad9500a04c852
|
||||
4 1088 1665858094604970721 CMakeFiles/BeagleRescue.dir/libtmx-parser/main.cpp.o 86331d80cf701d8d
|
||||
13 638 1680995985768815183 CMakeFiles/BeagleRescue.dir/src/game/GameStateManager.cpp.o e18efa52ba3b4829
|
||||
638 874 1680995986008817536 CMakeFiles/BeagleRescue.dir/src/game/StateMachine.cpp.o c995c41f2f407d79
|
||||
5 3575 1680995988715510727 CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.o 743e525b8bc7e022
|
||||
874 1829 1680995986968826945 CMakeFiles/BeagleRescue.dir/src/game/Vector2D.cpp.o d6bbbe0fad885aeb
|
||||
6978 6990 1680995071728551073 libtmx-parser/libs/tinyxml2/libtinyxml2.so.2 d0fad9500a04c852
|
||||
5127 6527 1680995071278547263 libtmx-parser/libs/tinyxml2/CMakeFiles/xmltest.dir/xmltest.cpp.o 88e42020838dcd8e
|
||||
2957 4036 1680995068778526099 libtmx-parser/CMakeFiles/libtmxparser.dir/src/base64.cpp.o e84a5ef1b712902d
|
||||
9777 9902 1680995074651909151 BeagleRescue e5cb768adc438473
|
||||
4 4132 1680995989272182847 CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.o ced4d92dc065c0bf
|
||||
2 730 1681062043486327943 build.ninja bd959f8df49bfbdd
|
||||
6 3453 1680995988588842819 CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.o d59bce856486c23e
|
||||
6875 6978 1680995071728551073 libtmx-parser/libs/tinyxml2/libtinyxml2.so.2.2.0 8aed3caeabaa38d5
|
||||
20 4401 1680995989538852126 CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.o c1352eaae73a833f
|
||||
4 2192 1665858095708314276 CMakeFiles/BeagleRescue.dir/libtmx-parser/libs/tinyxml2/tinyxml2.cpp.o 60acd5a4117a4833
|
||||
4 2488 1681062059289774035 CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.o 743e525b8bc7e022
|
||||
4 2608 1681062059413108248 CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.o 811f88fdfc09263c
|
||||
4 2703 1681062059509775604 CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.o d59bce856486c23e
|
||||
3 2706 1681062059513108961 CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.o ced4d92dc065c0bf
|
||||
5 2815 1681062059623109746 CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.o c1352eaae73a833f
|
||||
5 2962 1681062059769777459 CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.o 2e1a08cbe2ad039c
|
||||
5 3207 1681062060013112528 CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.o 203c7ee19411f630
|
||||
3 3347 1681062060153113527 CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.o eb4c2e382e340f10
|
||||
5 4194 1681062060999786234 CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.o 4ba02c1268a57ad0
|
||||
4194 4286 1681062061093120232 BeagleRescue e58e98489844e561
|
||||
6 591 1681062457555937468 CMakeFiles/BeagleRescue.dir/src/game/GameStateManager.cpp.o e18efa52ba3b4829
|
||||
591 742 1681062457719271959 CMakeFiles/BeagleRescue.dir/src/game/StateMachine.cpp.o c995c41f2f407d79
|
||||
5 1761 1681062458725945758 CMakeFiles/BeagleRescue.dir/src/ecs/ECS.cpp.o 2b68ee632af548aa
|
||||
3 1777 1681062458739279185 CMakeFiles/BeagleRescue.dir/src/cjson/cJSON.c.o 77f7fe5671dba050
|
||||
742 1911 1681062458882613534 CMakeFiles/BeagleRescue.dir/src/game/Vector2D.cpp.o d6bbbe0fad885aeb
|
||||
4 2480 1681062459459284286 CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.o 811f88fdfc09263c
|
||||
4 2628 1681062459609285349 CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.o 743e525b8bc7e022
|
||||
4 2658 1681062459635952204 CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.o ced4d92dc065c0bf
|
||||
5 2882 1681062459862620477 CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.o d59bce856486c23e
|
||||
13 3065 1681062460045955109 CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.o c1352eaae73a833f
|
||||
3 3323 1681062460302623594 CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.o eb4c2e382e340f10
|
||||
1777 4185 1681062461165963044 CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.o 2e1a08cbe2ad039c
|
||||
1761 4194 1681062461172629758 CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.o 203c7ee19411f630
|
||||
5 4476 1681062461455965099 CMakeFiles/BeagleRescue.dir/src/game/Game.cpp.o 4ba02c1268a57ad0
|
||||
4476 4568 1681062461545965736 BeagleRescue e58e98489844e561
|
||||
6 3541 1689099824178728855 CMakeFiles/BeagleRescue.dir/src/assetmgr/GameObject.cpp.o ced4d92dc065c0bf
|
||||
7 3541 1689099824178728855 CMakeFiles/BeagleRescue.dir/src/assetmgr/TextureManager.cpp.o 811f88fdfc09263c
|
||||
7 3604 1689099824242062276 CMakeFiles/BeagleRescue.dir/src/assetmgr/MusicManager.cpp.o 743e525b8bc7e022
|
||||
8 3817 1689099824455395905 CMakeFiles/BeagleRescue.dir/src/game/Main.cpp.o c1352eaae73a833f
|
||||
7 3968 1689099824605396113 CMakeFiles/BeagleRescue.dir/src/game/Collision.cpp.o d59bce856486c23e
|
||||
14 4213 1689099824852063121 CMakeFiles/BeagleRescue.dir/src/ui/UIText.cpp.o 2e1a08cbe2ad039c
|
||||
6 4495 1689099825135396846 CMakeFiles/BeagleRescue.dir/src/assetmgr/AssetManager.cpp.o eb4c2e382e340f10
|
||||
9 4558 1689099825195396929 CMakeFiles/BeagleRescue.dir/src/ui/UINineSlice.cpp.o 203c7ee19411f630
|
86
build/CMakeCache.txt
Normal file
86
build/CMakeCache.txt
Normal file
@ -0,0 +1,86 @@
|
||||
# This is the CMakeCache file.
|
||||
# For build in directory: c:/Users/Admin/projects/BeagleRescue/build
|
||||
# It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe
|
||||
# You can edit this file to change values found and used by cmake.
|
||||
# If you do not want to change any of the values, simply exit the editor.
|
||||
# If you do want to change a value, simply edit, save, and exit the editor.
|
||||
# The syntax for the file is as follows:
|
||||
# KEY:TYPE=VALUE
|
||||
# KEY is the name of a variable in the cache.
|
||||
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
|
||||
# VALUE is the current value for the KEY.
|
||||
|
||||
########################
|
||||
# EXTERNAL cache entries
|
||||
########################
|
||||
|
||||
//Value Computed by CMake
|
||||
BeagleRescue_BINARY_DIR:STATIC=C:/Users/Admin/projects/BeagleRescue/build
|
||||
|
||||
//Value Computed by CMake
|
||||
BeagleRescue_IS_TOP_LEVEL:STATIC=ON
|
||||
|
||||
//Value Computed by CMake
|
||||
BeagleRescue_SOURCE_DIR:STATIC=C:/Users/Admin/projects/BeagleRescue
|
||||
|
||||
//No help, variable specified on the command line.
|
||||
CMAKE_BUILD_TYPE:UNINITIALIZED=Release
|
||||
|
||||
//No help, variable specified on the command line.
|
||||
CMAKE_EXPORT_COMPILE_COMMANDS:UNINITIALIZED=ON
|
||||
|
||||
//Program used to build from makefiles.
|
||||
CMAKE_MAKE_PROGRAM:STRING=nmake
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_NAME:STATIC=BeagleRescue
|
||||
|
||||
|
||||
########################
|
||||
# INTERNAL cache entries
|
||||
########################
|
||||
|
||||
//This is the directory where this CMakeCache.txt was created
|
||||
CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Admin/projects/BeagleRescue/build
|
||||
//Major version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
||||
//Minor version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=23
|
||||
//Patch version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
|
||||
//Path to CMake executable.
|
||||
CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake.exe
|
||||
//Path to cpack program executable.
|
||||
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cpack.exe
|
||||
//Path to ctest program executable.
|
||||
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake/bin/ctest.exe
|
||||
//Path to cache edit program executable.
|
||||
CMAKE_EDIT_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake-gui.exe
|
||||
//Name of external makefile project generator.
|
||||
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
||||
//Name of generator.
|
||||
CMAKE_GENERATOR:INTERNAL=NMake Makefiles
|
||||
//Generator instance identifier.
|
||||
CMAKE_GENERATOR_INSTANCE:INTERNAL=
|
||||
//Name of generator platform.
|
||||
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||
//Name of generator toolset.
|
||||
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
||||
//Source directory with the top level CMakeLists.txt file for this
|
||||
// project
|
||||
CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Admin/projects/BeagleRescue
|
||||
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
||||
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
||||
//number of local generators
|
||||
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
|
||||
//Platform information initialized
|
||||
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||
//Path to CMake installation.
|
||||
CMAKE_ROOT:INTERNAL=C:/Program Files/CMake/share/cmake-3.23
|
||||
|
15
build/CMakeFiles/3.23.2/CMakeSystem.cmake
Normal file
15
build/CMakeFiles/3.23.2/CMakeSystem.cmake
Normal file
@ -0,0 +1,15 @@
|
||||
set(CMAKE_HOST_SYSTEM "Windows-10.0.22000")
|
||||
set(CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||
set(CMAKE_HOST_SYSTEM_VERSION "10.0.22000")
|
||||
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM "Windows-10.0.22000")
|
||||
set(CMAKE_SYSTEM_NAME "Windows")
|
||||
set(CMAKE_SYSTEM_VERSION "10.0.22000")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
|
||||
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
|
||||
set(CMAKE_SYSTEM_LOADED 1)
|
1
build/CMakeFiles/CMakeOutput.log
Normal file
1
build/CMakeFiles/CMakeOutput.log
Normal file
@ -0,0 +1 @@
|
||||
The system is: Windows - 10.0.22000 - AMD64
|
1
build/CMakeFiles/cmake.check_cache
Normal file
1
build/CMakeFiles/cmake.check_cache
Normal file
@ -0,0 +1 @@
|
||||
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
132
cmake/sdl2/Copyright.txt
Normal file
132
cmake/sdl2/Copyright.txt
Normal file
@ -0,0 +1,132 @@
|
||||
CMake - Cross Platform Makefile Generator
|
||||
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.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
The following individuals and institutions are among the Contributors:
|
||||
|
||||
* Aaron C. Meadows <cmake@shadowguarddev.com>
|
||||
* Adriaan de Groot <groot@kde.org>
|
||||
* Aleksey Avdeev <solo@altlinux.ru>
|
||||
* Alexander Neundorf <neundorf@kde.org>
|
||||
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
|
||||
* Alexey Sokolov <sokolov@google.com>
|
||||
* Alex Merry <alex.merry@kde.org>
|
||||
* Alex Turbov <i.zaufi@gmail.com>
|
||||
* Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||
* Andreas Pakulat <apaku@gmx.de>
|
||||
* Andreas Schneider <asn@cryptomilk.org>
|
||||
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
|
||||
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
|
||||
* Benjamin Eikel
|
||||
* Bjoern Ricks <bjoern.ricks@gmail.com>
|
||||
* Brad Hards <bradh@kde.org>
|
||||
* Christopher Harvey
|
||||
* Christoph Grüninger <foss@grueninger.de>
|
||||
* Clement Creusot <creusot@cs.york.ac.uk>
|
||||
* Daniel Blezek <blezek@gmail.com>
|
||||
* Daniel Pfeifer <daniel@pfeifer-mail.de>
|
||||
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
|
||||
* Eran Ifrah <eran.ifrah@gmail.com>
|
||||
* Esben Mose Hansen, Ange Optimization ApS
|
||||
* Geoffrey Viola <geoffrey.viola@asirobots.com>
|
||||
* Google Inc
|
||||
* Gregor Jasny
|
||||
* Helio Chissini de Castro <helio@kde.org>
|
||||
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
|
||||
* Insight Software Consortium <insightsoftwareconsortium.org>
|
||||
* Jan Woetzel
|
||||
* Julien Schueller
|
||||
* Kelly Thompson <kgt@lanl.gov>
|
||||
* Laurent Montel <montel@kde.org>
|
||||
* Konstantin Podsvirov <konstantin@podsvirov.pro>
|
||||
* Mario Bensi <mbensi@ipsquad.net>
|
||||
* Martin Gräßlin <mgraesslin@kde.org>
|
||||
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
* Matthaeus G. Chajdas
|
||||
* Matthias Kretz <kretz@kde.org>
|
||||
* Matthias Maennich <matthias@maennich.net>
|
||||
* Michael Hirsch, Ph.D. <www.scivision.co>
|
||||
* Michael Stürmer
|
||||
* Miguel A. Figueroa-Villanueva
|
||||
* Mike Jackson
|
||||
* Mike McQuaid <mike@mikemcquaid.com>
|
||||
* Nicolas Bock <nicolasbock@gmail.com>
|
||||
* Nicolas Despres <nicolas.despres@gmail.com>
|
||||
* Nikita Krupen'ko <krnekit@gmail.com>
|
||||
* NVIDIA Corporation <www.nvidia.com>
|
||||
* OpenGamma Ltd. <opengamma.com>
|
||||
* Patrick Stotko <stotko@cs.uni-bonn.de>
|
||||
* Per Øyvind Karlsen <peroyvind@mandriva.org>
|
||||
* Peter Collingbourne <peter@pcc.me.uk>
|
||||
* Petr Gotthard <gotthard@honeywell.com>
|
||||
* Philip Lowman <philip@yhbt.com>
|
||||
* Philippe Proulx <pproulx@efficios.com>
|
||||
* Raffi Enficiaud, Max Planck Society
|
||||
* Raumfeld <raumfeld.com>
|
||||
* Roger Leigh <rleigh@codelibre.net>
|
||||
* Rolf Eike Beer <eike@sf-mail.de>
|
||||
* Roman Donchenko <roman.donchenko@itseez.com>
|
||||
* Roman Kharitonov <roman.kharitonov@itseez.com>
|
||||
* Ruslan Baratov
|
||||
* Sebastian Holtermann <sebholt@xwmw.org>
|
||||
* Stephen Kelly <steveire@gmail.com>
|
||||
* Sylvain Joubert <joubert.sy@gmail.com>
|
||||
* Thomas Sondergaard <ts@medical-insight.com>
|
||||
* Tobias Hunger <tobias.hunger@qt.io>
|
||||
* Todd Gamblin <tgamblin@llnl.gov>
|
||||
* Tristan Carel
|
||||
* University of Dundee
|
||||
* Vadim Zhukov
|
||||
* Will Dicharry <wdicharry@stellarscience.com>
|
||||
|
||||
See version control history for details of individual contributions.
|
||||
|
||||
The above copyright and license notice applies to distributions of
|
||||
CMake in source and binary form. Third-party software packages supplied
|
||||
with CMake under compatible licenses provide their own copyright notices
|
||||
documented in corresponding subdirectories or source files.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
CMake was initially developed by Kitware with the following sponsorship:
|
||||
|
||||
* National Library of Medicine at the National Institutes of Health
|
||||
as part of the Insight Segmentation and Registration Toolkit (ITK).
|
||||
|
||||
* US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
|
||||
Visualization Initiative.
|
||||
|
||||
* National Alliance for Medical Image Computing (NAMIC) is funded by the
|
||||
National Institutes of Health through the NIH Roadmap for Medical Research,
|
||||
Grant U54 EB005149.
|
||||
|
||||
* Kitware, Inc.
|
388
cmake/sdl2/FindSDL2.cmake
Normal file
388
cmake/sdl2/FindSDL2.cmake
Normal file
@ -0,0 +1,388 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2
|
||||
--------
|
||||
|
||||
Locate SDL2 library
|
||||
|
||||
This module defines the following 'IMPORTED' targets:
|
||||
|
||||
::
|
||||
|
||||
SDL2::Core
|
||||
The SDL2 library, if found.
|
||||
Libraries should link to SDL2::Core
|
||||
|
||||
SDL2::Main
|
||||
The SDL2main library, if found.
|
||||
Applications should link to SDL2::Main instead of SDL2::Core
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_LIBRARIES, the name of the library to link against
|
||||
SDL2_INCLUDE_DIRS, where to find SDL.h
|
||||
SDL2_FOUND, if false, do not try to link to SDL2
|
||||
SDL2MAIN_FOUND, if false, do not try to link to SDL2main
|
||||
SDL2_VERSION_STRING, human-readable string containing the version of SDL2
|
||||
|
||||
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_PATH
|
||||
Set a custom SDL2 Library path (default: empty)
|
||||
|
||||
SDL2_NO_DEFAULT_PATH
|
||||
Disable search SDL2 Library in default path.
|
||||
If SDL2_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_INCLUDE_DIR
|
||||
SDL2 headers path.
|
||||
|
||||
SDL2_LIBRARY
|
||||
SDL2 Library (.dll, .so, .a, etc) path.
|
||||
|
||||
SDL2MAIN_LIBRAY
|
||||
SDL2main Library (.a) path.
|
||||
|
||||
SDL2_BUILDING_LIBRARY
|
||||
This flag is useful only when linking to SDL2_LIBRARIES insead of
|
||||
SDL2::Main. It is required only when building a library that links to
|
||||
SDL2_LIBRARIES, because only applications need main() (No need to also
|
||||
link to SDL2main).
|
||||
If this flag is defined, then no SDL2main will be added to SDL2_LIBRARIES
|
||||
and no SDL2::Main target will be created.
|
||||
|
||||
|
||||
Don't forget to include SDLmain.h and SDLmain.m in your project for the
|
||||
OS X framework based version. (Other versions link to -lSDL2main which
|
||||
this module will try to find on your behalf.) Also for OS X, this
|
||||
module will automatically add the -framework Cocoa on your behalf.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2 library
|
||||
(SDL2.dll, libsdl2.so, SDL2.framework, etc). Set SDL2_LIBRARY to point
|
||||
to your SDL2 library, and configure again. Similarly, if you see an
|
||||
empty SDL2MAIN_LIBRARY, you should set this value as appropriate. These
|
||||
values are used to generate the final SDL2_LIBRARIES variable and the
|
||||
SDL2::Core and SDL2::Main targets, but when these values are unset,
|
||||
SDL2_LIBRARIES, SDL2::Core and SDL2::Main does not get created.
|
||||
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2. l.e.galup 9-20-02
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL.cmake to SDL2 (FindSDL2.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_PATH, SDL2_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Mark 'Threads' as a required dependency for non-OSX systems.
|
||||
Modernize the FindSDL2.cmake module by creating specific targets:
|
||||
SDL2::Core and SDL2::Main (for details, see doc above).
|
||||
|
||||
|
||||
Original FindSDL.cmake module:
|
||||
Modified by Eric Wing. Added code to assist with automated building
|
||||
by using environmental variables and providing a more
|
||||
controlled/consistent search behavior. Added new modifications to
|
||||
recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
|
||||
Also corrected the header search path to follow "proper" SDL
|
||||
guidelines. Added a search for SDLmain which is needed by some
|
||||
platforms. Added a search for threads which is needed by some
|
||||
platforms. Added needed compile switches for MinGW.
|
||||
|
||||
On OSX, this will prefer the Framework version (if found) over others.
|
||||
People will have to manually change the cache value of SDL2_LIBRARY to
|
||||
override this selection or set the SDL2_PATH variable or the CMake
|
||||
environment CMAKE_INCLUDE_PATH to modify the search paths.
|
||||
|
||||
Note that the header path has changed from SDL/SDL.h to just SDL.h
|
||||
This needed to change because "proper" SDL convention is #include
|
||||
"SDL.h", not <SDL/SDL.h>. This is done for portability reasons
|
||||
because not all systems place things in SDL/ (see FreeBSD).
|
||||
#]=======================================================================]
|
||||
|
||||
# Define options for searching SDL2 Library in a custom path
|
||||
|
||||
set(SDL2_PATH "" CACHE STRING "Custom SDL2 Library path")
|
||||
|
||||
set(_SDL2_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_PATH)
|
||||
set(_SDL2_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_NO_DEFAULT_PATH ${_SDL2_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2 Library in default path")
|
||||
unset(_SDL2_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_NO_DEFAULT_PATH)
|
||||
set(SDL2_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2 include directory
|
||||
find_path(SDL2_INCLUDE_DIR SDL.h
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${SDL2_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_PATH}
|
||||
DOC "Where the SDL2 headers can be found"
|
||||
)
|
||||
|
||||
set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR}")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# SDL-2.0 is the name used by FreeBSD ports...
|
||||
# don't confuse it for the version number.
|
||||
find_library(SDL2_LIBRARY
|
||||
NAMES SDL2 SDL-2.0
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${SDL2_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_PATH}
|
||||
DOC "Where the SDL2 Library can be found"
|
||||
)
|
||||
|
||||
set(SDL2_LIBRARIES "${SDL2_LIBRARY}")
|
||||
|
||||
if(NOT SDL2_BUILDING_LIBRARY)
|
||||
if(NOT SDL2_INCLUDE_DIR MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDL2main for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
|
||||
if(SDL2_PATH)
|
||||
set(SDL2MAIN_LIBRARY_PATHS "${SDL2_PATH}")
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_NO_DEFAULT_PATH)
|
||||
set(SDL2MAIN_LIBRARY_PATHS
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
"${SDL2MAIN_LIBRARY_PATHS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
find_library(SDL2MAIN_LIBRARY
|
||||
NAMES SDL2main
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${SDL2_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2MAIN_LIBRARY_PATHS}
|
||||
DOC "Where the SDL2main library can be found"
|
||||
)
|
||||
unset(SDL2MAIN_LIBRARY_PATHS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SDL2 may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
if(NOT APPLE)
|
||||
find_package(Threads QUIET)
|
||||
if(NOT Threads_FOUND)
|
||||
set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).")
|
||||
if(SDL2_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_THREADS_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_THREADS_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_THREADS_NOT_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# MinGW needs an additional link flag, -mwindows
|
||||
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||
if(MINGW)
|
||||
set(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "link flags for MinGW")
|
||||
endif()
|
||||
|
||||
if(SDL2_LIBRARY)
|
||||
# For SDL2main
|
||||
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
|
||||
list(FIND SDL2_LIBRARIES "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
|
||||
if(_SDL2_MAIN_INDEX EQUAL -1)
|
||||
set(SDL2_LIBRARIES "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARIES})
|
||||
endif()
|
||||
unset(_SDL2_MAIN_INDEX)
|
||||
endif()
|
||||
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
if(APPLE)
|
||||
set(SDL2_LIBRARIES ${SDL2_LIBRARIES} -framework Cocoa)
|
||||
endif()
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
if(NOT APPLE)
|
||||
set(SDL2_LIBRARIES ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
# For MinGW library
|
||||
if(MINGW)
|
||||
set(SDL2_LIBRARIES ${MINGW32_LIBRARY} ${SDL2_LIBRARIES})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# Read SDL2 version
|
||||
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
|
||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
|
||||
set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH})
|
||||
unset(SDL2_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_VERSION_MINOR_LINE)
|
||||
unset(SDL2_VERSION_PATCH_LINE)
|
||||
unset(SDL2_VERSION_MAJOR)
|
||||
unset(SDL2_VERSION_MINOR)
|
||||
unset(SDL2_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
||||
VERSION_VAR SDL2_VERSION_STRING)
|
||||
|
||||
if(SDL2MAIN_LIBRARY)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2main
|
||||
REQUIRED_VARS SDL2MAIN_LIBRARY SDL2_INCLUDE_DIR
|
||||
VERSION_VAR SDL2_VERSION_STRING)
|
||||
endif()
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_PATH
|
||||
SDL2_NO_DEFAULT_PATH
|
||||
SDL2_LIBRARY
|
||||
SDL2MAIN_LIBRARY
|
||||
SDL2_INCLUDE_DIR
|
||||
SDL2_BUILDING_LIBRARY)
|
||||
|
||||
|
||||
# SDL2:: targets (SDL2::Core and SDL2::Main)
|
||||
if(SDL2_FOUND)
|
||||
|
||||
# SDL2::Core target
|
||||
if(SDL2_LIBRARY AND NOT TARGET SDL2::Core)
|
||||
add_library(SDL2::Core UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::Core PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}")
|
||||
|
||||
if(APPLE)
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# For more details, please see above.
|
||||
set_property(TARGET SDL2::Core APPEND PROPERTY
|
||||
INTERFACE_LINK_OPTIONS -framework Cocoa)
|
||||
else()
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# For more details, please see above.
|
||||
set_property(TARGET SDL2::Core APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES Threads::Threads)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SDL2::Main target
|
||||
# Applications should link to SDL2::Main instead of SDL2::Core
|
||||
# For more details, please see above.
|
||||
if(NOT SDL2_BUILDING_LIBRARY AND NOT TARGET SDL2::Main)
|
||||
|
||||
if(SDL2_INCLUDE_DIR MATCHES ".framework" OR NOT SDL2MAIN_LIBRARY)
|
||||
add_library(SDL2::Main INTERFACE IMPORTED)
|
||||
set_property(TARGET SDL2::Main PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
elseif(SDL2MAIN_LIBRARY)
|
||||
# MinGW requires that the mingw32 library is specified before the
|
||||
# libSDL2main.a static library when linking.
|
||||
# The SDL2::MainInternal target is used internally to make sure that
|
||||
# CMake respects this condition.
|
||||
add_library(SDL2::MainInternal UNKNOWN IMPORTED)
|
||||
set_property(TARGET SDL2::MainInternal PROPERTY
|
||||
IMPORTED_LOCATION "${SDL2MAIN_LIBRARY}")
|
||||
set_property(TARGET SDL2::MainInternal PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
|
||||
add_library(SDL2::Main INTERFACE IMPORTED)
|
||||
|
||||
if(MINGW)
|
||||
# MinGW needs an additional link flag '-mwindows' and link to mingw32
|
||||
set_property(TARGET SDL2::Main PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES "mingw32" "-mwindows")
|
||||
endif()
|
||||
|
||||
set_property(TARGET SDL2::Main APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES SDL2::MainInternal)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
222
cmake/sdl2/FindSDL2_gfx.cmake
Normal file
222
cmake/sdl2/FindSDL2_gfx.cmake
Normal file
@ -0,0 +1,222 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2_gfx
|
||||
--------------
|
||||
|
||||
Locate SDL2_gfx library
|
||||
|
||||
This module defines the following 'IMPORTED' target:
|
||||
|
||||
::
|
||||
|
||||
SDL2::GFX
|
||||
The SDL2_gfx library, if found.
|
||||
Have SDL2::Core as a link dependency.
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_GFX_LIBRARIES, the name of the library to link against
|
||||
SDL2_GFX_INCLUDE_DIRS, where to find the headers
|
||||
SDL2_GFX_FOUND, if false, do not try to link against
|
||||
SDL2_GFX_VERSION_STRING - human-readable string containing the
|
||||
version of SDL2_gfx
|
||||
|
||||
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_GFX_PATH
|
||||
Set a custom SDL2_gfx Library path (default: empty)
|
||||
|
||||
SDL2_GFX_NO_DEFAULT_PATH
|
||||
Disable search SDL2_gfx Library in default path.
|
||||
If SDL2_GFX_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_GFX_INCLUDE_DIR
|
||||
SDL2_gfx headers path.
|
||||
|
||||
SDL2_GFX_LIBRARY
|
||||
SDL2_gfx Library (.dll, .so, .a, etc) path.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_GFX_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2_gfx library
|
||||
(SDL2_gfx.dll, libsdl2_gfx.so, etc). Set SDL2_GFX_LIBRARY to point
|
||||
to your SDL2_gfx library, and configure again. This value is used to
|
||||
generate the final SDL2_GFX_LIBRARIES variable and the SDL2::GFX target,
|
||||
but when this value is unset, SDL2_GFX_LIBRARIES and SDL2::GFX does not
|
||||
get created.
|
||||
|
||||
|
||||
$SDL2GFXDIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2GFXDIR used in building SDL2_gfx.
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL_image.cmake to SDL2_gfx (FindSDL2_gfx.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_GFX_PATH, SDL2_GFX_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Add SDL2 as a required dependency.
|
||||
Modernize the FindSDL2_gfx.cmake module by creating a specific target:
|
||||
SDL2::GFX (for details, see doc above).
|
||||
|
||||
Original FindSDL_image.cmake module:
|
||||
Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
module, but with modifications to recognize OS X frameworks and
|
||||
additional Unix paths (FreeBSD, etc).
|
||||
#]=======================================================================]
|
||||
|
||||
# SDL2 Library required
|
||||
find_package(SDL2 QUIET)
|
||||
if(NOT SDL2_FOUND)
|
||||
set(SDL2_GFX_SDL2_NOT_FOUND "Could NOT find SDL2 (SDL2 is required by SDL2_gfx).")
|
||||
if(SDL2_gfx_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_GFX_SDL2_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_gfx_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_GFX_SDL2_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_GFX_SDL2_NOT_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# Define options for searching SDL2_gfx Library in a custom path
|
||||
|
||||
set(SDL2_GFX_PATH "" CACHE STRING "Custom SDL2_gfx Library path")
|
||||
|
||||
set(_SDL2_GFX_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_GFX_PATH)
|
||||
set(_SDL2_GFX_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_GFX_NO_DEFAULT_PATH ${_SDL2_GFX_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2_gfx Library in default path")
|
||||
unset(_SDL2_GFX_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_GFX_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_GFX_NO_DEFAULT_PATH)
|
||||
set(SDL2_GFX_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_gfx include directory
|
||||
find_path(SDL2_GFX_INCLUDE_DIR SDL2_gfxPrimitives.h
|
||||
HINTS
|
||||
ENV SDL2GFXDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_GFX_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
# and ENV{SDL2GFXDIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_GFX_PATH}
|
||||
DOC "Where the SDL2_gfx headers can be found"
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_gfx library
|
||||
find_library(SDL2_GFX_LIBRARY
|
||||
NAMES SDL2_gfx
|
||||
HINTS
|
||||
ENV SDL2GFXDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_GFX_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_GFX_PATH}
|
||||
DOC "Where the SDL2_gfx Library can be found"
|
||||
)
|
||||
|
||||
# Read SDL2_gfx version
|
||||
if(SDL2_GFX_INCLUDE_DIR AND EXISTS "${SDL2_GFX_INCLUDE_DIR}/SDL2_gfxPrimitives.h")
|
||||
file(STRINGS "${SDL2_GFX_INCLUDE_DIR}/SDL2_gfxPrimitives.h" SDL2_GFX_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL2_GFXPRIMITIVES_MAJOR[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_GFX_INCLUDE_DIR}/SDL2_gfxPrimitives.h" SDL2_GFX_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_GFXPRIMITIVES_MINOR[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_GFX_INCLUDE_DIR}/SDL2_gfxPrimitives.h" SDL2_GFX_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_GFXPRIMITIVES_MICRO[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL2_GFXPRIMITIVES_MAJOR[ \t]+([0-9]+)$" "\\1" SDL2_GFX_VERSION_MAJOR "${SDL2_GFX_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL2_GFXPRIMITIVES_MINOR[ \t]+([0-9]+)$" "\\1" SDL2_GFX_VERSION_MINOR "${SDL2_GFX_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL2_GFXPRIMITIVES_MICRO[ \t]+([0-9]+)$" "\\1" SDL2_GFX_VERSION_PATCH "${SDL2_GFX_VERSION_PATCH_LINE}")
|
||||
set(SDL2_GFX_VERSION_STRING ${SDL2_GFX_VERSION_MAJOR}.${SDL2_GFX_VERSION_MINOR}.${SDL2_GFX_VERSION_PATCH})
|
||||
unset(SDL2_GFX_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_GFX_VERSION_MINOR_LINE)
|
||||
unset(SDL2_GFX_VERSION_PATCH_LINE)
|
||||
unset(SDL2_GFX_VERSION_MAJOR)
|
||||
unset(SDL2_GFX_VERSION_MINOR)
|
||||
unset(SDL2_GFX_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
set(SDL2_GFX_LIBRARIES ${SDL2_GFX_LIBRARY})
|
||||
set(SDL2_GFX_INCLUDE_DIRS ${SDL2_GFX_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_gfx
|
||||
REQUIRED_VARS SDL2_GFX_LIBRARIES SDL2_GFX_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_GFX_VERSION_STRING)
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_GFX_PATH
|
||||
SDL2_GFX_NO_DEFAULT_PATH
|
||||
SDL2_GFX_LIBRARY
|
||||
SDL2_GFX_INCLUDE_DIR)
|
||||
|
||||
|
||||
if(SDL2_GFX_FOUND)
|
||||
|
||||
# SDL2::GFX target
|
||||
if(SDL2_GFX_LIBRARY AND NOT TARGET SDL2::GFX)
|
||||
add_library(SDL2::GFX UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::GFX PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_GFX_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_GFX_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
endif()
|
||||
endif()
|
222
cmake/sdl2/FindSDL2_image.cmake
Normal file
222
cmake/sdl2/FindSDL2_image.cmake
Normal file
@ -0,0 +1,222 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2_image
|
||||
--------------
|
||||
|
||||
Locate SDL2_image library
|
||||
|
||||
This module defines the following 'IMPORTED' target:
|
||||
|
||||
::
|
||||
|
||||
SDL2::Image
|
||||
The SDL2_image library, if found.
|
||||
Have SDL2::Core as a link dependency.
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_IMAGE_LIBRARIES, the name of the library to link against
|
||||
SDL2_IMAGE_INCLUDE_DIRS, where to find the headers
|
||||
SDL2_IMAGE_FOUND, if false, do not try to link against
|
||||
SDL2_IMAGE_VERSION_STRING - human-readable string containing the
|
||||
version of SDL2_image
|
||||
|
||||
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_IMAGE_PATH
|
||||
Set a custom SDL2_image Library path (default: empty)
|
||||
|
||||
SDL2_IMAGE_NO_DEFAULT_PATH
|
||||
Disable search SDL2_image Library in default path.
|
||||
If SDL2_IMAGE_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_IMAGE_INCLUDE_DIR
|
||||
SDL2_image headers path.
|
||||
|
||||
SDL2_IMAGE_LIBRARY
|
||||
SDL2_image Library (.dll, .so, .a, etc) path.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_IMAGE_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2_image library
|
||||
(SDL2_image.dll, libsdl2_image.so, etc). Set SDL2_IMAGE_LIBRARY to point
|
||||
to your SDL2_image library, and configure again. This value is used to
|
||||
generate the final SDL2_IMAGE_LIBRARIES variable and the SDL2::Image target,
|
||||
but when this value is unset, SDL2_IMAGE_LIBRARIES and SDL2::Image does not
|
||||
get created.
|
||||
|
||||
|
||||
$SDL2IMAGEDIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2IMAGEDIR used in building SDL2_image.
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL_image.cmake to SDL2_image (FindSDL2_image.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_IMAGE_PATH, SDL2_IMAGE_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Add SDL2 as a required dependency.
|
||||
Modernize the FindSDL2_image.cmake module by creating a specific target:
|
||||
SDL2::Image (for details, see doc above).
|
||||
|
||||
Original FindSDL_image.cmake module:
|
||||
Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
module, but with modifications to recognize OS X frameworks and
|
||||
additional Unix paths (FreeBSD, etc).
|
||||
#]=======================================================================]
|
||||
|
||||
# SDL2 Library required
|
||||
find_package(SDL2 QUIET)
|
||||
if(NOT SDL2_FOUND)
|
||||
set(SDL2_IMAGE_SDL2_NOT_FOUND "Could NOT find SDL2 (SDL2 is required by SDL2_image).")
|
||||
if(SDL2_image_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_IMAGE_SDL2_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_image_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_IMAGE_SDL2_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_IMAGE_SDL2_NOT_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# Define options for searching SDL2_image Library in a custom path
|
||||
|
||||
set(SDL2_IMAGE_PATH "" CACHE STRING "Custom SDL2_image Library path")
|
||||
|
||||
set(_SDL2_IMAGE_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_IMAGE_PATH)
|
||||
set(_SDL2_IMAGE_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_IMAGE_NO_DEFAULT_PATH ${_SDL2_IMAGE_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2_image Library in default path")
|
||||
unset(_SDL2_IMAGE_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_IMAGE_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_IMAGE_NO_DEFAULT_PATH)
|
||||
set(SDL2_IMAGE_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_image include directory
|
||||
find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h
|
||||
HINTS
|
||||
ENV SDL2IMAGEDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_IMAGE_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
# and ENV{SDL2IMAGEDIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_IMAGE_PATH}
|
||||
DOC "Where the SDL2_image headers can be found"
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_image library
|
||||
find_library(SDL2_IMAGE_LIBRARY
|
||||
NAMES SDL2_image
|
||||
HINTS
|
||||
ENV SDL2IMAGEDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_IMAGE_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_IMAGE_PATH}
|
||||
DOC "Where the SDL2_image Library can be found"
|
||||
)
|
||||
|
||||
# Read SDL2_image version
|
||||
if(SDL2_IMAGE_INCLUDE_DIR AND EXISTS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h")
|
||||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MAJOR "${SDL2_IMAGE_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MINOR "${SDL2_IMAGE_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_PATCH "${SDL2_IMAGE_VERSION_PATCH_LINE}")
|
||||
set(SDL2_IMAGE_VERSION_STRING ${SDL2_IMAGE_VERSION_MAJOR}.${SDL2_IMAGE_VERSION_MINOR}.${SDL2_IMAGE_VERSION_PATCH})
|
||||
unset(SDL2_IMAGE_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_IMAGE_VERSION_MINOR_LINE)
|
||||
unset(SDL2_IMAGE_VERSION_PATCH_LINE)
|
||||
unset(SDL2_IMAGE_VERSION_MAJOR)
|
||||
unset(SDL2_IMAGE_VERSION_MINOR)
|
||||
unset(SDL2_IMAGE_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY})
|
||||
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
|
||||
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_IMAGE_VERSION_STRING)
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_IMAGE_PATH
|
||||
SDL2_IMAGE_NO_DEFAULT_PATH
|
||||
SDL2_IMAGE_LIBRARY
|
||||
SDL2_IMAGE_INCLUDE_DIR)
|
||||
|
||||
|
||||
if(SDL2_IMAGE_FOUND)
|
||||
|
||||
# SDL2::Image target
|
||||
if(SDL2_IMAGE_LIBRARY AND NOT TARGET SDL2::Image)
|
||||
add_library(SDL2::Image UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::Image PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_IMAGE_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_IMAGE_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
endif()
|
||||
endif()
|
220
cmake/sdl2/FindSDL2_mixer.cmake
Normal file
220
cmake/sdl2/FindSDL2_mixer.cmake
Normal file
@ -0,0 +1,220 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2_mixer
|
||||
--------------
|
||||
|
||||
Locate SDL2_mixer library
|
||||
|
||||
This module defines the following 'IMPORTED' target:
|
||||
|
||||
::
|
||||
|
||||
SDL2::Mixer
|
||||
The SDL2_mixer library, if found.
|
||||
Have SDL2::Core as a link dependency.
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_MIXER_LIBRARIES, the name of the library to link against
|
||||
SDL2_MIXER_INCLUDE_DIRS, where to find the headers
|
||||
SDL2_MIXER_FOUND, if false, do not try to link against
|
||||
SDL2_MIXER_VERSION_STRING - human-readable string containing the
|
||||
version of SDL2_mixer
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_MIXER_PATH
|
||||
Set a custom SDL2_mixer Library path (default: empty)
|
||||
|
||||
SDL2_MIXER_NO_DEFAULT_PATH
|
||||
Disable search SDL2_mixer Library in default path.
|
||||
If SDL2_MIXER_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_MIXER_INCLUDE_DIR
|
||||
SDL2_mixer headers path.
|
||||
|
||||
SDL2_MIXER_LIBRARY
|
||||
SDL2_mixer Library (.dll, .so, .a, etc) path.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_MIXER_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2_mixer library
|
||||
(SDL2_mixer.dll, libsdl2_mixer.so, etc). Set SDL2_MIXER_LIBRARY to point
|
||||
to your SDL2_mixer library, and configure again. This value is used to
|
||||
generate the final SDL2_MIXER_LIBRARIES variable and the SDL2::Mixer target,
|
||||
but when this value is unset, SDL2_MIXER_LIBRARIES and SDL2::Mixer does not
|
||||
get created.
|
||||
|
||||
|
||||
$SDL2MIXERDIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2MIXERDIR used in building SDL2_mixer.
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL_mixer.cmake to SDL2_mixer (FindSDL2_mixer.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_MIXER_PATH, SDL2_MIXER_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Add SDL2 as a required dependency.
|
||||
Modernize the FindSDL2_mixer.cmake module by creating a specific target:
|
||||
SDL2::Mixer (for details, see doc above).
|
||||
|
||||
Original FindSDL_mixer.cmake module:
|
||||
Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
module, but with modifications to recognize OS X frameworks and
|
||||
additional Unix paths (FreeBSD, etc).
|
||||
#]=======================================================================]
|
||||
|
||||
# SDL2 Library required
|
||||
find_package(SDL2 QUIET)
|
||||
if(NOT SDL2_FOUND)
|
||||
set(SDL2_MIXER_SDL2_NOT_FOUND "Could NOT find SDL2 (SDL2 is required by SDL2_mixer).")
|
||||
if(SDL2_mixer_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_MIXER_SDL2_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_mixer_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_MIXER_SDL2_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_MIXER_SDL2_NOT_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# Define options for searching SDL2_mixer Library in a custom path
|
||||
|
||||
set(SDL2_MIXER_PATH "" CACHE STRING "Custom SDL2_mixer Library path")
|
||||
|
||||
set(_SDL2_MIXER_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_MIXER_PATH)
|
||||
set(_SDL2_MIXER_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_MIXER_NO_DEFAULT_PATH ${_SDL2_MIXER_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2_mixer Library in default path")
|
||||
unset(_SDL2_MIXER_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_MIXER_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_MIXER_NO_DEFAULT_PATH)
|
||||
set(SDL2_MIXER_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_mixer include directory
|
||||
find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
|
||||
HINTS
|
||||
ENV SDL2MIXERDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_MIXER_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
# and ENV{SDL2MIXERDIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_MIXER_PATH}
|
||||
DOC "Where the SDL2_mixer headers can be found"
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_mixer library
|
||||
find_library(SDL2_MIXER_LIBRARY
|
||||
NAMES SDL2_mixer
|
||||
HINTS
|
||||
ENV SDL2MIXERDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_MIXER_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_MIXER_PATH}
|
||||
DOC "Where the SDL2_mixer Library can be found"
|
||||
)
|
||||
|
||||
# Read SDL2_mixer version
|
||||
if(SDL2_MIXER_INCLUDE_DIR AND EXISTS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h")
|
||||
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MAJOR "${SDL2_MIXER_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MINOR "${SDL2_MIXER_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_PATCH "${SDL2_MIXER_VERSION_PATCH_LINE}")
|
||||
set(SDL2_MIXER_VERSION_STRING ${SDL2_MIXER_VERSION_MAJOR}.${SDL2_MIXER_VERSION_MINOR}.${SDL2_MIXER_VERSION_PATCH})
|
||||
unset(SDL2_MIXER_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_MIXER_VERSION_MINOR_LINE)
|
||||
unset(SDL2_MIXER_VERSION_PATCH_LINE)
|
||||
unset(SDL2_MIXER_VERSION_MAJOR)
|
||||
unset(SDL2_MIXER_VERSION_MINOR)
|
||||
unset(SDL2_MIXER_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
|
||||
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
|
||||
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_MIXER_VERSION_STRING)
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_MIXER_PATH
|
||||
SDL2_MIXER_NO_DEFAULT_PATH
|
||||
SDL2_MIXER_LIBRARY
|
||||
SDL2_MIXER_INCLUDE_DIR)
|
||||
|
||||
|
||||
if(SDL2_MIXER_FOUND)
|
||||
|
||||
# SDL2::Mixer target
|
||||
if(SDL2_MIXER_LIBRARY AND NOT TARGET SDL2::Mixer)
|
||||
add_library(SDL2::Mixer UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::Mixer PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
endif()
|
||||
endif()
|
222
cmake/sdl2/FindSDL2_net.cmake
Normal file
222
cmake/sdl2/FindSDL2_net.cmake
Normal file
@ -0,0 +1,222 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2_net
|
||||
------------
|
||||
|
||||
Locate SDL2_net library
|
||||
|
||||
This module defines the following 'IMPORTED' target:
|
||||
|
||||
::
|
||||
|
||||
SDL2::Net
|
||||
The SDL2_net library, if found.
|
||||
Have SDL2::Core as a link dependency.
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_NET_LIBRARIES, the name of the library to link against
|
||||
SDL2_NET_INCLUDE_DIRS, where to find the headers
|
||||
SDL2_NET_FOUND, if false, do not try to link against
|
||||
SDL2_NET_VERSION_STRING - human-readable string containing the
|
||||
version of SDL2_net
|
||||
|
||||
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_NET_PATH
|
||||
Set a custom SDL2_net Library path (default: empty)
|
||||
|
||||
SDL2_NET_NO_DEFAULT_PATH
|
||||
Disable search SDL2_net Library in default path.
|
||||
If SDL2_NET_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_NET_INCLUDE_DIR
|
||||
SDL2_net headers path.
|
||||
|
||||
SDL2_NET_LIBRARY
|
||||
SDL2_net Library (.dll, .so, .a, etc) path.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_NET_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2_net library
|
||||
(SDL2_net.dll, libsdl2_net.so, etc). Set SDL2_NET_LIBRARY to point
|
||||
to your SDL2_net library, and configure again. This value is used to
|
||||
generate the final SDL2_NET_LIBRARIES variable and the SDL2::Net target,
|
||||
but when this value is unset, SDL2_NET_LIBRARIES and SDL2::Net does not
|
||||
get created.
|
||||
|
||||
|
||||
$SDL2NETDIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2NETDIR used in building SDL2_net.
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL_net.cmake to SDL2_net (FindSDL2_net.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_NET_PATH, SDL2_NET_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Add SDL2 as a required dependency.
|
||||
Modernize the FindSDL2_net.cmake module by creating a specific target:
|
||||
SDL2::Net (for details, see doc above).
|
||||
|
||||
Original FindSDL_net.cmake module:
|
||||
Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
module, but with modifications to recognize OS X frameworks and
|
||||
additional Unix paths (FreeBSD, etc).
|
||||
#]=======================================================================]
|
||||
|
||||
# SDL2 Library required
|
||||
find_package(SDL2 QUIET)
|
||||
if(NOT SDL2_FOUND)
|
||||
set(SDL2_NET_SDL2_NOT_FOUND "Could NOT find SDL2 (SDL2 is required by SDL2_net).")
|
||||
if(SDL2_net_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_NET_SDL2_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_net_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_NET_SDL2_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_NET_SDL2_NOT_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# Define options for searching SDL2_net Library in a custom path
|
||||
|
||||
set(SDL2_NET_PATH "" CACHE STRING "Custom SDL2_net Library path")
|
||||
|
||||
set(_SDL2_NET_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_NET_PATH)
|
||||
set(_SDL2_NET_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_NET_NO_DEFAULT_PATH ${_SDL2_NET_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2_net Library in default path")
|
||||
unset(_SDL2_NET_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_NET_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_NET_NO_DEFAULT_PATH)
|
||||
set(SDL2_NET_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_net include directory
|
||||
find_path(SDL2_NET_INCLUDE_DIR SDL_net.h
|
||||
HINTS
|
||||
ENV SDL2NETDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_NET_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
# and ENV{SDL2NETDIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_NET_PATH}
|
||||
DOC "Where the SDL2_net headers can be found"
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_net library
|
||||
find_library(SDL2_NET_LIBRARY
|
||||
NAMES SDL2_net
|
||||
HINTS
|
||||
ENV SDL2NETDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_NET_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_NET_PATH}
|
||||
DOC "Where the SDL2_net Library can be found"
|
||||
)
|
||||
|
||||
# Read SDL2_net version
|
||||
if(SDL2_NET_INCLUDE_DIR AND EXISTS "${SDL2_NET_INCLUDE_DIR}/SDL_net.h")
|
||||
file(STRINGS "${SDL2_NET_INCLUDE_DIR}/SDL_net.h" SDL2_NET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_NET_INCLUDE_DIR}/SDL_net.h" SDL2_NET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_NET_INCLUDE_DIR}/SDL_net.h" SDL2_NET_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_NET_VERSION_MAJOR "${SDL2_NET_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_NET_VERSION_MINOR "${SDL2_NET_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_NET_VERSION_PATCH "${SDL2_NET_VERSION_PATCH_LINE}")
|
||||
set(SDL2_NET_VERSION_STRING ${SDL2_NET_VERSION_MAJOR}.${SDL2_NET_VERSION_MINOR}.${SDL2_NET_VERSION_PATCH})
|
||||
unset(SDL2_NET_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_NET_VERSION_MINOR_LINE)
|
||||
unset(SDL2_NET_VERSION_PATCH_LINE)
|
||||
unset(SDL2_NET_VERSION_MAJOR)
|
||||
unset(SDL2_NET_VERSION_MINOR)
|
||||
unset(SDL2_NET_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
set(SDL2_NET_LIBRARIES ${SDL2_NET_LIBRARY})
|
||||
set(SDL2_NET_INCLUDE_DIRS ${SDL2_NET_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_net
|
||||
REQUIRED_VARS SDL2_NET_LIBRARIES SDL2_NET_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_NET_VERSION_STRING)
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_NET_PATH
|
||||
SDL2_NET_NO_DEFAULT_PATH
|
||||
SDL2_NET_LIBRARY
|
||||
SDL2_NET_INCLUDE_DIR)
|
||||
|
||||
|
||||
if(SDL2_NET_FOUND)
|
||||
|
||||
# SDL2::Net target
|
||||
if(SDL2_NET_LIBRARY AND NOT TARGET SDL2::Net)
|
||||
add_library(SDL2::Net UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::Net PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_NET_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_NET_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
endif()
|
||||
endif()
|
222
cmake/sdl2/FindSDL2_ttf.cmake
Normal file
222
cmake/sdl2/FindSDL2_ttf.cmake
Normal file
@ -0,0 +1,222 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# 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:
|
||||
FindSDL2_ttf
|
||||
------------
|
||||
|
||||
Locate SDL2_ttf library
|
||||
|
||||
This module defines the following 'IMPORTED' target:
|
||||
|
||||
::
|
||||
|
||||
SDL2::TTF
|
||||
The SDL2_ttf library, if found.
|
||||
Have SDL2::Core as a link dependency.
|
||||
|
||||
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
::
|
||||
|
||||
SDL2_TTF_LIBRARIES, the name of the library to link against
|
||||
SDL2_TTF_INCLUDE_DIRS, where to find the headers
|
||||
SDL2_TTF_FOUND, if false, do not try to link against
|
||||
SDL2_TTF_VERSION_STRING - human-readable string containing the
|
||||
version of SDL2_ttf
|
||||
|
||||
|
||||
|
||||
This module responds to the following cache variables:
|
||||
|
||||
::
|
||||
|
||||
SDL2_TTF_PATH
|
||||
Set a custom SDL2_ttf Library path (default: empty)
|
||||
|
||||
SDL2_TTF_NO_DEFAULT_PATH
|
||||
Disable search SDL2_ttf Library in default path.
|
||||
If SDL2_TTF_PATH (default: ON)
|
||||
Else (default: OFF)
|
||||
|
||||
SDL2_TTF_INCLUDE_DIR
|
||||
SDL2_ttf headers path.
|
||||
|
||||
SDL2_TTF_LIBRARY
|
||||
SDL2_ttf Library (.dll, .so, .a, etc) path.
|
||||
|
||||
|
||||
Additional Note: If you see an empty SDL2_TTF_LIBRARY in your project
|
||||
configuration, it means CMake did not find your SDL2_ttf library
|
||||
(SDL2_ttf.dll, libsdl2_ttf.so, etc). Set SDL2_TTF_LIBRARY to point
|
||||
to your SDL2_ttf library, and configure again. This value is used to
|
||||
generate the final SDL2_TTF_LIBRARIES variable and the SDL2::TTF target,
|
||||
but when this value is unset, SDL2_TTF_LIBRARIES and SDL2::TTF does not
|
||||
get created.
|
||||
|
||||
|
||||
$SDL2TTFDIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2TTFDIR used in building SDL2_ttf.
|
||||
|
||||
$SDL2DIR is an environment variable that would correspond to the
|
||||
./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
|
||||
|
||||
|
||||
Created by Amine Ben Hassouna:
|
||||
Adapt FindSDL_ttf.cmake to SDL2_ttf (FindSDL2_ttf.cmake).
|
||||
Add cache variables for more flexibility:
|
||||
SDL2_TTF_PATH, SDL2_TTF_NO_DEFAULT_PATH (for details, see doc above).
|
||||
Add SDL2 as a required dependency.
|
||||
Modernize the FindSDL2_ttf.cmake module by creating a specific target:
|
||||
SDL2::TTF (for details, see doc above).
|
||||
|
||||
Original FindSDL_ttf.cmake module:
|
||||
Created by Eric Wing. This was influenced by the FindSDL.cmake
|
||||
module, but with modifications to recognize OS X frameworks and
|
||||
additional Unix paths (FreeBSD, etc).
|
||||
#]=======================================================================]
|
||||
|
||||
# SDL2 Library required
|
||||
find_package(SDL2 QUIET)
|
||||
if(NOT SDL2_FOUND)
|
||||
set(SDL2_TTF_SDL2_NOT_FOUND "Could NOT find SDL2 (SDL2 is required by SDL2_ttf).")
|
||||
if(SDL2_ttf_FIND_REQUIRED)
|
||||
message(FATAL_ERROR ${SDL2_TTF_SDL2_NOT_FOUND})
|
||||
else()
|
||||
if(NOT SDL2_ttf_FIND_QUIETLY)
|
||||
message(STATUS ${SDL2_TTF_SDL2_NOT_FOUND})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(SDL2_TTF_SDL2_NOT_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# Define options for searching SDL2_ttf Library in a custom path
|
||||
|
||||
set(SDL2_TTF_PATH "" CACHE STRING "Custom SDL2_ttf Library path")
|
||||
|
||||
set(_SDL2_TTF_NO_DEFAULT_PATH OFF)
|
||||
if(SDL2_TTF_PATH)
|
||||
set(_SDL2_TTF_NO_DEFAULT_PATH ON)
|
||||
endif()
|
||||
|
||||
set(SDL2_TTF_NO_DEFAULT_PATH ${_SDL2_TTF_NO_DEFAULT_PATH}
|
||||
CACHE BOOL "Disable search SDL2_ttf Library in default path")
|
||||
unset(_SDL2_TTF_NO_DEFAULT_PATH)
|
||||
|
||||
set(SDL2_TTF_NO_DEFAULT_PATH_CMD)
|
||||
if(SDL2_TTF_NO_DEFAULT_PATH)
|
||||
set(SDL2_TTF_NO_DEFAULT_PATH_CMD NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_ttf include directory
|
||||
find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
|
||||
HINTS
|
||||
ENV SDL2TTFDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_TTF_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
# and ENV{SDL2TTFDIR}
|
||||
include/SDL2 include
|
||||
PATHS ${SDL2_TTF_PATH}
|
||||
DOC "Where the SDL2_ttf headers can be found"
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
# Search for the SDL2_ttf library
|
||||
find_library(SDL2_TTF_LIBRARY
|
||||
NAMES SDL2_ttf
|
||||
HINTS
|
||||
ENV SDL2TTFDIR
|
||||
ENV SDL2DIR
|
||||
${SDL2_TTF_NO_DEFAULT_PATH_CMD}
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS ${SDL2_TTF_PATH}
|
||||
DOC "Where the SDL2_ttf Library can be found"
|
||||
)
|
||||
|
||||
# Read SDL2_ttf version
|
||||
if(SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h")
|
||||
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
|
||||
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MAJOR "${SDL2_TTF_VERSION_MAJOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MINOR "${SDL2_TTF_VERSION_MINOR_LINE}")
|
||||
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_PATCH "${SDL2_TTF_VERSION_PATCH_LINE}")
|
||||
set(SDL2_TTF_VERSION_STRING ${SDL2_TTF_VERSION_MAJOR}.${SDL2_TTF_VERSION_MINOR}.${SDL2_TTF_VERSION_PATCH})
|
||||
unset(SDL2_TTF_VERSION_MAJOR_LINE)
|
||||
unset(SDL2_TTF_VERSION_MINOR_LINE)
|
||||
unset(SDL2_TTF_VERSION_PATCH_LINE)
|
||||
unset(SDL2_TTF_VERSION_MAJOR)
|
||||
unset(SDL2_TTF_VERSION_MINOR)
|
||||
unset(SDL2_TTF_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
|
||||
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
|
||||
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_TTF_VERSION_STRING)
|
||||
|
||||
|
||||
mark_as_advanced(SDL2_TTF_PATH
|
||||
SDL2_TTF_NO_DEFAULT_PATH
|
||||
SDL2_TTF_LIBRARY
|
||||
SDL2_TTF_INCLUDE_DIR)
|
||||
|
||||
|
||||
if(SDL2_TTF_FOUND)
|
||||
|
||||
# SDL2::TTF target
|
||||
if(SDL2_TTF_LIBRARY AND NOT TARGET SDL2::TTF)
|
||||
add_library(SDL2::TTF UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::TTF PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_TTF_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_TTF_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES SDL2::Core)
|
||||
endif()
|
||||
endif()
|
179
cmake/sdl2/README.md
Normal file
179
cmake/sdl2/README.md
Normal file
@ -0,0 +1,179 @@
|
||||
# SDL2 CMake modules
|
||||
|
||||
This repository contains [CMake][] modules for finding and using the SDL2
|
||||
library as well as other related libraries:
|
||||
|
||||
- [SDL2][]
|
||||
- [SDL2_image][]
|
||||
- [SDL2_ttf][]
|
||||
- [SDL2_net][]
|
||||
- [SDL2_mixer][]
|
||||
- [SDL2_gfx][]
|
||||
|
||||
These modules are based on the SDL (1.2) modules, with the same names,
|
||||
distributed with the CMake project. The SDL2_gfx module is also based
|
||||
on the SDL_image module.
|
||||
|
||||
## Details and Improvements
|
||||
|
||||
The improvements made to these modules are as follows:
|
||||
|
||||
**FindSDL2.cmake**
|
||||
|
||||
- Adapt `FindSDL.cmake` to `SDL2` (`FindSDL2.cmake`).
|
||||
- Add cache variables for more flexibility:<br>
|
||||
`SDL2_PATH`, `SDL2_NO_DEFAULT_PATH`
|
||||
- Mark `Threads` as a required dependency for non-OSX systems.
|
||||
- Modernize the `FindSDL2.cmake` module by creating specific targets:
|
||||
- `SDL2::Core` : Library project should link to `SDL2::Core`
|
||||
- `SDL2::Main` : Application project should link to `SDL2::Main`
|
||||
|
||||
*For more details, please see the embedded documentation in `FindSDL2.cmake` file.*
|
||||
|
||||
**FindSDL2_<COMPONENT>.cmake**
|
||||
|
||||
- Adapt `FindSDL_<COMPONENT>.cmake` to `SDL2_<COMPONENT>` (`FindSDL2_<COMPONENT>.cmake`).
|
||||
- Add cache variables for more flexibility:<br>
|
||||
`SDL2_<COMPONENT>_PATH`, `SDL2_<COMPONENT>_NO_DEFAULT_PATH`
|
||||
- Add `SDL2` as a required dependency.
|
||||
- Modernize the `FindSDL2_<COMPONENT>.cmake` modules by creating specific targets:<br>
|
||||
`SDL2::Image`, `SDL2::TTF`, `SDL2::Net`, `SDL2::Mixer` and `SDL2::GFX`.
|
||||
|
||||
*For more details, please see the embedded documentation in
|
||||
`FindSDL2_<COMPONENT>.cmake` file.*
|
||||
|
||||
## Usage
|
||||
|
||||
In order to use the SDL2 CMake modules, we have to clone this repository in a
|
||||
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
|
||||
|
||||
We can link to the SDL2:: targets like the following example:<br>
|
||||
*This example requires the SDL2, SDL2_image and the SDL2_gfx libraries*
|
||||
|
||||
```cmake
|
||||
# Find SDL2, SDL2_image and SDL2_gfx libraries
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(SDL2_gfx REQUIRED)
|
||||
|
||||
# Link SDL2::Main, SDL2::Image and SDL2::GFX to our project
|
||||
target_link_libraries(${PROJECT_NAME} SDL2::Main SDL2::Image SDL2::GFX)
|
||||
```
|
||||
|
||||
*Use the appropriate packages for you project.*<br>
|
||||
*Please see above, for the whole list of packages*<br>
|
||||
*For more details, please see the embedded documentation in modules files*
|
||||
|
||||
### Legacy CMake
|
||||
|
||||
We can also specify manually the include directories and libraries to link to:
|
||||
|
||||
```cmake
|
||||
# Find and link SDL2
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES})
|
||||
|
||||
# Find and link SDL2_image
|
||||
find_package(SDL2_image REQUIRED)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_IMAGE_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} ${SDL2_IMAGE_LIBRARIES})
|
||||
|
||||
# Find and link SDL2_gfx
|
||||
find_package(SDL2_gfx REQUIRED)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_GFX_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} ${SDL2_GFX_LIBRARIES})
|
||||
|
||||
```
|
||||
|
||||
*For more details, please see the embedded documentation in modules files*
|
||||
|
||||
## Special customization variables
|
||||
|
||||
Each module have special customization cache variables that can be used to help
|
||||
the modules find the appropriate libraries:
|
||||
|
||||
- `SDL2_PATH` and `SDL2_<COMPONENT>_PATH`:<br>
|
||||
Can be specified to set the root search path for the `SDL2` and `SDL2_<COMPONENT>`
|
||||
- `SDL2_NO_DEFAULT_PATH` and `SDL2_<COMPONENT>_NO_DEFAULT_PATH`:<br>
|
||||
Disable search `SDL2/SDL2_<COMPONENT>` library in default path:<br>
|
||||
If `SDL2[_<COMPONENT>]_PATH` is set, defaults to ON<br>
|
||||
Else defaults to OFF
|
||||
- `SDL2_INCLUDE_DIR` and `SDL2_<COMPONENT>_INCLUDE_DIR`:<br>
|
||||
Set headers path. (Override)
|
||||
- `SDL2_LIBRARY` and `SDL2_<COMPONENT>_LIBRARY`:<br>
|
||||
Set the library (.dll, .so, .a, etc) path. (Override)
|
||||
- `SDL2MAIN_LIBRAY`:<br>
|
||||
Set the `SDL2main` library (.a) path. (Override)
|
||||
|
||||
These variables could be used in case of Windows projects, and when the
|
||||
libraries are not localized in a standard pathes. They can be specified when
|
||||
executing the `cmake` command or when using the [CMake GUI][] (They are marked
|
||||
as advanced).
|
||||
|
||||
**cmake command example:**
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DSDL2_PATH="/path/to/sdl2"
|
||||
```
|
||||
|
||||
**CMakeLists.txt example:**
|
||||
|
||||
If we embed, for example, binaries of the SDL2_ttf in our project, we can
|
||||
specify the cache variables values just before calling the `find_package`
|
||||
command as follows:
|
||||
|
||||
```cmake
|
||||
set(SDL2_TTF_PATH "/path/to/sdl2_ttf" CACHE BOOL "" FORCE)
|
||||
find_package(SDL2_ttf REQUIRED)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Maintainer: Amine B. Hassouna [@aminosbh](https://gitlab.com/aminosbh)
|
||||
|
||||
The SDL2 CMake modules are based on the SDL (1.2) modules available with the
|
||||
CMake project which is distributed under the OSI-approved BSD 3-Clause License.
|
||||
|
||||
The SDL2 CMake modules are also distributed under the OSI-approved BSD
|
||||
3-Clause License. See accompanying file [Copyright.txt](Copyright.txt).
|
||||
|
||||
|
||||
|
||||
[CMake]: https://cmake.org
|
||||
[CMake GUI]: https://cmake.org/runningcmake
|
||||
[SDL2]: https://www.libsdl.org
|
||||
[SDL2_image]: https://www.libsdl.org/projects/SDL_image
|
||||
[SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf
|
||||
[SDL2_net]: https://www.libsdl.org/projects/SDL_net
|
||||
[SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer
|
||||
[SDL2_gfx]: http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx
|
1
libtmx-parser
Submodule
1
libtmx-parser
Submodule
Submodule libtmx-parser added at a2b8ca09ef
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "MusicManager.h"
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
#include "SDL2/SDL_mixer.h"
|
||||
|
||||
Mix_Music* MusicManager::LoadMusic(const char* path){
|
||||
Mix_Music* music = Mix_LoadMUS(path);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define SRC_MUSICMANAGER_H_
|
||||
|
||||
#include "../game/Game.hpp"
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
#include "../../libsdl2_mixer/SDL_mixer.h"
|
||||
|
||||
class MusicManager
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"GameName":"Beagle Rescue",
|
||||
"WindowName":"Beagle Rescue",
|
||||
"WindowSize":{"w":427,"h":240},
|
||||
"WindowSize":{"w":320,"h":240},
|
||||
"WindowFullScreen": 0,
|
||||
"GlobalScale": 2
|
||||
"GlobalScale": 3
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"GameName":"Beagle Rescue",
|
||||
"Developers": "Alan Youngblood, Simon Zaleski, Daniel Rinaldi",
|
||||
"LibraryDevelopers": "Sam Lantinga, Dave Gamble, Carl Birch, Job Vranish, David Lafreniere, Bayle Jonathan, Robin Berg Pettersen",
|
||||
"LibraryDevelopers": "Sam Lantinga, Dave Gamble, Carl Birch, Job Vranish, David Lafreniere, Bayle Jonathan",
|
||||
"SpecialThanks":"Nic Allen, Brian Lhota, Rodrigo Monteiro"
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define SRC_ECS_COLLIDERCOMPONENT_H_
|
||||
|
||||
#include <string>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "Components.h"
|
||||
#include "ECS.h"
|
||||
#include "../assetmgr/TextureManager.h"
|
||||
|
@ -70,13 +70,6 @@ public:
|
||||
break;
|
||||
case SDLK_LEFT:
|
||||
if(Game::gsm->currentState == GameStateManager::ST_COREGAME){
|
||||
if(transform->position.x>Game::levelMap.x){
|
||||
transform->velocity.x = -1;
|
||||
// if(Game::playerIsGrounded){
|
||||
sprite->Play("Walk");
|
||||
// }
|
||||
sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
}
|
||||
// if (playerCtrl == NULL){
|
||||
// printf("No player controller found\n");
|
||||
// } else {
|
||||
@ -88,7 +81,7 @@ public:
|
||||
// Game::pTileX
|
||||
// if(transform->position.x>0){
|
||||
|
||||
/*int *borders;
|
||||
int *borders;
|
||||
borders = Game::predictCollisions();
|
||||
float max = borders[0];
|
||||
for (int b=0;b<3;b++){
|
||||
@ -109,7 +102,7 @@ public:
|
||||
transform->velocity.x = 0;
|
||||
sprite->Play("Idle");
|
||||
sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SDLK_RIGHT:
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define SRC_ECS_SPRITECOMPONENT_H_
|
||||
|
||||
#include "Components.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "../assetmgr/TextureManager.h"
|
||||
#include "Animation.h"
|
||||
#include <map>
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define SRC_ECS_TILECOMPONENT_H_
|
||||
|
||||
#include "ECS.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "../assetmgr/AssetManager.h"
|
||||
|
||||
class TileComponent : public Component
|
||||
|
@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* TileMapComponent.h
|
||||
*
|
||||
* Created on: Mar 21, 2020
|
||||
@ -10,21 +9,20 @@
|
||||
#define SRC_ECS_TILEMAPCOMPONENT_H_
|
||||
|
||||
#include "ECS.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "../assetmgr/AssetManager.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include "../tileson/tileson.hpp"
|
||||
#include "tmxparser.h"
|
||||
|
||||
class TileMapComponent : public Component
|
||||
{
|
||||
public:
|
||||
SDL_Texture* texture;
|
||||
SDL_Rect srcRect, destRect;
|
||||
tson::Tileson t;
|
||||
std::unique_ptr<tson::Map> map;
|
||||
tmxparser::TmxMap map;
|
||||
int globalScale;
|
||||
std::vector<SDL_Rect> tileSet;
|
||||
std::vector<SDL_Rect> destRects;
|
||||
@ -42,78 +40,53 @@ public:
|
||||
SDL_DestroyTexture(texture);
|
||||
}
|
||||
|
||||
TileMapComponent(std::string mapPath, int gScale, int offsetX, int offsetY)
|
||||
TileMapComponent(tmxparser::TmxMap loadedMap, int gScale, int offsetX, int offsetY)
|
||||
{
|
||||
// TILESON ~~~~~~~~~~~
|
||||
|
||||
const std::filesystem::path jsonPath = std::filesystem::u8path(mapPath);
|
||||
map = t.parse(jsonPath);
|
||||
|
||||
if(map->getStatus() == tson::ParseStatus::OK)
|
||||
{
|
||||
tson::Tileset *tileset = map->getTileset("br-tiles");
|
||||
std::string fullPath = tileset->getImage();
|
||||
|
||||
size_t charPos = fullPath.find("assets");
|
||||
fullPath.erase(0,charPos);
|
||||
tson::Layer *tileLayer = map->getLayer("Tile Layer 1"); //This is a Layer
|
||||
std::string texName = tileLayer->getName();
|
||||
Game::assets->AddTexture(texName, fullPath.c_str());
|
||||
setTex(texName);
|
||||
map = loadedMap;
|
||||
std::string texturePath = "assets/textures/tiles/" + loadedMap.tilesetCollection[0].name + ".png";
|
||||
Game::assets->AddTexture(map.tilesetCollection[0].name, texturePath.c_str());
|
||||
setTex(map.tilesetCollection[0].name);
|
||||
globalScale = gScale;
|
||||
|
||||
tson::Layer *collisionLayer = map->getLayer("Collision");
|
||||
|
||||
tilesWide = map->getSize().x;
|
||||
tilesHigh = map->getSize().y;
|
||||
tileWidth = map->getTileSize().x;
|
||||
|
||||
Game::levelMap.w = tilesWide*tileWidth*globalScale;
|
||||
Game::levelMap.h = tilesHigh*tileWidth*globalScale;
|
||||
|
||||
colliders.resize(map.height, std::vector<int>(map.width, 0));
|
||||
tilesWide = map.width;
|
||||
tilesHigh = map.height;
|
||||
tileWidth = map.tileWidth;
|
||||
|
||||
// =========== Setup Tile Set ===========
|
||||
|
||||
tileSetTotal = tileset->getTileCount();
|
||||
tileSetTotal = map.tilesetCollection[0].colCount*map.tilesetCollection[0].rowCount;
|
||||
tileSet.resize(tileSetTotal);
|
||||
int tileSetCols = tileset->getColumns();
|
||||
int tileSetRows = tileSetTotal/tileSetCols;
|
||||
|
||||
for (int r=0;r<tileSetRows;r++){
|
||||
for (int c=0;c<tileSetCols;c++){
|
||||
srcRect.x = c*tileWidth;
|
||||
srcRect.y = r*tileWidth;
|
||||
srcRect.w = srcRect.h = tileWidth;
|
||||
int element = r*tileSetCols+c;
|
||||
for (int r=0;r<map.tilesetCollection[0].rowCount;r++){
|
||||
for (int c=0;c<map.tilesetCollection[0].colCount;c++){
|
||||
srcRect.x = c*map.tilesetCollection[0].tileWidth;
|
||||
srcRect.y = r*map.tilesetCollection[0].tileHeight;
|
||||
srcRect.w = srcRect.h = map.tileWidth;
|
||||
int element = r*map.tilesetCollection[0].colCount+c;
|
||||
tileSet[element] = srcRect;
|
||||
}
|
||||
}
|
||||
|
||||
if(tileLayer->getType() == tson::LayerType::TileLayer)
|
||||
{
|
||||
destRects.resize(tilesWide*tilesHigh);
|
||||
initialPositions.resize(tilesWide*tilesHigh);
|
||||
for (int r=0;r<tilesHigh;r++){
|
||||
for (int c=0;c<tilesWide;c++){
|
||||
int elem = c+r*tilesWide;
|
||||
// =========== Setup Tile Map ============
|
||||
destRects.resize(map.width*map.height);
|
||||
initialPositions.resize(map.width*map.height);
|
||||
for (int r = 0;r<map.height;r++){
|
||||
for (int c = 0;c<map.width;c++){
|
||||
int elem = c+r*map.width;
|
||||
SDL_Rect thisRect = SDL_Rect();
|
||||
thisRect.x = c*tileWidth*globalScale;
|
||||
thisRect.y = r*tileWidth*globalScale;
|
||||
thisRect.w = thisRect.h = tileWidth*globalScale;
|
||||
thisRect.x = c*map.tilesetCollection[0].tileWidth*globalScale;
|
||||
thisRect.y = r*map.tilesetCollection[0].tileWidth*globalScale;
|
||||
thisRect.w = thisRect.h = map.tileWidth * globalScale;
|
||||
std::tuple<int,int> ogPos = std::make_tuple(thisRect.x,thisRect.y);
|
||||
initialPositions[elem] = ogPos;
|
||||
thisRect.x = thisRect.x-offsetX*globalScale;
|
||||
thisRect.y = thisRect.y=offsetY*globalScale;
|
||||
thisRect.y = thisRect.y-offsetY*globalScale;
|
||||
destRects[elem] = thisRect;
|
||||
colliders[r][c] = map.layerCollection[1].tiles[elem].gid;
|
||||
// std::cout << "colliders[" << std::to_string(r) << "][" << std::to_string(c) << "]= " << std::to_string(colliders[r][c]) << std::endl;
|
||||
}
|
||||
}
|
||||
destRect.w = destRect.h = tileWidth * gScale;
|
||||
}
|
||||
|
||||
} else {
|
||||
printf("Failed to load Tileson map\n");
|
||||
std::cout << map->getStatusMessage();
|
||||
}
|
||||
destRect.w = destRect.h = map.tileWidth * gScale;
|
||||
}
|
||||
|
||||
void update() override
|
||||
@ -131,19 +104,15 @@ public:
|
||||
{
|
||||
//iterate through rows and columns of the map to draw the tiles
|
||||
// First cycle through rows
|
||||
tson::Layer *myLayer = map->getLayer("Tile Layer 1");
|
||||
tson::Layer *collisionLayer = map->getLayer("Collision");
|
||||
for (int r = 0;r<map->getSize().y;r++){
|
||||
for (int r = 0;r<map.height;r++){
|
||||
// Next cycle through each column or tile in that row:
|
||||
for (int c = 0;c<map->getSize().x;c++){
|
||||
int i = r*map->getSize().x+c;
|
||||
int elem = c+r*map->getSize().x;
|
||||
tson::Tile *myTile = myLayer->getTileData(c,r);
|
||||
int tid = myTile->getId()-1;
|
||||
int tileToDraw = tid;
|
||||
for (int c = 0;c<map.width;c++){
|
||||
int i = r*map.width+c;
|
||||
int elem = c+r*map.width;
|
||||
int tileToDraw = map.layerCollection[0].tiles[i].gid-1;
|
||||
TextureManager::Draw(texture, tileSet[tileToDraw], destRects[elem], SDL_FLIP_NONE);
|
||||
if (Game::debugMenu){
|
||||
if (collisionLayer->getTileData(c,r)) {
|
||||
if (map.layerCollection[1].tiles[i].gid != 0) {
|
||||
SDL_SetRenderDrawColor(Game::renderer,255,0,255,134);
|
||||
SDL_RenderDrawRect(Game::renderer, &destRects[elem]);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define ASCII_ROW_COUNT 16
|
||||
|
||||
#include "Components.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "../assetmgr/TextureManager.h"
|
||||
#include "../assetmgr/AssetManager.h"
|
||||
#include <stdio.h>
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef SRC_COLLISION_H_
|
||||
#define SRC_COLLISION_H_
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
// #include "Vector2D.h"
|
||||
|
||||
class ColliderComponent;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "Game.hpp"
|
||||
#include "../assetmgr/TextureManager.h"
|
||||
#include "../assetmgr/Map.h"
|
||||
// #include "../assetmgr/Map.h"
|
||||
#include "../ecs/Components.h"
|
||||
#include "Collision.h"
|
||||
#include <string>
|
||||
@ -18,13 +18,12 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include "../assetmgr/AssetManager.h"
|
||||
#include "../ui/UIText.h"
|
||||
// #include "../ui/UIText.h"
|
||||
#include "../ui/UINineSlice.h"
|
||||
#include "../cjson/cJSON.h"
|
||||
#include "../tileson/tileson.hpp"
|
||||
#include <cmath>
|
||||
#include <filesystem>
|
||||
|
||||
// tmxparser::TmxMap map;
|
||||
Manager manager;
|
||||
UINineSlice* my9Slice;
|
||||
UINineSlice* scoreboard9Slice;
|
||||
@ -75,8 +74,6 @@ int last_time;
|
||||
int current_time;
|
||||
int diff_time;
|
||||
|
||||
tson::Tileson t;
|
||||
|
||||
int Game::pTileX = 0;
|
||||
int Game::pTileY = 0;
|
||||
|
||||
@ -135,6 +132,27 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Couldn't initialize SDL audio mixer!, Error: %s", SDL_GetError());
|
||||
}
|
||||
|
||||
|
||||
// Trying out the halsafar/libtmx-parser
|
||||
tmxparser::TmxReturn error;
|
||||
tmxparser::TmxMap map;
|
||||
error = tmxparser::parseFromFile("assets/maps/testmapb64.tmx", &map, "assets/textures/tiles/");
|
||||
|
||||
if (!error)
|
||||
{
|
||||
// printf("Yay! Tile map loaded with no errors.\n");
|
||||
tmxparser::TmxLayer layer = map.layerCollection[0];
|
||||
levelMap.x = 0;
|
||||
levelMap.y = 0;
|
||||
levelMap.w = map.width*map.tileWidth*gScale;
|
||||
levelMap.h = map.height*map.tileHeight*gScale;
|
||||
// std::cout << "Map Width Tiles: " << map.width << " Map Tile Width: " << map.tileWidth <<std::endl;
|
||||
} else {
|
||||
std::cout << "Encountered error loading map file: " << error << std::endl;
|
||||
}
|
||||
|
||||
// std::cout << "levelMap.w - camera.w: " << levelMap.w-camera.w << std::endl;
|
||||
|
||||
assets->AddTexture("player", "assets/textures/actors/firefighter.png");
|
||||
assets->AddTexture("font", "assets/textures/ui/ui-font-cloud-sans.png");
|
||||
assets->AddTexture("textBox", "assets/textures/ui/ui-element-cloud.png");
|
||||
@ -168,8 +186,7 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
|
||||
uiInfo.addComponent<TransformComponent>(camera.w/gScale-94,10,72*gScale,96*gScale,gScale);
|
||||
// uiInfo.addComponent<UITextComponent>("font", "CollisionHori: Vert: Jump: P.y : P.dy: YVec: ", 8, 12, 1);
|
||||
// uiInfo.addComponent<UITextComponent>("font", "Player PTiX: PTiY: P.x: P.y : coll: Px2: tson: ", 8, 12, gScale);
|
||||
uiInfo.addComponent<UITextComponent>("font", "Player PTiX: PTiY: P.x: P.y : coll: ", 8, 12, gScale);
|
||||
uiInfo.addComponent<UITextComponent>("font", "Player PTiX: PTiY: P.x: P.y : coll: Px2 bnd ", 8, 12, gScale);
|
||||
uiInfo.addGroup(groupUI_Layer3);
|
||||
|
||||
uiCamXInfo.addComponent<TransformComponent>(camera.w/gScale-48,23,40*gScale,12*gScale,gScale);
|
||||
@ -192,13 +209,13 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
uiBoundary1Info.addComponent<UITextComponent>("font", "nan", 8, 12, gScale);
|
||||
uiBoundary1Info.addGroup(groupUI_Layer3);
|
||||
|
||||
// uiBoundary2Info.addComponent<TransformComponent>(camera.w/gScale-64,88,128*gScale,12*gScale,gScale);
|
||||
// uiBoundary2Info.addComponent<UITextComponent>("font", "nan", 8, 12, gScale);
|
||||
// uiBoundary2Info.addGroup(groupUI_Layer3);
|
||||
//
|
||||
// uiBoundary3Info.addComponent<TransformComponent>(camera.w/gScale-64,101,128*gScale,12*gScale,gScale);
|
||||
// uiBoundary3Info.addComponent<UITextComponent>("font", "nan", 8, 12, gScale);
|
||||
// uiBoundary3Info.addGroup(groupUI_Layer3);
|
||||
uiBoundary2Info.addComponent<TransformComponent>(camera.w/gScale-64,88,128*gScale,12*gScale,gScale);
|
||||
uiBoundary2Info.addComponent<UITextComponent>("font", "nan", 8, 12, gScale);
|
||||
uiBoundary2Info.addGroup(groupUI_Layer3);
|
||||
|
||||
uiBoundary3Info.addComponent<TransformComponent>(camera.w/gScale-64,101,128*gScale,12*gScale,gScale);
|
||||
uiBoundary3Info.addComponent<UITextComponent>("font", "nan", 8, 12, gScale);
|
||||
uiBoundary3Info.addGroup(groupUI_Layer3);
|
||||
|
||||
// debug UI box
|
||||
SDL_Rect debugBoxRect = SDL_Rect();
|
||||
@ -220,10 +237,7 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
player.addComponent<KeyboardController>();
|
||||
player.addGroup(groupPlayers);
|
||||
|
||||
levelMap.x = 0;
|
||||
levelMap.y = 0;
|
||||
|
||||
gameScene.addComponent<TileMapComponent>("assets/maps/testmap.json",gScale,player.getComponent<TransformComponent>().position.x+player.getComponent<TransformComponent>().width/2,player.getComponent<TransformComponent>().position.y+player.getComponent<TransformComponent>().height/2); //150,100
|
||||
gameScene.addComponent<TileMapComponent>(map,gScale,player.getComponent<TransformComponent>().position.x+player.getComponent<TransformComponent>().width/2,player.getComponent<TransformComponent>().position.y+player.getComponent<TransformComponent>().height/2); //150,100
|
||||
gameScene.addGroup(groupMap);
|
||||
|
||||
playerPosition = Vector2D().Zero();
|
||||
@ -310,8 +324,6 @@ void Game::update()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Gravity
|
||||
// if (gravityOnPlayer){
|
||||
// player.getComponent<TransformComponent>().position.y += 3*gScale;
|
||||
@ -346,13 +358,13 @@ void Game::update()
|
||||
uiPlayerXInfo.getComponent<UITextComponent>().updateString(std::to_string(playerX));
|
||||
uiPlayerYInfo.getComponent<UITextComponent>().updateString(std::to_string(playerY));
|
||||
|
||||
// int * foundBoundaries = predictCollisions();
|
||||
// int max = foundBoundaries[0];
|
||||
// for (int b=0;b<3;b++){
|
||||
// if (foundBoundaries[b]>max){
|
||||
// max = foundBoundaries[b];
|
||||
// }
|
||||
// }
|
||||
int * foundBoundaries = predictCollisions();
|
||||
int max = foundBoundaries[0];
|
||||
for (int b=0;b<3;b++){
|
||||
if (foundBoundaries[b]>max){
|
||||
max = foundBoundaries[b];
|
||||
}
|
||||
}
|
||||
float desiredMovementX = -1*player.getComponent<TransformComponent>().speed*0.016;
|
||||
// int desiredMovementY = player.getComponent<TransformComponent>().velocity.y*player.getComponent<TransformComponent>().speed*player.getComponent<TransformComponent>().scale;
|
||||
// uiBoundary1Info.getComponent<UITextComponent>().updateString(std::to_string((int)foundBoundaries[0]));
|
||||
@ -364,8 +376,8 @@ void Game::update()
|
||||
}
|
||||
// uiBoundary2Info.getComponent<UITextComponent>().updateString(std::to_string((int)foundBoundaries[1]));
|
||||
float difference = player.getComponent<TransformComponent>().position.x+desiredMovementX;
|
||||
//uiBoundary2Info.getComponent<UITextComponent>().updateString(std::to_string((float)difference));
|
||||
//uiBoundary3Info.getComponent<UITextComponent>().updateString(std::to_string((int)(max*gScale)));
|
||||
uiBoundary2Info.getComponent<UITextComponent>().updateString(std::to_string((float)difference));
|
||||
uiBoundary3Info.getComponent<UITextComponent>().updateString(std::to_string((int)(max*gScale)));
|
||||
|
||||
// uiBoundary3Info.getComponent<UITextComponent>().updateString(std::to_string((int)foundBoundaries[2]));
|
||||
|
||||
@ -480,7 +492,7 @@ void Game::drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blu
|
||||
int * Game::predictCollisions(){
|
||||
static int boundaries[3];
|
||||
// ===== LEFT =====
|
||||
/*if (player.getComponent<TransformComponent>().velocity.x<0){
|
||||
if (player.getComponent<TransformComponent>().velocity.x<0){
|
||||
// ====== For Each Row ====
|
||||
int i = 0;
|
||||
for (int r=Game::pTileY-1;r<=Game::pTileY+1;r++){
|
||||
@ -495,7 +507,7 @@ int * Game::predictCollisions(){
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
/*
|
||||
// ====== RIGHT ====
|
||||
if (player.getComponent<TransformComponent>().velocity.x>0){
|
||||
|
@ -7,18 +7,16 @@
|
||||
|
||||
#ifndef GAME_HPP_
|
||||
#define GAME_HPP_
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_mixer.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "Vector2D.h"
|
||||
#include "../assetmgr/AssetManager.h"
|
||||
#include "GameStateManager.h"
|
||||
//#include "../../libtmx-parser/src/tmxparser.h"
|
||||
//#include "libtmx-parser/src/tmxparser.h"
|
||||
//#include <tmxparser.h>
|
||||
#include "../../libtmx-parser/src/tmxparser.h"
|
||||
|
||||
class ColliderComponent;
|
||||
class AssetManager;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
#ifndef SRC_UININESLICE_H_
|
||||
#define SRC_UININESLICE_H_
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include "string"
|
||||
#include "../game/Game.hpp"
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define ASCII_COUNT 96
|
||||
#define ASCII_ROW_COUNT 16
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include <iostream>
|
||||
#include "../game/Game.hpp"
|
||||
#include "../assetmgr/TextureManager.h"
|
||||
|
Reference in New Issue
Block a user