Use built-in project version variables

This commit is contained in:
Chris Thrasher authored and Lukas Dürrenberger committed 2023-02-21 00:00:23 +01:00
1 parent 356eeb3ae6
commit fbf4b000ef
3 files changed
+5 -10

No files matched your search

+1 -6
View File
@@ -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)
+3 -3
View File
@@ -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")
+1 -1
View File
@@ -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