Hi,
today I had a look at cmake of freerdp 1.0 - and I got to say the
cmake syntax is really nice.

While thinking about what's needed to prepare a new gentoo-build I
have one point I'd like you to consider:
For our optional dependencies (alsa, pulseaudio and cups) I'd need the
following options for each of this dependencies:
- leave everything as it is & use auto-discovery (this is the option
for everyone but me ;-) )
- depend on the lib (i.g. alsa) and do break if it is not found
- do not depend on it, even if it were on my system.

I came up with 2 ideas on how to go about this:
1:
instead of "find_package(ALSA)" we use the following:
        if(NOT DEFINED WITH_ALSA)
                find_package(ALSA)
        elseif(WITH_ALSA)
                find_package(ALSA REQUIRED)
        endif()
and use -DWITH_ALSA=ON for always depending on alsa, -DWITH_ALSA=OFF
for never depending on it and not setting WITH_ALSA for
auto-discovery.
Problem with this is that you can not define WITH_ALSA in the options
or the default will never work.

2:
instead of "find_package(ALSA)" we use the following:
        if(WITH_ALSA)
                find_package(ALSA REQUIRED)
        elseif(NOT WITHOUT_ALSA)
                find_package(ALSA)
        endif()
and use -DWITH_ALSA=ON for always depending on alsa, -DWITHOUT_ALSA=ON
for never depending on it and setting both to OFF for auto-discovery.
Problem with this is that we'd be using two options for something that
would require one one.

I think the best idea would be to define a function i.g.
find_package_selectable that would automatically define an option with
3 values "AUTO" (which would be default) "ALWAYS" and "never". This
would be most readable in the CMakeLists.txt and well-defined. But I"m
not sure if that is possible.

Comments or ideas, anyone?

Yours,
Nils

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to