<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 13, 2013 at 1:04 AM, Alexander Neundorf <span dir="ltr">&lt;<a href="mailto:a.neundorf-work@gmx.net" target="_blank">a.neundorf-work@gmx.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Friday 12 April 2013, Lloyd wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am new to Cmake and at present exploring its features for migrating our<br>
&gt; projects build system to use it.<br>
&gt;<br>
&gt; I have main source folder inside that another folder contains the source<br>
&gt; for our custom library.<br>
&gt;<br>
&gt; I understand that the problem is with my cmake file. Through that the<br>
&gt; generated project cannot locate the location of my library build location.<br>
&gt; What is the right way to solve this kind of problem?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;   Lloyd<br>
&gt;<br>
&gt; As a sample I am including my Cmake code<br>
&gt;<br>
&gt; #Cmake file of library source code<br>
&gt; #Path-&gt; Myproject/src/lib/reverse<br>
&gt;<br>
&gt; cmake_minimum_required (VERSION 2.6)<br>
&gt;<br>
&gt; if(WIN32)<br>
&gt; SET (REV_SRC reverse.cpp reverse.h)<br>
&gt; else(WIN32)<br>
&gt; SET (REV_SRC reverse.cpp)<br>
&gt; endif(WIN32)<br>
&gt;<br>
&gt; ADD_DEFINITIONS(-DREVERSE_EXPORTS)<br>
<br>
</div>Just some nitpicking: I&#39;d recommend to start writing also the cmake files in<br>
good style, i.e. with proper indentation and consistent upper- or lower<br>
casing.<br>
Also, if there are no strong reasons against it, I&#39;d recommend to require a<br>
higher version of cmake, at least 2.8.0, better 2.8.3 or newer. This will give<br>
you more features and bug fixes, braces in if()-conditions.<br>
Then this code would look like:<br>
<br>
cmake_minimum_required (VERSION 2.8)<br>
<br>
if(WIN32)<br>
  set(REV_SRC reverse.cpp reverse.h)<br>
else()<br>
  set (REV_SRC reverse.cpp)<br>
endif()<br>
<br>
add_definitions(-DREVERSE_EXPORTS)<br>
<br>
<br>
Alex<br></blockquote><div><br></div><div>Thank you Alex, My system already had cmake 2.6, that is why I chose that. And again thanks for your style guide.</div><div><br></div><div style>Lloyd </div></div><br></div></div>