--- Automoc4Config.cmake.orig	2015-03-07 15:07:26.000000000 -0500
+++ Automoc4Config.cmake	2015-03-07 15:08:20.000000000 -0500
@@ -59,9 +59,12 @@
    get_target_property(AUTOMOC4_EXECUTABLE automoc4 LOCATION)
    # this dependency is required to make parallel builds of kdesupport work:
    set(_AUTOMOC4_EXECUTABLE_DEP automoc4)
-else(EXISTS ${_AUTOMOC4_CURRENT_DIR}/kde4automoc.cpp)
+ else(EXISTS ${_AUTOMOC4_CURRENT_DIR}/kde4automoc.cpp)
+   # this file is installed into ${prefix}/share/cmake/automoc4,
+   # so have to 'get_filename_component' 3 times to find ${prefix}
    get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_CURRENT_DIR}" PATH)
    get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_BIN_DIR}" PATH)
+   get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_BIN_DIR}" PATH)
    find_program(AUTOMOC4_EXECUTABLE automoc4 PATHS  "${_AUTOMOC4_BIN_DIR}/bin" NO_DEFAULT_PATH)
    set(_AUTOMOC4_EXECUTABLE_DEP)
    mark_as_advanced(AUTOMOC4_EXECUTABLE)
