Skip to content

Commit e900aa9

Browse files
Add debian packaging for CMake
1 parent e58dad8 commit e900aa9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,5 @@ option(WITH_JBMC "Build the JBMC Java front-end" ON)
213213
if(WITH_JBMC)
214214
add_subdirectory(jbmc)
215215
endif()
216+
217+
include(cmake/packaging.cmake)

cmake/packaging.cmake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set(CPACK_PACKAGE_NAME "cbmc")
2+
set(CPACK_PACKAGE_VENDOR "Diffblue Ltd.")
3+
set(CPACK_PACKAGE_CONTACT "[email protected]")
4+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CBMC is a Bounded Model Checker for C and C++ programs")
5+
set(CPACK_PACKAGE_DESCRIPTION
6+
"CBMC generates traces that demonstrate how an assertion can be violated,
7+
or proves that the assertion cannot be violated within a given number
8+
of loop iterations.")
9+
10+
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
11+
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
12+
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
13+
14+
# This should always be set, just isn’t by default for awkward backward compatibility reasons
15+
set(CPACK_VERBATIM_VARIABLES YES)
16+
17+
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
18+
set(CPACK_PACKAGE_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
19+
20+
# Automatically find dependencies for shared libraries
21+
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS YES)
22+
23+
# In addition, we depend on gcc for preprocessing
24+
set(CPACK_DEBIAN_PACKAGE_DEPENDS gcc)
25+
26+
# TODO packages for other platforms
27+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
28+
set(CPACK_GENERATOR TGZ DEB)
29+
endif()
30+
31+
# Yes, this has to go at the bottom,
32+
# otherwise it can’t take into account
33+
# all the variables we set above!
34+
include(CPack)

0 commit comments

Comments
 (0)