Skip to content

Commit 73b99b2

Browse files
authored
Merge pull request #512 from Jordan08/dev-clean-v2-40
Add the DEB CPack generator only when dpkg-deb is available
2 parents 067602a + 0b535ad commit 73b99b2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎CMakeLists.txt‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,15 @@
217217
# Archives and packages
218218
################################################################################
219219

220-
set(CPACK_GENERATOR "TGZ" "ZIP" "DEB")
220+
set(CPACK_GENERATOR "TGZ" "ZIP")
221+
# The DEB generator shells out to dpkg-deb, which only exists on
222+
# Debian-based systems -- adding it unconditionally would make `cpack`/
223+
# `make package` fail on Windows, macOS, and non-Debian Linux, even
224+
# though nothing else in the build depends on it.
225+
find_program(DPKG_DEB_EXECUTABLE dpkg-deb)
226+
if(DPKG_DEB_EXECUTABLE)
227+
list(APPEND CPACK_GENERATOR "DEB")
228+
endif()
221229
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
222230
set(CPACK_PACKAGE_VENDOR "Codac Team")
223231
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CODAC_DESCRIPTION})

0 commit comments

Comments
 (0)