[CMake] OPTION-like combobox

Brad King brad.king at kitware.com
Wed Jul 29 07:55:40 EDT 2009


Pau Garcia i Quiles wrote:
> Hello,
> 
> Is there anything like OPTION but which allows to select one value
> from a limited list of values (a combobox). Something like:
> 
> OPTION( CRYPTOBACKEND "Select a cryptography backend" VALUES "OpenSSL"
> "LibTomCrypt" "LibDES" DEFAULT "OpenSSL" )

There is in CMake HEAD from CVS.  See

  cmake --help-properties

and look for the "Properties on Cache Entries" section.

In particular, the "STRINGS" property does what you want, at least
in the cmake-gui:

  set(CRYPTOBACKEND "OpenSSL" CACHE STRING
      "Select a cryptography backend")
  set_property(CACHE CRYPTOBACKEND PROPERTY STRINGS
               "OpenSSL" "LibTomCrypt" "LibDES")

This feature will be included in the 2.8 release.

-Brad


More information about the CMake mailing list