Automoc issue with cmake

Alexander Neundorf neundorf at kde.org
Sat Nov 17 19:31:27 UTC 2012


On Saturday 17 November 2012, Laszlo Papp wrote:
> It seems the issue is that "/bin" is before in my PATH than "/usr/bin".
> Once the order swapper, it works fine.
> 
> I believe, cmake should be smarter without depending on path order. If
> cmake does not find anything in /bin, it should look for the next entry in
> the PATH environment variable. Currently, this is not happening for unknown
> reason for me. Hard coding "/usr/bin" before "/bin" may cause failure for
> other projects.
> 
> Perhaps, the issue is coming from here?
> get_filename_component(_AUTOMOC4_CURRENT_DIR  "${CMAKE_CURRENT_LIST_FILE}"
> PATH)

Well, it is related.

The automoc executable is searched using this call:
find_program(AUTOMOC4_EXECUTABLE automoc4 PATHS  "${_AUTOMOC4_BIN_DIR}/bin"
             NO_DEFAULT_PATH)

Due to the NO_DEFAULT_PATH this should search only in the directories listed, 
i.e. only in "${_AUTOMOC4_BIN_DIR}/bin", which is "/bin" in your case, but 
should be "/usr/lib/bin/".

If automoc would be installed with CMAKE_INSTALL_PREFIX=/, it would work.
It works also if CMAKE_INSTALL_PREFIX=/usr/, but then it fails (e.g. for you) 
if /lib/ points into the /usr/ tree.

Alex


More information about the Kde-buildsystem mailing list