Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Clean up build system in preparation of SFML 2.6.0 and 3.0.0 releases #172

Merged
merged 5 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)

Expand Down
20 changes: 0 additions & 20 deletions cmake/Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions cmake/Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion doc/doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down