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

View File

@ -1,25 +1,45 @@
# Packaging support # Packaging support
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
endif()
set(CPACK_PACKAGE_VENDOR "Shimmering Clarity") set(CPACK_PACKAGE_VENDOR "Shimmering Clarity")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "kyle's editor") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "kyle's editor")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# Debian settings ###################
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "K. Isom") ### DEBIANESQUE ###
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "kyle's editor") ###################
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
if(${BUILD_GUI}) if(${BUILD_GUI})
set(CPACK_DEBIAN_PACKAGE_DEPENDS set(CPACK_COMPONENTS_ALL gui nox)
"libsdl2-2.0-0, libfreetype6 (>= 2.11.1)" else()
) set(CPACK_COMPONENTS_ALL nox)
endif() endif()
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION universe/editors) set(CPACK_DEBIAN_PACKAGE_SECTION universe/editors)
set(CPACK_DEB_COMPONENT_INSTALL ON) 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) if(LINUX)
set(CPACK_GENERATOR "DEB;STGZ;TGZ") set(CPACK_GENERATOR "DEB;STGZ;TGZ")
@ -31,7 +51,7 @@ else()
set(CPACK_GENERATOR "ZIP") set(CPACK_GENERATOR "ZIP")
endif() endif()
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") set(CPACK_SOURCE_GENERATOR "TGZ;ZIP ")
set(CPACK_SOURCE_IGNORE_FILES set(CPACK_SOURCE_IGNORE_FILES
/.git /.git
/.idea /.idea
@ -39,3 +59,4 @@ set(CPACK_SOURCE_IGNORE_FILES
/.*build.*) /.*build.*)
include(CPack) include(CPack)
cpack_add_component(gui DEPENDS nox)