0

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:

  1. "Deconstruct" AnotherLib to object files by invoking ar as a part of ADD_CUSTOM_COMMAND.
  2. Prepare an intermediate MyLibObj using ADD_LIBRARY(MyLibObj OBJECT ${MYLIB_SOURCES})
  3. Make the final MyLib using (1) and (2) -- here is the problem. How to do this? Is it possible to make CMake treat the object files made in (1) as OBJECT library?
Community
  • 1
  • 1
Igor R.
  • 14,716
  • 2
  • 49
  • 83

1 Answers1

0

This CMake script merges several static libraries - but in a straightforward way, without the new OBJECT feature. It's a part of MERGE_STATIC_LIBS macro referenced in this answer.

Community
  • 1
  • 1
Igor R.
  • 14,716
  • 2
  • 49
  • 83