[Cmake] Out of source build
Zennard Sun
zen at ll . mit . edu
Fri, 11 Jul 2003 14:45:42 -0400
Hi Andy,
Thank you for all of your help so far. I have yet another question
relating to your previous solution. I have A.cc B.cc and C.cc all in
home/z/libFrame. I wanted to make an out-of-source build like in your
example so I created a seperate directory called home/z/lib-Sol. I've
tried the following in the CMakeLists.txt in lib-Sol:
AUX_SOURCE_DIRECTORY(home/z/libFrame LIB_SOURCE_FILES)
ADD_LIBRARY(foo STATIC LIB_SOURCE_FILES)
versus:
ADD_LIBRARY(foo home/z/libFrame/A.cc home/z/libFrame/B.cc
home/z/libFrame/C.cc)
The first solution does not give me an out of source build. The object
files are produced in libFrame rather than in lib-Sol. The second
solution gives me the correct out of source build and creates the object
files in libFrame. Since the sources in that directory may change, I
would like to use the first solution. Do you have any ideas?
Thanks,
Zennard Sun