View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010743CMakeCMakepublic2010-05-21 06:512010-11-09 22:57
ReporterRolf Eike Beer 
Assigned ToDavid Cole 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0010743: Add dependencies to OPTION
DescriptionIt would be useful if OPTION had an additional DEPENDS argument. If the argument is evaluated to boolean false (applying the usual rules of IF()) and it is still selected an error is raised.
Additional InformationExample:

OPTION(bar "enables bar" OFF)
OPTION(foo "enables foo" OFF DEPENDS bar)

Should be equivalent to

OPTION(bar "enables bar" OFF)
OPTION(foo "enables foo" OFF)
IF (foo AND NOT bar)
  MESSAGE(SEND_ERROR "You can't select \"foo\" because it's dependencies (bar) were not met")
ENDIF ()

The GUI then could gray out all options with unmet dependencies to make the user's life easier.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0021940)
David Cole (manager)
2010-08-25 07:21

Are you aware of the CMakeDependentOption module?

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:CMakeDependentOption [^]

It does not "gray things out" in the GUI, but it does give some help to making options depend on other options. It also does not raise any errors.

But perhaps it suffices for the use case you were thinking of when you entered this issue?
(0021948)
Rolf Eike Beer (developer)
2010-08-25 08:44

Yes, that sounds very helpful. Maybe this should be mentioned in the documentation of the OPTION command then, how should anyone find this if he does not know what name to search for?
(0021956)
David Cole (manager)
2010-08-25 11:11

Good point. How does this sound as additional documentation for the OPTION command:

"If you have options that depend on the values of other options, see the module help for CMakeDependentOption."
(0021961)
Rolf Eike Beer (developer)
2010-08-25 13:37

Yes, that sounds good. Now the GUI just has to know to also look on this makro added options ;)
(0021965)
David Cole (manager)
2010-08-25 15:28

Documentation added to the OPTION command to point to the CMakeDependentOption command.

In 'next' branch of CMake as of now:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e62ac0b400c5aff953b74c8f8187ba9f4f71969 [^]

We are not going to add anything to the cmake-gui app for now related to this issue.

 Issue History
Date Modified Username Field Change
2010-05-21 06:51 Rolf Eike Beer New Issue
2010-08-25 07:21 David Cole Note Added: 0021940
2010-08-25 08:44 Rolf Eike Beer Note Added: 0021948
2010-08-25 11:11 David Cole Note Added: 0021956
2010-08-25 13:37 Rolf Eike Beer Note Added: 0021961
2010-08-25 15:27 David Cole Status new => assigned
2010-08-25 15:27 David Cole Assigned To => David Cole
2010-08-25 15:28 David Cole Note Added: 0021965
2010-08-25 15:28 David Cole Status assigned => resolved
2010-08-25 15:28 David Cole Fixed in Version => CMake-2-8
2010-08-25 15:28 David Cole Resolution open => fixed
2010-08-31 18:01 David Cole Target Version => CMake 2.8.3
2010-09-10 00:04 David Cole Fixed in Version CMake-2-8 => CMake 2.8.3
2010-11-09 22:57 Philip Lowman Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team