[CMake] Prompting Users in Build...

Benjamen R. Meyer bm_witness at yahoo.com
Sun Feb 24 21:54:30 EST 2008


So I started looking at how to implement the below functions using
CMake's scripting abilities. However, I was having trouble figuring out
how to prompt the user for the username/password during the build
process. I tried using a TRY_RUN() to build a program to do so, but that
doesn't seem to do it either, and I couldn't find anything else that
would seem like it should do the trick either. Is there such a function?
If no, could one be added??? (I'm sure there would be other uses too -
though I was mainly looking for something where I could provide a basic
prompt, and get a string value back.)

Any how...any tips would be great.

Ben

Re: [CMake] Add multiple directories
====================================
// Put the files in the build directory
SET(CheckoutPath ${<projectname>_BINARY_DIR}/rcs_deps)

// Generic RCS tool
RCS_CHECKOUT(RCS, /path/to/repository, 1384, ${CheckoutPath})
// SVN minimal
RCS_CHECKOUT(SVN, https://url.to.repository, r1384, ${CheckoutPath})
// CVS minimal
RCS_CHECKOUT(CVS, https://url.to.repository, 1384, ${CheckoutPath})
// SVN with user name and password prompt
RCS_CHECKOUT(SVN, https://url.to.repository, r1384, ${CheckoutPath},
RCS_USERNAME_AND_PASSWORD_PROMPT)
// CVS with user name and password prompt
RCS_CHECKOUT(CVS, https://url.to.repository, 1384, ${CheckoutPath},
RCS_USERNAME_AND_PASSWORD_PROMPT)
// SVN with anonymous user
RCS_CHECKOUT(SVN, https://url.to.repository, r1384, ${CheckoutPath},
RCS_USE_ANONYMOUS_USER)

Perhaps even allow for some macros of the RCS tool:

// Retrieve the revision from the svn:external property list at the
given path.
RCS_CHECKOUT(SVN, https://url.to.repository, SVN_EXTERNAL_PROP_GET(PATH,
DEPENDANCY_REVISION), ${CheckoutPath})



More information about the CMake mailing list