Updating build and packaging config.

This commit is contained in:
Kyle Isom 2023-10-11 16:27:03 -07:00
parent 70ceadb880
commit eb9b491bc7
2 changed files with 39 additions and 20 deletions

View File

@ -6,6 +6,8 @@ project(kge
VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_VERBOSE_MAKEFILES TRUE)
set(VERBOSE YES)
string(TIMESTAMP TODAY "%Y%m%d")
@ -67,6 +69,7 @@ if(${BUILD_GUI})
configure_file(resources/kge.desktop.in kge.desktop @ONLY)
add_executable(kge gmain.cc ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(kge imgui)
add_dependencies(kge ke)
configure_file(docs/kge.md kge.1.scdoc @ONLY)
add_custom_command(TARGET manpages COMMAND scdoc < kge.1.scdoc > kge.1
@ -87,25 +90,20 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ke.1
COMPONENT nox)
if(${BUILD_GUI})
install(TARGETS ke
DESTINATION bin
COMPONENT dist)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ke.1
DESTINATION share/man/man1
COMPONENT dist)
install(TARGETS kge
DESTINATION bin
COMPONENT nox
COMPONENT dist)
COMPONENT gui)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kge.desktop
DESTINATION share/applications
COMPONENT dist)
COMPONENT gui)
install(FILES resources/kge.png
DESTINATION share/${PROJECT_NAME}
COMPONENT dist)
COMPONENT gui)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kge.1
DESTINATION share/man/man1
COMPONENT dist)
COMPONENT gui)
endif()
include(cmake/packaging.cmake)

View File

@ -1,25 +1,45 @@
# Packaging support
include(InstallRequiredSystemLibraries)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
endif()
set(CPACK_PACKAGE_VENDOR "Shimmering Clarity")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "kyle's editor")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# Debian settings
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "K. Isom")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "kyle's editor")
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
###################
### DEBIANESQUE ###
###################
if(${BUILD_GUI})
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"libsdl2-2.0-0, libfreetype6 (>= 2.11.1)"
)
set(CPACK_COMPONENTS_ALL gui nox)
else()
set(CPACK_COMPONENTS_ALL nox)
endif()
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION universe/editors)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL dist nox)
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "K. Isom")
set(CPACK_PACKAGE_nox_DESCRIPTION_SUMMARY "kyle's editor")
set(CPACK_PACKAGE_nox_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_PACKAGE_nox_PACKAGE_NAME "kge")
set(CPACK_DEBIAN_nox_PACKAGE_NAME "ke")
if(BUILD_GUI)
set(CPACK_PACKAGE_gui_PACKAGE_NAME "kge")
set(CPACK_DEBIAN_gui_PACKAGE_NAME "kge")
set(CPACK_PACKAGE_gui_DESCRIPTION_SUMMARY " graphical front-end for kyle's editor")
set(CPACK_PACKAGE_gui_DESCRIPTION "graphical front-end for ${CPACK_PACKAGE_DESCRIPTION} ")
endif()
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
if(LINUX)
set(CPACK_GENERATOR "DEB;STGZ;TGZ")
@ -39,3 +59,4 @@ set(CPACK_SOURCE_IGNORE_FILES
/.*build.*)
include(CPack)
cpack_add_component(gui DEPENDS nox)