Re: [CMake] Passing variable to program

2009-04-10 Thread John Dey
James, Just what I needed. Works like a charm. Thanks. John On Apr 10, 2009, at 11:29 AM, James Bigler wrote: Inside your CMakeLists.txt you can add a command line preprocessor definition: add_definitions(-DVERSION="0.8.2") James On Fri, Apr 10, 2009 at 8:42 AM, John Dey wrote: Hi, I

Re: [CMake] Passing variable to program

2009-04-10 Thread Tyler Roscoe
On Fri, Apr 10, 2009 at 10:42:34AM -0400, John Dey wrote: > I have converted a program from using make to cmake. I needed to make > a change to the main.cc program to get it to work. I am going back to > see if I can get it to work without making the change. main.cc has a > statement somet

Re: [CMake] Passing variable to program

2009-04-10 Thread Adolfo Rodríguez
If VERSION is a preprocessor definition, you can use the set_propertycommand. For example, if you want VERSION to be defined only in your main.cc source, do set_property(SOURCE main.cc PROPERTY COMPILE_DEFINITIONS VERSION=1.0) or

Re: [CMake] Passing variable to program

2009-04-10 Thread James Bigler
Inside your CMakeLists.txt you can add a command line preprocessor definition: add_definitions(-DVERSION="0.8.2") James On Fri, Apr 10, 2009 at 8:42 AM, John Dey wrote: > Hi, > > I have converted a program from using make to cmake.  I needed to make a > change to the main.cc program to get it t

[CMake] Passing variable to program

2009-04-10 Thread John Dey
Hi, I have converted a program from using make to cmake. I needed to make a change to the main.cc program to get it to work. I am going back to see if I can get it to work without making the change. main.cc has a statement something to the effect of "fprintf(stdin, "%s\n", VERSION);" a