On Thu, Sep 16, 2010 at 11:13 AM, David Aldrich <span dir="ltr"><<a href="mailto:David.Aldrich@eu.nec.com">David.Aldrich@eu.nec.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi David<br>
<div class="im"><br>
> Something like this should work:<br>
<br>
> cmake_minimum_required(VERSION 2.8)<br>
> project(MyExe)<br>
<br>
> add_subdirectory(../Kernel Kernel)<br>
> add_subdirectory(../DynLibs DynLibs)<br>
<br>
> add_executable(MyExe exe.cxx)<br>
> target_link_libraries(MyExe Kernel)<br>
<br>
</div>I have a problem with add_executable(). Our Kernel library includes main.cpp, so all our existing linker command does is to take libKernel.a and make it an executable:<br>
<br>
g++ -o _gnuRelease/MyExe -ldl -Wl,-whole-archive,-export-dynamic ../Kernel/_gnuRelease/libKernel.a<br>
<br>
So I have no source files to specify. Does 'exe.cxx' (above) have special properties or is it just a placeholder? If the latter, how can I build an executable with no source files specified?<br>
<br>
BR<br>
<font color="#888888"><br>
David<br>
<br>
</font></blockquote></div><br><div>I'm not sure if there's a way to do that cross-platform or not. It's easiest just to add an "empty.cxx" so that CMake knows to link the executable with the C++ linker.</div>
<div><br></div><div>HTH,</div><div>David</div><div><br></div>