From 74dda532c4844f38025d575926787532d41d613d Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Fri, 18 May 2007 23:06:33 +0200 Subject: [PATCH] slightly less hackish way to generate files, I'm still not very pleased with it. Signed-off-by: Pierre Habouzit --- CMakeLists.txt | 37 ++++++------------------------------- lib-lua/CMakeLists.txt | 1 + lib-mime/CMakeLists.txt | 5 +++++ lib-sys/CMakeLists.txt | 1 + 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8b3f3e..c72e2ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,37 +381,12 @@ ADD_CUSTOM_COMMAND( COMMAND sh ${madmutt_SOURCE_DIR}/charset.def > ${madmutt_SOURCE_DIR}/charset.gperf COMMENT "Generating ${madmutt_SOURCE_DIR}/charset.gperf from ${madmutt_SOURCE_DIR}/charset.def" ) -SET(__mt ${madmutt_SOURCE_DIR}/lib-mime/mime-token) -ADD_CUSTOM_COMMAND( - OUTPUT ${__mt}.h - MAIN_DEPENDENCY ${__mt}.sh ${__mt}.def - COMMAND sh ${__mt}.sh ${__mt}.h < ${__mt}.def - COMMENT "Generating ${__mt}.h from ${__mt}.def" -) -SET(__lt ${madmutt_SOURCE_DIR}/lib-lua/lua-token) -ADD_CUSTOM_COMMAND( - OUTPUT ${__lt}.h - MAIN_DEPENDENCY ${__lt}.gperf - COMMAND sh ${__lt}.gperf ${__lt}.h || \(${RM} ${__lt}.h; exit 1\) - COMMENT "Generating ${__lt}.h from ${__lt}.gperf" -) -SET(__lm ${madmutt_SOURCE_DIR}/lib-lua/madmutt) -ADD_CUSTOM_COMMAND( - OUTPUT ${__lm}.li - MAIN_DEPENDENCY ${__lm}.cpkg - COMMAND ${madmutt_SOURCE_DIR}/tools/cpkg2c -h ${__lm}.cpkg > ${__lm}.li || \(${RM} ${__lm}.li; exit 1\) - COMMENT "Generating ${__lm}.li from ${__lm}.cpkg" -) -ADD_CUSTOM_TARGET( - generate_files - DEPENDS - ${madmuttgen} - ${madmutt_SOURCE_DIR}/keymap_defs.h - ${madmutt_SOURCE_DIR}/charset.gperf - ${madmutt_SOURCE_DIR}/lib-mime/mime-token.h - ${madmutt_SOURCE_DIR}/lib-lua/lua-token.h - ${madmutt_SOURCE_DIR}/lib-lua/madmutt.li +ADD_CUSTOM_TARGET(generate_file + DEPENDS ${madmuttgen} + ${madmutt_SOURCE_DIR}/keymap_defs.h + ${madmutt_SOURCE_DIR}/charset.gperf ) -ADD_DEPENDENCIES(madmutt generate_files) +ADD_DEPENDENCIES(generate_file generate_files) +ADD_DEPENDENCIES(madmutt generate_file) # }}} diff --git a/lib-lua/CMakeLists.txt b/lib-lua/CMakeLists.txt index ad79254..9f75c26 100644 --- a/lib-lua/CMakeLists.txt +++ b/lib-lua/CMakeLists.txt @@ -5,3 +5,4 @@ MADMUTT_SOURCES(libluasrc libluagen ) ADD_LIBRARY(lua ${libluasrc}) +ADD_CUSTOM_TARGET(generate_files DEPENDS ${libluagen}) diff --git a/lib-mime/CMakeLists.txt b/lib-mime/CMakeLists.txt index 2bea2f6..2f4be7d 100644 --- a/lib-mime/CMakeLists.txt +++ b/lib-mime/CMakeLists.txt @@ -23,3 +23,8 @@ MADMUTT_SOURCES(libmimesrc libmimegen ) ADD_LIBRARY(mime ${libmimesrc}) +ADD_CUSTOM_TARGET(generate_files + DEPENDS ${libmimegen} + ${CMAKE_CURRENT_SOURCE_DIR}/mime-token.h + ${CMAKE_CURRENT_SOURCE_DIR}/mime-token.c +) diff --git a/lib-sys/CMakeLists.txt b/lib-sys/CMakeLists.txt index 7da5688..5451b9f 100644 --- a/lib-sys/CMakeLists.txt +++ b/lib-sys/CMakeLists.txt @@ -8,3 +8,4 @@ MADMUTT_SOURCES(libsyssrc libsysgen mutt_ssl.cpkg ) ADD_LIBRARY(sys ${libsyssrc}) +ADD_CUSTOM_TARGET(generate_files DEPENDS ${libsysgen}) -- 2.20.1