[CMake] still having a problem with PackageMaker, and now DEB

David Cole david.cole at kitware.com
Fri Aug 6 16:52:29 EDT 2010


You need a CPackOptions file (CPACK_PROJECT_CONFIG_FILE) that gets loaded at
CPack time.....

In CMake, ours has this at the bottom of it:

if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
  if(CMAKE_PACKAGE_QTGUI)
    set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
  else(CMAKE_PACKAGE_QTGUI)
    set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
  endif(CMAKE_PACKAGE_QTGUI)
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")

To use one, set one up (either hand written or configured), something like
this:
  CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
    "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
  SET(CPACK_PROJECT_CONFIG_FILE
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")


See CMake's "CMakeCPack.cmake" and "CMakeCPackOptions.cmake.in" files in the
top level directory for more CPack magic than you'll be able to absorb on a
Friday afternoon.... :-)


HTH,
David


On Fri, Aug 6, 2010 at 4:45 PM, Chris Wolf <cw10025 at gmail.com> wrote:

> Earlier, I identified a problem with the "PackageMaker" (Apple) packager,
> and now, I see the same exact problem with the "DEB" (Debian)
> packager - it keeps prefixing "./usr" to all the paths.
>
> Changing CPACK_PACKAGING_INSTALL_PREFIX doesn't do anything
> (even when it's at the top of the file)
>
> This problem does not occur with packagers of type "DragNDrop",
> "TGZ" and "TBZ2" - these are Ok.
>
> Any help would be great, thanks...
>
>  -Chris
>
> > Another observation regarding the CPack-generated *.pkg
> > >> (wrapped in a *.dmg) :
> > >>
> > >> The path is prefixed by "./usr", somehow:
> > >>
> > >> (assuming the *.dmg is already mounted)
> > >> $ cd ./libusb-0.1.1-Darwin.pkg/Contents
> > >> $ lsbom -s Archive.bom
> > >> .
> > >> ./usr
> > >> ./usr/lib
> > >> ./usr/lib/libusb.dylib
> > >>
> > >> So where does the "./usr/" prefix come from?
> >
> > I'm do not know the dmg CPack Generator
> > (is it PackageMaker or DragNDrop?)
> >  and I'm not a mac user but each CPack generator has a default
> > "builtin" CPACK_PACKAGING_INSTALL_PREFIX.
> >
> > Try
> > set(CPACK_PACKAGING_INSTALL_PREFIX. "/whatever")
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100806/224bac28/attachment.htm>


More information about the CMake mailing list