On Thu, Sep 16, 2010 at 11:33 AM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.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;">
<div><div></div><div class="h5"><br>
On 16. Sep, 2010, at 17:13 , David Aldrich wrote:<br>
<br>
> Hi David<br>
><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>
> 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>
><br>
> David<br>
<br>
</div></div>There is none. The only way to do that is create an empty dummy file (using e.g. a combination of file(WRITE) and configure_file() to prevent recompiling after every CMake run).<br>
<div><div></div><div class="h5"><br>
--<br>
There is always a well-known solution to every human problem -- neat, plausible, and wrong.<br>
H. L. Mencken<br>
<br>
</div></div></blockquote></div><br><div>Or you could just add an empty source file to your source tree...</div><div><br></div>