Search code examples
cmakestatic-librariesclion

How can I add a prebuilt static library in a project using CMake?


CLion: How can I add (or use) a prebuilt static library in my project?


Solution

  • If you're asking about how to link your project to the pre-built static library, you can do like this by calling target_link_libraries.

    Assume your project called myProj and the pre-built library myLib.lib, you can it do like this:

    target_link_libraries(myProj myLib)