[CMake] Sharing code between projects

kitts kitts.mailinglists at gmail.com
Thu Aug 23 06:23:41 EDT 2007


Its been a while since i disappeared. Well! There have a been major changes in 
real life that kept me away from most things that i working on. I am back now 
(somewhat rusted) and find over a 1000 mails on cmake to catch up with. I 
wonder what has changed! :-)

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").

Feels good to be back! :-)
-- 
Cheers!
kitts


More information about the CMake mailing list