2009/2/17 Gaëtan Lehmann <gaetan.lehm...@jouy.inra.fr>: > > Hi, > > I wonder, is there an option in cmake to check that a custom command has > produced the files it should have produced?
I don't think there is such option. However if you have the list of supposedly produced files you may check if they have been produced with IF(EXISTS <filename>) ENDIF(EXISTS <filename>) With a MACRO like: MACRO(CheckFilesExists) FOREACH(F ${ARGN}) IF(EXISTS ${F}) MESSAGE(STATUS "${F} exists") ELSE(EXISTS ${F}) MESSAGE(STATUS "${F} DOES NOT exists") ENDIF(EXISTS ${F}) ENDFOREACH(F) ENDMACRO(CheckFilesExists) you could check SET(FL "exist1.txt;doesnotexists.txt") CheckFilesExists(${FL}) My MACRO is a sample but you can MESSAGE(FATAL_ERROR ....) when an expected file does not exists. > In my case, doxygen may not produce all the expected files, depending on the > comment it finds in the source code, but install of the man pages will fail > because of those missing files. Having those manpages listed in the expected > output doesn't change anything. > > I'd really like to have an error message at build time instead of the error > message I get at install time: it would save me a lot of time. If you want the error to appear at build time then you'll have to somehow add another custom command which may cmake -P CheckFilesDoxy.cmake the CheckFilesDoxy.cmake should be generated at CMake time in order to contains the appropriate list of OUTPUT files used for Doxygen custom command. I realise it may be a bit tricky but it should work. -- Erk _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake