-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): use TGZ packaging as fallback
- Loading branch information
1 parent
94e150a
commit 31a8457
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}") | ||
|
@@ -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}") | ||
|