CMakeUserUseRPMTools: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: ==Description== The '''UseRPMTools''' CMake module simplify RPM package generation using both CPack and CMake. The usage is simple: * put the macro file "[[Media:UseRPMTools.cmake|UseRPMT...)
 
No edit summary
Line 1: Line 1:
[[CMake_User_Contributed_Macros|Back]]
==Description==
==Description==
The '''UseRPMTools''' CMake module simplify RPM package generation
The '''UseRPMTools''' CMake module simplify RPM package generation
Line 29: Line 31:


   RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec.in)
   RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec.in)
[[CMake_User_Contributed_Macros|Back]]

Revision as of 20:23, 14 June 2007

Back

Description

The UseRPMTools CMake module simplify RPM package generation using both CPack and CMake.

The usage is simple:

  • put the macro file "UseRPMTools.cmake" in your CMAKE_MODULE_PATH
  • Then add something like this to your CMakeLists.txt
  INCLUDE(CPack)
  INCLUDE(UseRPMTools)
     IF(RPMTools_FOUND)
     RPMTools_ADD_RPM_TARGETS(packagename)
  ENDIF(RPMTools_FOUND)

then you inherit 2 new top-level targets named

  • packagename_rpm
  • packagename_srpm

you may call to build RPM or Source RPM.

The macro generates a MINIMAL spec file, but if you want to tailor you own spec file you may provide one to the macro:

  RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec)

You will get the same target but using your custom spec files.

If your custom spec file need to be CONFIGUREd then name it with .in extension and the macro will process the file accordingly.

  RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec.in)

Back