Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Naram Qashat

On 02/28/10 11:52, Eric Noulard wrote:

2010/2/28 Bill Hoffman:




Off course the cmake UI would authorize to unfilter all vars
just as today there is the advanced/normal view.


You could just use the advanced/non-advanced to handle this. When you want
to show a variable to the user make it non-advanced.  This would work with
ccmake, cmake -i, and cmake-gui.  They all default to showing non-advanced
variables by default.


As far as I understand Naram needs he wants to show far less variable
shown by cmake today (including vars coming from find_package(whatever))

Not mentionning the fact that mark_as_advanced makes the variable a CACHE
one which is not necesseraly what you want. You may even want to have a CACHED
variable shown to the user.

Basically I think you (Bill) are right the current "advanced" var
should be enough
but I doubt it correspond to Naram needs. I may be wrong, thus let Naram explain
himself :-)


Well, using cmake -i might work for me, but I'm not sure if the format it shows 
the information in would be any less confusing to our users.  It'd be nice if 
CMake didn't have to show the variable name and could just show the description. 
 The people using our program are not the brightest bunch of people around, and 
I wish I was exaggerating this.  Right now we rely on a separate shell script 
(and a CScript file for Windows) to pre-configure in order to get information 
from the users in order to configure through CMake, but as I mentioned in my 
first e-mail, this won't help if we have a variable amount of files that I want 
to ask for prompting from the users on.


Now, a side thought I had, could I create a CMake file that can be run through 
cmake -P in order to determine any options I might need, and pass that as output 
that our pre-configure script can handle from there?  This might be an option if 
I can't handle this through CMake entirely.


Thanks,
Naram Qashat
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Eric Noulard
2010/2/28 Bill Hoffman :
>
>>
>> Off course the cmake UI would authorize to unfilter all vars
>> just as today there is the advanced/normal view.
>
> You could just use the advanced/non-advanced to handle this. When you want
> to show a variable to the user make it non-advanced.  This would work with
> ccmake, cmake -i, and cmake-gui.  They all default to showing non-advanced
> variables by default.

As far as I understand Naram needs he wants to show far less variable
shown by cmake today (including vars coming from find_package(whatever))

Not mentionning the fact that mark_as_advanced makes the variable a CACHE
one which is not necesseraly what you want. You may even want to have a CACHED
variable shown to the user.

Basically I think you (Bill) are right the current "advanced" var
should be enough
but I doubt it correspond to Naram needs. I may be wrong, thus let Naram explain
himself :-)
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Bill Hoffman

Matt Williams wrote:

On 28 February 2010 14:39, Bill Hoffman  wrote:

Off course the cmake UI would authorize to unfilter all vars
just as today there is the advanced/normal view.

You could just use the advanced/non-advanced to handle this. When you want
to show a variable to the user make it non-advanced.  This would work with
ccmake, cmake -i, and cmake-gui.  They all default to showing non-advanced
variables by default.


