Skip to content

Commit

Permalink
fix source package generation
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Oct 27, 2023
1 parent 1ab9584 commit ab7edc8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,6 @@ add_subdirectory(examples)
# Generate Packages
#

# These variables have to be set before include(CPack)
set(CPACK_PACKAGE_VERSION_MAJOR ${GUFI_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${GUFI_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${GUFI_VERSION_PATCH})

# Generate RPMs
find_program(RPMBUILD rpmbuild)
if (RPMBUILD)
Expand All @@ -476,6 +471,11 @@ if (RPMBUILD)
# assumes that we are not cross compiling
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)

# These variables have to be set before include(CPack)
set(CPACK_PACKAGE_VERSION_MAJOR ${GUFI_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${GUFI_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${GUFI_VERSION_PATCH})

set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_COMPONENT_INSTALL On)
set(CPACK_RPM_FILE_NAME "gufi-${GUFI_VERSION}.${ARCH}.rpm")
Expand All @@ -501,8 +501,8 @@ if (RPMBUILD)
endif()

# Generate source RPM
set(CPACK_SOURCE_GENERATOR "RPM")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/.git/" "${CMAKE_SOURCE_DIR}/.gitignore")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "gufi-${GUFI_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}/" "${CMAKE_SOURCE_DIR}/.git/" "${CMAKE_SOURCE_DIR}/.github/" "${CMAKE_SOURCE_DIR}/.gitignore")

include(CPack)
else()
Expand Down

0 comments on commit ab7edc8

Please sign in to comment.