Skip to content

Commit

Permalink
feat(build): use TGZ packaging as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
martinspinler committed Dec 17, 2024
1 parent 94e150a commit 31a8457
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Main")

#check_function_exists(cmake_host_system_information HAVE_HSI)
#cmake_host_system_information(RESULT DISTRIB_ID_LIKE QUERY DISTRIB_ID_LIKE)

set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/")

if (EXISTS "/etc/debian_version")
set(PLATFORM "Debian")
set(CPACK_GENERATOR "DEB" )
elseif (EXISTS "/etc/centos-release" OR EXISTS "/etc/sl-release" OR EXISTS "/etc/redhat-release")
set(PLATFORM "Centos")
set(CPACK_GENERATOR "RPM")
else ()
message(WARNING "Failed to determine platform, cannot build package")
set(CPACK_GENERATOR "Invalid" )
message(WARNING "Failed to determine platform, using TGZ for packaging")
set(CPACK_GENERATOR "TGZ")
set(CPACK_ARCHIVE_COMPONENT_INSTALL 1)

set(CPACK_SET_DESTDIR "ON")
unset(CPACK_PACKAGING_INSTALL_PREFIX)
endif ()

set(PACKAGE_NAME "${PROJECT_NAME}")
Expand Down Expand Up @@ -80,8 +87,6 @@ set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_RELOCATABLE OFF)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_LIST_DIR}/package/description.txt")

set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/")

# RPM (CentOS) package settings
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_Main_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
Expand Down

0 comments on commit 31a8457

Please sign in to comment.