[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); and

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 js...@optonline.net wrote: Hi, I have converted a program from using make to cmake.  I needed to make a change to the main.cc

Re: [CMake] Passing variable to program

2009-04-10 Thread Adolfo Rodríguez
If VERSION is a preprocessor definition, you can use the set_propertyhttp://cmake.org/cmake/help/cmake2.6docs.html#command: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 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

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

[CMake] /MP flag an VS parallel builds

2009-04-10 Thread Bill Hoffman
Jeff Baumes at Kitware recently made this discovery: Some may already know this, but I found a flag that you can use in Visual Studio that enables file-level build parallelism within projects like gmake. By default, Visual Studio only allows project-level parallelism, which does not always use

Re: [CMake] /MP flag an VS parallel builds

2009-04-10 Thread John Drescher
On Fri, Apr 10, 2009 at 3:25 PM, Bill Hoffman bill.hoff...@kitware.com wrote: Jeff Baumes at Kitware recently made this discovery: Some may already know this, but I found a flag that you can use in Visual Studio that enables file-level build parallelism within projects like gmake. By

Re: [CMake] Combo Box cache variables

2009-04-10 Thread Alexander Neundorf
On Thursday 09 April 2009, Robert Dailey wrote: 2009/4/9 Alexander Neundorf a.neundorf-w...@gmx.net On Thursday 09 April 2009, Robert Dailey wrote: I think it would be useful to have a combo box type for cache variables. This would allow the user to select from a list of

Re: [CMake] find_package question

2009-04-10 Thread Alexander Neundorf
On Friday 10 April 2009, Robert Dailey wrote: I'm reading the guidelines for find package modules here: http://www.cmake.org/cgi-bin/viewcvs.cgi/Modules/readme.txt?root=CMakeview =markup No where in here do I see any mention of uppercase variable names. For example, if my find package is:

Re: [CMake] Combo Box cache variables

2009-04-10 Thread Alexander Neundorf
On Friday 10 April 2009, John Drescher wrote: On Thu, Apr 9, 2009 at 5:16 PM, Bill Hoffman bill.hoff...@kitware.com wrote: Robert Dailey wrote: On Thu, Apr 9, 2009 at 3:58 PM, Bill Hoffman bill.hoff...@kitware.com mailto:bill.hoff...@kitware.com wrote:        I'm using CMake 2.6.4 RC4.

Re: [CMake] INCLUDE_DIRECTORIES per project

2009-04-10 Thread Alexander Neundorf
On Friday 10 April 2009, Adrian Boeing wrote: Hi, I would like to have a portable way of having separate include directories for each 'project' in my visual studio 'solution'. ie: common/ dir/file1 dir/file2 share the include directory 'common' , and have seperate 'include1' and

Re: [CMake] /MP flag an VS parallel builds

2009-04-10 Thread Philip Lowman
On Fri, Apr 10, 2009 at 3:32 PM, John Drescher dresche...@gmail.com wrote: I have had that in my CMakeLists.txt for my main application for a few months and I use this for the most part with VS2005. I got this info here:

Re: [CMake] lack of operator for easy string concatenation

2009-04-10 Thread Piotr Dobrogost
Jed Brown wrote: I assume you have considered list (APPEND list ...) and list (INSERT list 0 ...) which should work for what you have described. Thanks for information. Any chances to have PREPPEND as one of options in the future? -- Piotr Dobrogost *** curlpp.org - c++

[CMake] managing lists with space separated elements

2009-04-10 Thread Piotr Dobrogost
Hi Can the list operations in cmake be carried out on a list with space separated elements without converting this list to cmakes' inner format? Below, standard I guess, way of doing this makes me cry :) STRING(REPLACE ; _LIST ${CMAKE_C_STANDARD_LIBRARIES}) LIST(REMOVE_ITEM _LIST wldap32.lib)

Re: [CMake] Generating makefiles without installed CMake

2009-04-10 Thread Philip Lowman
On Thu, Apr 9, 2009 at 9:16 PM, Ivan Chupahin gurin...@gmail.com wrote: How can i generate the makefiles on a different systems, where no CMake is installed? It`s like a configure (autoconf utility). There's no way to do this. You must have CMake available to configure a CMake project. CMake

Re: [CMake] CMake and iPhone support

2009-04-10 Thread Robert Dailey
It seems that CMake, in general, does not support cross-compilation. It generates projects as if they will build targets on the current platform instead of for another. Correct me if I'm wrong. ___ Powered by www.kitware.com Visit other Kitware

Re: [CMake] CMake and iPhone support

2009-04-10 Thread Bill Hoffman
Robert Dailey wrote: It seems that CMake, in general, does not support cross-compilation. It generates projects as if they will build targets on the current platform instead of for another. Correct me if I'm wrong. http://www.cmake.org/Wiki/CMake_Cross_Compiling The env and cache variable

Re: [CMake] managing lists with space separated elements

2009-04-10 Thread Bill Hoffman
Piotr Dobrogost wrote: Hi Can the list operations in cmake be carried out on a list with space separated elements without converting this list to cmakes' inner format? Below, standard I guess, way of doing this makes me cry :) STRING(REPLACE ; _LIST ${CMAKE_C_STANDARD_LIBRARIES})

Re: [CMake] INCLUDE_DIRECTORIES per project

2009-04-10 Thread Adrian Boeing
Great, thanks Philip! It would be fantastic if CMake included this feature in future. Just for clarification to make sure I haven't misunderstood, the solution Alex proposed would not do what I wanted (separate includes) because both files are in the same directory? What Alex is suggesting would

Re: [CMake] INCLUDE_DIRECTORIES per project

2009-04-10 Thread Philip Lowman
On Sat, Apr 11, 2009 at 12:17 AM, Adrian Boeing aboe...@gmail.com wrote: Great, thanks Philip! It would be fantastic if CMake included this feature in future. Just for clarification to make sure I haven't misunderstood, the solution Alex proposed would not do what I wanted (separate