automoc4 from kdesupport now supported for building KDE

Brad King brad.king at kitware.com
Wed Jun 4 15:16:39 CEST 2008


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
  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?)

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.  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
    )

-Brad


More information about the Kde-buildsystem mailing list