rm *.li/*.c files when cpkg2c fails.
authorPierre Habouzit <madcoder@debian.org>
Fri, 18 May 2007 08:54:46 +0000 (10:54 +0200)
committerPierre Habouzit <madcoder@debian.org>
Fri, 18 May 2007 08:54:46 +0000 (10:54 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
cmake/Cpkg2c.cmake

index 2dee6ec..0d1c01c 100644 (file)
@@ -11,13 +11,13 @@ macro (MADMUTT_SOURCES _result _gen)
             add_custom_command(
                 OUTPUT ${_li}
                 MAIN_DEPENDENCY ${_abs}
-                COMMAND ${madmutt_SOURCE_DIR}/tools/cpkg2c -h ${_abs} > ${_li}
+                COMMAND ${madmutt_SOURCE_DIR}/tools/cpkg2c -h ${_abs} > ${_li} || \(${RM} ${_li}; exit 1\)
                 COMMENT "Generating ${_li} from ${_abs}"
             )
             add_custom_command(
                 OUTPUT ${_c}
                 MAIN_DEPENDENCY ${_abs}
-                COMMAND ${madmutt_SOURCE_DIR}/tools/cpkg2c -c ${_abs} > ${_c}
+                COMMAND ${madmutt_SOURCE_DIR}/tools/cpkg2c -c ${_abs} > ${_c} || \(${RM} ${_c}; exit 1\)
                 COMMENT "Generating ${_c} from ${_abs}"
             )
             list(APPEND ${_result} ${_li} ${_c})