Thanks. Is it possible to set the preprocessing to all .m4 files avoiding a manual specification of list of files to processed?
2009/6/5 Denis Scherbakov <[email protected]>: > > >> 'm4' outputs only on stdout and does not have an option to >> specify the >> output file. Please >> suggest me a solution for this... > > I had a similar problem and also with a preprocessor. I ended up writing > a CMake script like this: > > EXECUTE_PROCESS( > COMMAND my-command "${VAR_IFILE}" > RESULT_VARIABLE VAR_RESULT > OUTPUT_VARIABLE VAR_CONTENT) > # Do whatever you want with ${VAR_CONTENT} > FILE (WRITE "${VAR_OFILE}" "${VAR_CONTENT}") > UNSET(VAR_CONTENT) > > and the in a CMakeLists.txt > > # ADD_CUSTOM_COMMAND( ... ${CMAKE_COMMAND} > -DVAR_IFILE=/path/to/source.m4.file -DVAR_OFILE=/path/to/dest.cpp -P > ${SCRIPT_ABOVE} ...) > # also SET_SOURCE_FILES_PROPERTIES and LIST(APPEND PRJ_SRCS "${VAR_OFILE}") > >> Also, if I wish to do this for all CPP files, how do I >> specify it? > > You could write a MACRO that will accept INPUT filename, OUTPUT filename > and a variable name for a list of sources (to completely automate > everything). > > Denis > > > > > -- Prasad H. L. PhD Student (with Dr. Shalabh Bhatnagar) Department of Computer Science and Automation, Indian Institute of Science, Bangalore - 560012 _______________________________________________ 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
