I'm writing a CMake script that makes a static library MyLib
. I'd like to concatenate it with a 3rd party static library AnotherLib
. I try to accomplish this as follows:
- "Deconstruct"
AnotherLib
to object files by invokingar
as a part ofADD_CUSTOM_COMMAND
. - Prepare an intermediate
MyLibObj
usingADD_LIBRARY(MyLibObj OBJECT ${MYLIB_SOURCES})
- Make the final
MyLib
using (1) and (2) -- here is the problem. How to do this? Is it possible to makeCMake
treat the object files made in (1) asOBJECT
library?