[CMake] How to find GetPrerequisites.cmake ?

David Cole david.cole at kitware.com
Wed Nov 5 14:42:14 EST 2008


It is actively used in CVS HEAD of ParaView on the Mac to build the
standalone paraview client .app bundle.
Probably not as easy to understand as you'd like, but it works.

This snippet is from the very bottom of ParaView's
Applications/Client/CMakeLists.txt file. It's an install rule that runs the
configured scripts. (The usage of GetPrerequisites is internal to
BundleUtilities which is included in the configured cmake script...)

# Call this last so the install script runs after the above targets are
installed:
#
IF(Q_WS_MAC)
  SET(OSX_MAKE_STANDALONE_BUNDLE_CMAKE_SCRIPT
"${ParaView_BINARY_DIR}/${PV_EXE_NAME}_OSX_MakeStandAloneBundle.cmake")
  SET(OSX_MAKE_STANDALONE_BUNDLE_BASH_SCRIPT
"${ParaView_BINARY_DIR}/${PV_EXE_NAME}_OSX_MakeStandAloneBundle.sh")

  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CompleteBundle.cmake.in"
    "${OSX_MAKE_STANDALONE_BUNDLE_CMAKE_SCRIPT}" @ONLY IMMEDIATE)
  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CreateBundle.sh.in"
    "${OSX_MAKE_STANDALONE_BUNDLE_BASH_SCRIPT}" @ONLY IMMEDIATE)

  INSTALL(SCRIPT "${OSX_MAKE_STANDALONE_BUNDLE_CMAKE_SCRIPT}")
ENDIF(Q_WS_MAC)


HTH,
David


On Wed, Nov 5, 2008 at 12:19 PM, Stephen Collyer
<scollyer at netspinner.co.uk>wrote:

> David Cole wrote:
> > This line:INSTALL(SCRIPT "${CMAKE_MODULE_PATH}/GetPrerequisites.cmake")
> >
> > doesn't really do anything at "make install" time.
> >
> > GetPrerequisites.cmake just defines a bunch of functions. You have to
> > include it and then *call* some of the functions for it to do anything
> > useful.
> >
> > So, you should write your own cmake script that gets called at "make
> > install" time and then include GetPrerequisites.cmake and call some of
> the
> > functions in it... presumably to install other prerequisite libraries as
> > well.
> >
> > Does that make sense?
>
> Yes, thanks. I must admit I wasn't sure how GetPrerequisites is used,
> and I haven't yet had time to look into further. I had cut-n-pasted
> that line from something that Bill Hoffman posted once in the
> pious hope that it would magically do all the work for me somehow.
>
> Are there any examples available that show real life usage
> of this module ?
>
> --
> Regards
>
> Steve Collyer
> Netspinner Ltd
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081105/f4549aa5/attachment.htm>


More information about the CMake mailing list