Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-17 Thread Alexander Neundorf
On Friday 05 June 2009, Robert Haines wrote: > Hi, > > On 5 Jun 2009, at 15:52, Prasad H. L. wrote: > > I tried as you have suggested. I have one more problem. I tried the > > following CMakeLists.txt > > > > > > project(cmake_test) > > cmake_minimum_required(VERSION 2.6) > > > > add_execu

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-06 Thread Michael Wild
On 5. Jun, 2009, at 22:27, Prasad H. L. wrote: Consolidating all the things, the working CMakeLists.txt is as follows - project(cmake_test) cmake_minimum_required(VERSION 2.6) macro(m4tocxx outfilename) add_custom_command( OUTPUT ${CMAKE_CURRENT_

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
Consolidating all the things, the working CMakeLists.txt is as follows - project(cmake_test) cmake_minimum_required(VERSION 2.6) macro(m4tocxx outfilename) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${outfilename}.cpp COMMAND m4 -P

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
Can I define a new source type, like .m4 and add rules for it? That would be ideal, I feel, for my case. 2009/6/5 Tyler Roscoe : > On Fri, Jun 05, 2009 at 10:10:07PM +0530, Prasad H. L. wrote: >> 2009/6/5 Denis Scherbakov : >> > >> >> Is it possible to set the preprocessing to all .m4 files >> >>

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Tyler Roscoe
On Fri, Jun 05, 2009 at 10:10:07PM +0530, Prasad H. L. wrote: > 2009/6/5 Denis Scherbakov : > > > >> Is it possible to set the preprocessing to all .m4 files > >> avoiding a > >> manual specification of list of files to processed? > > > > If your list of files changes all the time, you can use FILE

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
2009/6/5 Denis Scherbakov : > >> Is it possible to set the preprocessing to all .m4 files >> avoiding a >> manual specification of list of files to processed? > > I don't know of such, but it does not mean that it does not exist. > > If your list of files changes all the time, you can use FILE(GLOB

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Denis Scherbakov
> Is it possible to set the preprocessing to all .m4 files > avoiding a > manual specification of list of files to processed? I don't know of such, but it does not mean that it does not exist. If your list of files changes all the time, you can use FILE(GLOB...) to find all *.m4 files to automat

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
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 : > > >> 'm4' outputs only on stdout and does not have an option to >> specify the >> output file. Please >> suggest me a solution for this...

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Robert Haines
Hi, On 5 Jun 2009, at 15:52, Prasad H. L. wrote: I tried as you have suggested. I have one more problem. I tried the following CMakeLists.txt project(cmake_test) cmake_minimum_required(VERSION 2.6) add_executable(testcmake testcmake.m4.cpp) add_custom_command(OUTPUT testcmake.m4.cpp

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Denis Scherbakov
> '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_V

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
I tried as you have suggested. I have one more problem. I tried the following CMakeLists.txt project(cmake_test) cmake_minimum_required(VERSION 2.6) add_executable(testcmake testcmake.m4.cpp) add_custom_command(OUTPUT testcmake.m4.cpp m4 -P -s tes

Re: [CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Denis Scherbakov
> I wanted to do some looping in macros which are not > possible in GNU > CPP. So, I wrote > macros in m4. I wish to pre-process all my C/C++ code with > m4 before > handing it over to > gcc. I did not find any direct way out for doing this in > cmake. Any > ideas how to do it with > cmake? Use

[CMake] Using m4 as a additional preprocessor for C/C++

2009-06-05 Thread Prasad H. L.
Hi, I wanted to do some looping in macros which are not possible in GNU CPP. So, I wrote macros in m4. I wish to pre-process all my C/C++ code with m4 before handing it over to gcc. I did not find any direct way out for doing this in cmake. Any ideas how to do it with cmake? Regards, Prasad _