Skip to content

Commit

Permalink
make package AND make install
Browse files Browse the repository at this point in the history
Ref: #14
Ref: #15
  • Loading branch information
Zeek Oni committed Jul 7, 2020
1 parent f057510 commit 2d86e52
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if ( CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES )
list(APPEND CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES "cudart")
endif()


# ---------------------------------------------------------------------------- #
# All C++ compilation options for all programs.
# ---------------------------------------------------------------------------- #
Expand All @@ -39,6 +38,8 @@ else()
)
endif()

include(deb.cmakelists)

# ---------------------------------------------------------------------------- #
# Build in this order:
# - Library
Expand Down
30 changes: 30 additions & 0 deletions deb.cmakelists
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)

set(CPACK_COMPONENTS_ALL cmm cmmdev)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "cjhanks")

set(CPACK_INSTALL_PREFIX /usr)
set(CPACK_DESCRIPTION "")
set(CPACK_DESCRIPTION_SUMMARY "")
set(CPACK_PACKAGE_VENDOR "noone")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VERSION_MAJOR 0) #
set(CPACK_PACKAGE_VERSION_MINOR 0) # FIXME <<<
set(CPACK_PACKAGE_VERSION_PATCH 0) #
set(CPACK_PACKAGE_VERSION_FULL "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
set(CPACK_DEBIAN_ARCHITECTURE amd64)
else()
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
endif()

set(CPACK_DEBIAN_CMM_PACKAGE_DEPENDS
"libcudart10.1 ( >= 10.1.243-3 )")

set(CPACK_DEBIAN_CMMDEV_PACKAGE_DEPENDS
"cmm ( = ${CPACK_PACKAGE_VERSION_FULL} )")

include(CPack REQUIRED)
9 changes: 9 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ file(GLOB_RECURSE SOURCES_CU *.cu)
file(GLOB_RECURSE SOURCES_HH *.hh)

add_library(cmm SHARED ${SOURCES_CC} ${SOURCES_CU} ${SOURCES_HH})

install(TARGETS cmm
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
COMPONENT cmm)

install(DIRECTORY ./cmm
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
COMPONENT cmmdev
FILES_MATCHING PATTERN "*.hh")

0 comments on commit 2d86e52

Please sign in to comment.