Except that DART_TESTING_TIMEOUT is for some reason set to
non-advanced (http://www.itk.org/Bug/view.php?id=10150) and so it will
show up in the list. Apart from that, I've found that this works very
well.

You can fix that in your project by marking it advanced yourself. 
mark_as_advanced(DART_TESTING_TIMEOUT) should do the trick, and time 
after you include ctest.


-Bill

___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Matt Williams
On 28 February 2010 14:39, Bill Hoffman  wrote:
>> Off course the cmake UI would authorize to unfilter all vars
>> just as today there is the advanced/normal view.
>
> You could just use the advanced/non-advanced to handle this. When you want
> to show a variable to the user make it non-advanced.  This would work with
> ccmake, cmake -i, and cmake-gui.  They all default to showing non-advanced
> variables by default.

Except that DART_TESTING_TIMEOUT is for some reason set to
non-advanced (http://www.itk.org/Bug/view.php?id=10150) and so it will
show up in the list. Apart from that, I've found that this works very
well.

-- 
Matt Williams
http://milliams.com
___
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

Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Bill Hoffman




Off course the cmake UI would authorize to unfilter all vars
just as today there is the advanced/normal view.


You could just use the advanced/non-advanced to handle this. When you 
want to show a variable to the user make it non-advanced.  This would 
work with ccmake, cmake -i, and cmake-gui.  They all default to showing 
non-advanced variables by default.


-Bill


___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-28 Thread Eric Noulard
2010/2/28 Naram Qashat :
>> Now since there is a "Grouped View" based on var name in CMake gui
>> you should be able to emulate what you want using
>> "conditionnal" option + cmake gui + grouped view.
>
> Most of our users are compiling our program under *nix and will not be using
> a GUI, which is why I was looking for a prompting solution instead.

OK I see.

> The suggestion in another part of this thread about using cmake -i won't just 
> it
> due to the number of options that come up that would be confusing to users.

Did you try ccmake ? (The "TUI" curse interface)
It should work on any text terminal and shows OPTION/VARS in alphabetical order
such that if you name your options beginning with "0_User_x"
they should come up first in the menu.

Then there is no "prompt" but the user can toggle ON/OFF option easily
and give appropriate value for other needed-to-be defined vars.

ccmake require the user to hit 'c' (configure) as many time as needed
before he can hit 'g' for generating the underlying build files.

Off course ccmake authorize the user to change other var/option
but on the contrary of cmake -i he won't be prompt to do it.

Note that your need makes me think of a may-be nice feature request
that would be to be able to 'tag' variables/option in order to be able to select
what should be shown/asked to the user.

aka something like a meta information about a variable,
currently there is one meta-info which CACHE which is
controlled by set and/or mark_as_advanced.

We may imagine a USER meta-info or even a list of "tag"
which may be used by cmake -i/ccmake/cmake-gui
in order to filter out unwanted var.

For example adding a:

tag_as(TAG  VAR VAR2 VAR...)
would be used to tag a list of var

and
show_only()

may indicate cmake tools to only show the vars
corresponding to te tag list.

Off course the cmake UI would authorize to unfilter all vars
just as today there is the advanced/normal view.
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Naram Qashat

On 02/27/10 17:17, Eric Noulard wrote:

2010/2/27 Naram Qashat:

On 02/27/10 12:53, John Drescher wrote:


On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat
  wrote:


I'm wondering if it's possible for CMake to prompt the user for input
when
it's running, as opposed to relying on passing in arguments for input.
  Main
reason I'm looking for something like this is so we can have optional
files
that can be enabled or disabled by the user when CMake is run.  Ideally
this
should be able to be done if a certain command-line flag is passed in.



Minus the prompting isn't that what options are for in cmake? I
believe you can set them either via the gui or by the command line /
shell.

John


The problem is that the number of options wouldn't be static because the
number of files that will be optional will change over time.  Which is why I
was wondering if there was a way to have CMake prompt while it runs.  I'd
rather avoid having an external script searching for the optional files when
CMake would already be doing that.


When running CMake you can have some CMakeLists.txt doing:

IF(WHATEVER)
OPTION(OPT1 OFF)
IF (OPT1)
OPTON(OPT12 ON)
ENDIF(OPT1)
ENDIF(WHATEVER)

when doing such cascaded option dependent on IF the OPTIONs
do show up in CMake gui once you check them and push "configure"
again.

Now since there is a "Grouped View" based on var name in CMake gui
you should be able to emulate what you want using
"conditionnal" option + cmake gui + grouped view.


Most of our users are compiling our program under *nix and will not be using a 
GUI, which is why I was looking for a prompting solution instead.  The 
suggestion in another part of this thread about using cmake -i won't just it due 
to the number of options that come up that would be confusing to users.


Thanks,
Naram Qashat
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Eric Noulard
2010/2/27 Naram Qashat :
> On 02/27/10 12:53, John Drescher wrote:
>>
>> On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat
>>  wrote:
>>>
>>> I'm wondering if it's possible for CMake to prompt the user for input
>>> when
>>> it's running, as opposed to relying on passing in arguments for input.
>>>  Main
>>> reason I'm looking for something like this is so we can have optional
>>> files
>>> that can be enabled or disabled by the user when CMake is run.  Ideally
>>> this
>>> should be able to be done if a certain command-line flag is passed in.
>>>
>>
>> Minus the prompting isn't that what options are for in cmake? I
>> believe you can set them either via the gui or by the command line /
>> shell.
>>
>> John
>
> The problem is that the number of options wouldn't be static because the
> number of files that will be optional will change over time.  Which is why I
> was wondering if there was a way to have CMake prompt while it runs.  I'd
> rather avoid having an external script searching for the optional files when
> CMake would already be doing that.

When running CMake you can have some CMakeLists.txt doing:

IF(WHATEVER)
   OPTION(OPT1 OFF)
   IF (OPT1)
   OPTON(OPT12 ON)
   ENDIF(OPT1)
ENDIF(WHATEVER)

when doing such cascaded option dependent on IF the OPTIONs
do show up in CMake gui once you check them and push "configure"
again.

Now since there is a "Grouped View" based on var name in CMake gui
you should be able to emulate what you want using
"conditionnal" option + cmake gui + grouped view.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Naram Qashat

On 02/27/10 13:24, Matt Williams wrote:

On 27 February 2010 18:12, Naram Qashat  wrote:

On 02/27/10 12:53, John Drescher wrote:


On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat
  wrote:


I'm wondering if it's possible for CMake to prompt the user for input
when
it's running, as opposed to relying on passing in arguments for input.
  Main
reason I'm looking for something like this is so we can have optional
files
that can be enabled or disabled by the user when CMake is run.  Ideally
this
should be able to be done if a certain command-line flag is passed in.



Minus the prompting isn't that what options are for in cmake? I
believe you can set them either via the gui or by the command line /
shell.

John


The problem is that the number of options wouldn't be static because the
number of files that will be optional will change over time.  Which is why I
was wondering if there was a way to have CMake prompt while it runs.  I'd
rather avoid having an external script searching for the optional files when
CMake would already be doing that.


'cmake -i' does something similar to that. I'm not sure if it's
exactly what you want though?


That's only partially helpful.  I say partially because it also shows a few 
CMake specific options, and it shows all the variables from find_library's 
usage, which would overwhelm the users.


Thanks,
Naram Qashat
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Matt Williams
On 27 February 2010 18:12, Naram Qashat  wrote:
> On 02/27/10 12:53, John Drescher wrote:
>>
>> On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat
>>  wrote:
>>>
>>> I'm wondering if it's possible for CMake to prompt the user for input
>>> when
>>> it's running, as opposed to relying on passing in arguments for input.
>>>  Main
>>> reason I'm looking for something like this is so we can have optional
>>> files
>>> that can be enabled or disabled by the user when CMake is run.  Ideally
>>> this
>>> should be able to be done if a certain command-line flag is passed in.
>>>
>>
>> Minus the prompting isn't that what options are for in cmake? I
>> believe you can set them either via the gui or by the command line /
>> shell.
>>
>> John
>
> The problem is that the number of options wouldn't be static because the
> number of files that will be optional will change over time.  Which is why I
> was wondering if there was a way to have CMake prompt while it runs.  I'd
> rather avoid having an external script searching for the optional files when
> CMake would already be doing that.

'cmake -i' does something similar to that. I'm not sure if it's
exactly what you want though?

-- 
Matt Williams
http://milliams.com
___
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

Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Naram Qashat

On 02/27/10 12:53, John Drescher wrote:

On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat  wrote:

I'm wondering if it's possible for CMake to prompt the user for input when
it's running, as opposed to relying on passing in arguments for input.  Main
reason I'm looking for something like this is so we can have optional files
that can be enabled or disabled by the user when CMake is run.  Ideally this
should be able to be done if a certain command-line flag is passed in.



Minus the prompting isn't that what options are for in cmake? I
believe you can set them either via the gui or by the command line /
shell.

John


The problem is that the number of options wouldn't be static because the number 
of files that will be optional will change over time.  Which is why I was 
wondering if there was a way to have CMake prompt while it runs.  I'd rather 
avoid having an external script searching for the optional files when CMake 
would already be doing that.


Thanks,
Naram Qashat
___
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


Re: [CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread John Drescher
On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat  wrote:
> I'm wondering if it's possible for CMake to prompt the user for input when
> it's running, as opposed to relying on passing in arguments for input.  Main
> reason I'm looking for something like this is so we can have optional files
> that can be enabled or disabled by the user when CMake is run.  Ideally this
> should be able to be done if a certain command-line flag is passed in.
>

Minus the prompting isn't that what options are for in cmake? I
believe you can set them either via the gui or by the command line /
shell.

John
___
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


[CMake] Can CMake prompt the user for input while it's running?

2010-02-27 Thread Naram Qashat
I'm wondering if it's possible for CMake to prompt the user for input when it's 
running, as opposed to relying on passing in arguments for input.  Main reason 
I'm looking for something like this is so we can have optional files that can be 
enabled or disabled by the user when CMake is run.  Ideally this should be able 
to be done if a certain command-line flag is passed in.


Thanks,
Naram Qashat
___
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