From 7442a84397efa8ce56d87f9ccd2e6431bdba2ef9 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 25 Jun 2022 10:55:04 -0600 Subject: [PATCH 1/5] Use SFML's .gitignore file --- .gitignore | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5a9a38a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build folders +build/ + +# Cache/IDE folders +.cache/ +.vscode/ +.idea/ From 71bcb569b82edf75552e7845d9cfb717786a13a5 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 25 Jun 2022 10:58:27 -0600 Subject: [PATCH 2/5] Use built-in project version variables --- CMakeLists.txt | 7 +------ cmake/Macros.cmake | 6 +++--- doc/doxyfile.in | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4fa9a6c..1b8bd6ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,16 +13,11 @@ endmacro() csfml_set_option(CMAKE_BUILD_TYPE Release STRING "Choose the type of build (Debug or Release)") # project name -project(CSFML) +project(CSFML VERSION 2.5.1) # include the configuration file include(${PROJECT_SOURCE_DIR}/cmake/Config.cmake) -# setup version numbers -set(VERSION_MAJOR 2) -set(VERSION_MINOR 5) -set(VERSION_PATCH 1) - # add the CSFML header path include_directories(${PROJECT_SOURCE_DIR}/include) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 99417676..5f4072e8 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -20,7 +20,7 @@ macro(csfml_add_library target) if(SFML_OS_WINDOWS) # include the major version number in Windows shared library names (but not import library names) set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) - set_target_properties(${target} PROPERTIES SUFFIX "-${VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") + set_target_properties(${target} PROPERTIES SUFFIX "-${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") else() set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) endif() @@ -32,8 +32,8 @@ macro(csfml_add_library target) endif() # set the version and soversion of the target (for compatible systems -- mostly Linuxes) - set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}) - set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + set_target_properties(${target} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) + set_target_properties(${target} PROPERTIES VERSION ${PROJECT_VERSION}) # set the target's folder (for IDEs that support it, e.g. Visual Studio) set_target_properties(${target} PROPERTIES FOLDER "CSFML") diff --git a/doc/doxyfile.in b/doc/doxyfile.in index 1ca19074..f087f201 100644 --- a/doc/doxyfile.in +++ b/doc/doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = CSFML # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ +PROJECT_NUMBER = @PROJECT_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From fdc7b0411809dfa673a3ae3a54131facdb28fcf9 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 25 Jun 2022 11:02:50 -0600 Subject: [PATCH 3/5] Match SFML 2.6.0's CMake version requirement --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b8bd6ad..0acaf521 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.7.2) # define a macro that helps defining an option macro(csfml_set_option var default type docstring) From 08c5e5f81c5163ffb2feaef2aa8a48fb693a344e Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 25 Jun 2022 11:19:23 -0600 Subject: [PATCH 4/5] Remove unused `SFML_MSVC_VERSION` variable --- cmake/Config.cmake | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index bb7cd36c..111e7e32 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -38,26 +38,6 @@ endif() # - GNUCXX can still be set on macOS when using Clang if(MSVC) set(SFML_COMPILER_MSVC 1) - - if(MSVC_VERSION EQUAL 1400) - set(SFML_MSVC_VERSION 8) - elseif(MSVC_VERSION EQUAL 1500) - set(SFML_MSVC_VERSION 9) - elseif(MSVC_VERSION EQUAL 1600) - set(SFML_MSVC_VERSION 10) - elseif(MSVC_VERSION EQUAL 1700) - set(SFML_MSVC_VERSION 11) - elseif(MSVC_VERSION EQUAL 1800) - set(SFML_MSVC_VERSION 12) - elseif(MSVC_VERSION EQUAL 1900) - set(SFML_MSVC_VERSION 14) - elseif(MSVC_VERSION LESS_EQUAL 1919) - set(SFML_MSVC_VERSION 15) - elseif(MSVC_VERSION LESS_EQUAL 1929) - set(SFML_MSVC_VERSION 16) - elseif(MSVC_VERSION LESS_EQUAL 1939) - set(SFML_MSVC_VERSION 17) - endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(SFML_COMPILER_CLANG 1) From 0582a5dc7ad82878e4bdfce99414d729e0efff35 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 25 Jun 2022 11:36:40 -0600 Subject: [PATCH 5/5] Require at least SFML 2.5.0 --- src/SFML/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt index ee93719c..bac6724b 100644 --- a/src/SFML/CMakeLists.txt +++ b/src/SFML/CMakeLists.txt @@ -21,7 +21,7 @@ if(CSFML_LINK_SFML_STATICALLY) set(SFML_STATIC_LIBRARIES TRUE) add_definitions(-DSFML_STATIC) endif() -find_package(SFML 2 COMPONENTS network graphics audio REQUIRED) +find_package(SFML 2.5 COMPONENTS network graphics audio REQUIRED) # add the modules subdirectories add_subdirectory(System)