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