# Attempt to find gengetopt. If not found, compile it.
FIND_PROGRAM(GENGETOPT gengetopt)
IF (GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
- ADD_SUBDIRECTORY(${CMAKE_CURRENT_LIST_DIR}/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
+ GET_FILENAME_COMPONENT(CLITK_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+ ADD_SUBDIRECTORY(${CLITK_CMAKE_DIR}/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
ELSE(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
ADD_EXECUTABLE(gengetopt IMPORTED)
SET_PROPERTY(TARGET gengetopt PROPERTY IMPORTED_LOCATION ${GENGETOPT})