Skip to main content
whitehorsesoft
Associate III
February 7, 2026
Question

CMake generated code - using code developed elsewhere

  • February 7, 2026
  • 1 reply
  • 140 views

After generating C code for a CMake project, I'd like to use some existing code that I've developed elsewhere.

Is there good information or guidance on how to do this properly?

For example, should compile my code as a static library and bring it into my project? If so, what is the recommended way to do this (how do I ensure compatibility, etc)? Or should I just copy-paste the source code files and headers into the project?

1 reply

TDK
Super User
February 7, 2026

It's up to you, but including the source code file as if it were just another file in your project is the easiest way. That's what I would do unless there is a convincing reason to bundle it as a library.

"If you feel a post has answered your question, please click ""Accept as Solution""."