[CMake] "light" RPM CMake macro support based on cpack

Eric Noulard eric.noulard at gmail.com
Wed Feb 28 15:40:36 EST 2007


Hi All,

We (TSP developers) have done a CMake macro
which helps in building RPM package.
You'll find the CMake macro file attached.

The usage is simple:
1) put the macro file in your CMAKE_MODULE_PATH
2) 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 generate 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)


This is a preliminary version but it should work as expected.


-- 
Erk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UseRPMTools.cmake
Type: application/octet-stream
Size: 4027 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070228/2a168bf5/UseRPMTools-0001.obj


More information about the CMake mailing list