[CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

2009-08-27 Thread Eike Kroemer
Hi there, in the hope of achieving platform independence of my plain-C project I have started looking into CMake, trying to duplicate what my manually created makefiles do. A minimalistic description of my problem is the following: * I have 2 executable targets * both having the same main

Re: [CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

2009-08-27 Thread Marcel Loose
Hi Eike, I think the only safe and reliable way to do this is create several build directories, e.g. build/type_1 and build/type_2. When running cmake in build/type_1, you should add -D_TYPE1_ to the preprocessor flags; same for build/type_2. Best regards, Marcel Loose. On Thu, 2009-08-27 at

Re: [CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

2009-08-27 Thread Christian Ehrlicher
Von: Marcel Loose lo...@astron.nl CC: cmake@cmake.org Betreff: Re: [CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only Hi Eike, I think the only safe and reliable way to do this is create several build directories, e.g. build/type_1 and build/type_2.

Re: [CMake] VS 2008 x64, Boost 1.39 - Can not find boost libraries

2009-08-27 Thread Mike Jackson
First: Sorry for the cross-post but the problem involves projects from all three lists. Comments are below: On Thu, Aug 27, 2009 at 12:01 AM, Philip Lowmanphi...@yhbt.com wrote: Mike, Sorry, I didn't realize you were using the CMake build for Boost.  I wouldn't be surprised if there were

Re: [CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

2009-08-27 Thread Eike Kroemer
Hi Marcel, Christian, Am 08/27/2009 01:30 PM Marcel Loose wrote: I think the only safe and reliable way to do this is create several build directories, e.g. build/type_1 and build/type_2. When running cmake in build/type_1, you should add -D_TYPE1_ to the preprocessor flags; same for

Re: [CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

2009-08-27 Thread John Drescher
On Thu, Aug 27, 2009 at 8:55 AM, Eike Kroemereike-michael.kroe...@atlas-elektronik.com wrote: Hi Marcel, Christian, Am 08/27/2009 01:30 PM Marcel Loose wrote: I think the only safe and reliable way to do this is create several build directories, e.g. build/type_1 and build/type_2. When

[CMake] How does interaction between UseXXX.cmake, XXXBuildSettings.cmake and XXXConfig.cmake supposedly work.

2009-08-27 Thread kent williams
I use some classes of vtkINRIA3D library for an ITK/VTK/KWWidgets application. If you haven't heard of it: http://www-sop.inria.fr/asclepios/software/vtkINRIA3D/ I had always been building against vtkINRIA3D 'in place' -- i.e. including the UsevtkINRIA3D.cmake from its build directory. I'm

[CMake] Unknown origin of compiler flag on Cray

2009-08-27 Thread Will Dicharry
Hi All, I am experiencing a strange problem on Cray XT machines running CNL compute nodes with the PGI compiler. It appears that something is adding the flags -Bstatic -Bdynamic (in that order) to the link line. It looks like the Linux.cmake platform module sets the the variable

Re: [CMake] Compiled file cannot be executed

2009-08-27 Thread David Cole
Use full path file names as DEPENDS arguments. Also: depend on the executable file too so that cmake knows not to try to run the custom command before the executable is built... i.e. : DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/server/someinput.txt

Re: [CMake] Compiled file cannot be executed

2009-08-27 Thread Swaroop Ramachandra
Still no luck :( . I really wonder why it is trying to execute my generate binary even before it is built. Here are my updated lines of code. #Trying to compile and run generate.c. generate.c creates a new file someoutput.txt and copies all data from someinput.txt to someoutput.txt

Re: [CMake] Compiled file cannot be executed

2009-08-27 Thread Swaroop Ramachandra
Hi Michael, Thanks for your reply. I still have the same problem. * * gmake-3.81[2]: bin/generate: Command not found lin: gmake-3.81[2]: *** [bin/generate] Error 127 lin: gmake-3.81[1]: *** [CMakeFiles/generate.dir/all] Error 2 Here's my code as is: #Trying to compile and run generate.c.

[CMake] Setting target properties

2009-08-27 Thread Andrey Maslennikov
My case: I have one file which can be compiled into 4 different binaries using macros. For this I use add_definitions() and remove_definitions() commands. But as I understand these commands has global effect in CMakeLists file. How can I define and undefine macros in *one* CMakeLists file? For

Re: [CMake] Compiled file cannot be executed

2009-08-27 Thread Michael Wild
David is probably right, that you need to add the dependency on generate. However, only add it's target name to both the COMMAND and DEPENDS arguments, CMake should figure this out. Michael On 27. Aug, 2009, at 21:31, Swaroop Ramachandra wrote: Still no luck :( . I really wonder why it is

Re: [CMake] Setting target properties

2009-08-27 Thread Tyler Roscoe
On Thu, Aug 27, 2009 at 11:11:54PM +0400, Andrey Maslennikov wrote: file. How can I define and undefine macros in *one* CMakeLists file? For this case more useful another command - set_target_properties() with property COMPILE_FLAGS. It really helped me, but I was confronted with

Re: [CMake] Build problem with cmake-2.6.2 on Centos 5.x system

2009-08-27 Thread Andrew Sayman
On Mon, Jan 5, 2009 at 11:22 PM, Bill Hoffmanbill.hoff...@kitware.com wrote: George R Goffe wrote: Howdy, I just downloaded cmake 2.6.2 on one of my Centos systems and tried to build it... I got the following msgs for my trouble. I see that the problem was reported for the CVS version but

Re: [CMake] Passing svn password to ctest

2009-08-27 Thread Matthew Woehlke
David Rawlins wrote: My svn repository requires a password. How do I pass the password to ctest in order to do a ctest -D Nightly from a cron job? You could always set your svn config to allow saving passwords, then do something that makes it ask for your password (e.g. 'svn log'), type

Re: [CMake] Setting target properties

2009-08-27 Thread Philip Lowman
On Thu, Aug 27, 2009 at 3:11 PM, Andrey Maslennikov andrew.maslenni...@gmail.com wrote: My case: I have one file which can be compiled into 4 different binaries using macros. For this I use add_definitions() and remove_definitions() commands. But as I understand these commands has global

Re: [CMake] Compiled file cannot be executed

2009-08-27 Thread Swaroop Ramachandra
I did. The same problem persists. Is there a work-around - maybe some other command that I can use? 2009/8/27 Michael Wild them...@gmail.com David is probably right, that you need to add the dependency on generate. However, only add it's target name to both the COMMAND and DEPENDS arguments,