[CMake] Re: Sharing code between projects

kitts kitts.mailinglists at gmail.com
Fri Aug 24 10:48:23 EDT 2007


On Thursday 23 Aug 2007 3:53:41 pm kitts wrote:
> Anyway, I have a new set of projects and my current problem is that i have
> some code that i share between projects. Once source can be shared not
> binaries.
>
> Code is organized as;
> src/common
> src/project1
> src/project2
>
> The CMakeLists.tst files are located inside for each project which sets the
> right compiler and sources to be built. Now i want common to be included in
> each of these proejects and build separately for each by inheriting all the
> settings for that project.
>
> What is the best way to achieve this? I cant use ADD_SUBDIRECTORY() as it
> is really a sibling folder (cmake complains if I use "../common").

Does anybody have a solution around this? The only way i could think of is to 
copy the common folder during configure time and run cmake again inside it by 
using the current cache. This is not a very efficient way as not all of the 
common folder code is necessary in every project. Also code changes in the 
common directory will not result in an update in the project.
-- 
Cheers!
kitts


More information about the CMake mailing list