]> Creatis software - clitk.git/commitdiff
Fixed cmake version problem
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sun, 5 Feb 2012 09:53:13 +0000 (10:53 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sun, 5 Feb 2012 09:53:13 +0000 (10:53 +0100)
cmake/FindGengetopt.cmake

index 8d7380e19e7ec9a9f4986990539113dcf6ab5eaa..77665420bac997f7b3cf40031890c18912b161bb 100644 (file)
@@ -2,7 +2,8 @@
 # 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})