Andreas,

I just replied to a message from another gentleman on here and I may be way off 
base. But, I tried to do this once and it did not work. The only way that I 
could get it to work was to add another project() call between the two... I 
could have had some other issues because it has been quite a while since I had 
this problem and I do not remember the specific error that I got, so I am by no 
means saying anyone is wrong because I am sure that many of you are way more 
familiar with CMake than I am, this is a learning experience for me as well. I 
was just trying to help the guy out and when I looked at his original posting I 
saw "test" as the same name being passed to add_executable and add_library... I 
went back to look at the code again and he did have one called "test" and the 
other called "fan" that was my mistake and my misreading it.

My apologies for saying the wrong thing, I was only trying to help...

Eric

> -----Original Message-----
> From: Andreas Pakulat [mailto:ap...@gmx.de]
> Sent: Monday, October 22, 2012 12:17 PM
> To: Eric Clark
> Cc: 张峰; cmake@cmake.org
> Subject: Re: [CMake] cmake trouble
> 
> Hi,
> 
> On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <ecl...@ara.com> wrote:
> >
> > First off, you cannot call both add_executable and add_library in the
> > same CMakeLists file.
> 
> I think there's something missing here, but its perfectly possible to have one
> or more library and executable targets specified in the same cmake file. So
> this works just fine:
> 
> add_library(foo bar.cpp)
> add_executable(bar foo.cpp)
> 
> There are build-systems that have such limitations, but cmake is not one.
> 
> Andreas
--

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

Reply via email to