automoc4 from kdesupport now supported for building KDE

David Faure faure at kde.org
Wed Jun 4 18:46:36 CEST 2008


On Wednesday 04 June 2008, Brad King wrote:
> David Faure wrote:
> > We need a way to get the following priority order:
> > * user-specified prefix (CMAKE_PREFIX_PATH)
> > * likely default locations (kde lib install dir etc.)
> > * system fallback defaults (/usr)
> 
> The current order is
> 
>   1.) CMAKE_PREFIX_PATH from environment
>   2.) CMAKE_PREFIX_PATH from cmake variable
Interesting; shouldn't the cmake variable (e.g. specified on the command line)
be preferred over the environment variable (which could be set in .bashrc, i.e.
it's less specific and less explicit than cmake -DCMAKE_PREFIX_PATH=?).
Just wondering, doesn't matter much.

>   3.) PATH or LIB or other common system environment variables
>   4.) CMAKE_SYSTEM_PREFIX_PATH from cmake variable
>   5.) PATHS option listed in command
> 
> (where each of the PREFIX_PATH vars also has a find-type-specific
> version like CMAKE_LIBRARY_PATH).  Given the view of PATHS as "likely
> default locations" instead of "last restort", the order should be
> 
>   a.) CMAKE_PREFIX_PATH from environment
>   b.) CMAKE_PREFIX_PATH from cmake variable
>   c.) PATHS option listed in command
>   d.) PATH or LIB or other common system environment variables
>   e.) CMAKE_SYSTEM_PREFIX_PATH from cmake variable
> 
> (any comments on order of c versus d?)

d) is really only about locating executables, given that LIB isn't used on unix, isn't it?
When looking for libs or include files, what would d) be about?

Anyway the order you suggest matches well the idea of "likely/preferred locations".
If /opt/kde4/bin/ isn't in the PATH, but the cmake module knows about /opt/kde4 by some
other means, then it would want to look into /opt/kde4/bin/ first, even if that's not in 
the user's PATH. Again, so that users don't need to do anything.

> We'll talk about introducing a CMake Policy number to enable this
> change, but that will only help for CMake 2.6.x or higher. 

Excellent, thanks. I hope we switch to 2.6 soon, in any case, to make our lives simpler :)

> Meanwhile, 
> you can get this in CMake 2.4 using the two-call approach:
> 
>   # do 1,2,5
>   find_library(
>     FOO_LIBRARY NAMES foo
>     PATHS ${FOO_DEFAULT_PATHS}
>     NO_SYSTEM_ENVIRONMENT_PATH # no 3
>     NO_CMAKE_SYSTEM_PATH # no 4
>     )
>   # do 3,4
>   find_library(
>     FOO_LIBRARY NAMES foo
>     NO_CMAKE_ENVIRONMENT_PATH # no 1
>     NO_CMAKE_PATH # no 2
>     # no PATHS option means no 5
>     )

OK, thanks for that precise analysis. I'll try this in FindPhonon.cmake then :)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list