CMakeUserUseDebian: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 28: Line 28:


This CMake macro was inspired from UseRPMTools.
This CMake macro was inspired from UseRPMTools.
== Reference ==
* http://public.kitware.com/pipermail/cmake/2007-April/013650.html
* http://gdcm.svn.sourceforge.net/viewvc/gdcm/CMake/


[[CMake_User_Contributed_Macros|Back]]
[[CMake_User_Contributed_Macros|Back]]

Revision as of 11:59, 19 June 2007

Back

Description

The UseDebian CMake module simplifies the Debian package generation using both CPack and CMake. It has been done because CPack does not have an deb generator. This CMake macro can be used anywhere ar is available (no debian specific tool are required).

Usage

The usage is simple:

  • put the macro file "UseDebian.cmake" in your CMAKE_MODULE_PATH, as well as FindMd5sum.cmake (until cmake -E can do md5sum).
  • Then add something like this to your CMakeLists.txt
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Grass Root DiCoM")
  SET(CPACK_PACKAGE_VENDOR "gdcm")
  SET(CPACK_PACKAGE_VERSION_MAJOR "${GDCM_VERSION_MAJOR}")
  SET(CPACK_PACKAGE_VERSION_MINOR "${GDCM_VERSION_MINOR}")
  SET(CPACK_PACKAGE_VERSION_PATCH "${GDCM_VERSION_BUILD}")
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "gdcm ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "gdcm-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  # List executables
  INCLUDE(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
INCLUDE(UseDebian)
ADD_DEBIAN_TARGETS()

This CMake macro was inspired from UseRPMTools.

Reference

Back