Skip to content

Commit 1292601

Browse files
authored
Configure cmake to generate debian packages (#66)
* CPack package name depend debian package name * Add a variable to set the package suffix
1 parent cf82bb2 commit 1292601

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ option(GF_BUILD_DOCUMENTATION "Build documentation (needs Doxygen)" ON)
2626
option(GF_BUILD_GAMES "Build games" OFF)
2727
option(GF_USE_EMBEDDED_LIBS "Build the library with the submodule libraries" ON)
2828

29+
set(GF_PACKAGE_SUFFIX "~${CMAKE_SYSTEM_NAME}" CACHE STRING "CPack package suffix")
30+
2931
if(UNIX)
3032
option(GF_DEV_ENABLE_ASAN "Enable Address Sanitizer" OFF)
3133
endif()
@@ -105,9 +107,9 @@ install(
105107
)
106108

107109
if (UNIX AND NOT APPLE)
108-
set(CPACK_PACKAGE_FILE_NAME "gf-dev-${CMAKE_PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}")
109-
string(TOLOWER "${CPACK_PACKAGE_FILE_NAME}" CPACK_PACKAGE_FILE_NAME)
110110
set(CPACK_DEBIAN_PACKAGE_NAME "gf-dev")
111+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}-${CMAKE_PROJECT_VERSION}-${GF_PACKAGE_SUFFIX}")
112+
string(TOLOWER "${CPACK_PACKAGE_FILE_NAME}" CPACK_PACKAGE_FILE_NAME)
111113
set(CPACK_GENERATOR "DEB")
112114
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-dev,libboost-dev,libfreetype6-dev,zlib1g-dev,libpugixml-dev")
113115
set(CPACK_PACKAGE_DESCRIPTION "Gamedev Framework (gf) is a framework to build 2D games in C++17. It is based on SDL and OpenGL ES 2.0, and presents an API that is very similar to the graphics module of SFML with additional features.")

0 commit comments

Comments
 (0)