<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"><<a href="mailto:a.neundorf-work@gmx.net" target="_blank">a.neundorf-work@gmx.net</a>></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>
> Hi,<br>
><br>
> I am new to Cmake and at present exploring its features for migrating our<br>
> projects build system to use it.<br>
><br>
> I have main source folder inside that another folder contains the source<br>
> for our custom library.<br>
><br>
> I understand that the problem is with my cmake file. Through that the<br>
> generated project cannot locate the location of my library build location.<br>
> What is the right way to solve this kind of problem?<br>
><br>
> Thanks,<br>
> Lloyd<br>
><br>
> As a sample I am including my Cmake code<br>
><br>
> #Cmake file of library source code<br>
> #Path-> Myproject/src/lib/reverse<br>
><br>
> cmake_minimum_required (VERSION 2.6)<br>
><br>
> if(WIN32)<br>
> SET (REV_SRC reverse.cpp reverse.h)<br>
> else(WIN32)<br>
> SET (REV_SRC reverse.cpp)<br>
> endif(WIN32)<br>
><br>
> ADD_DEFINITIONS(-DREVERSE_EXPORTS)<br>
<br>
</div>Just some nitpicking: I'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'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>