M
M
Mars362021-02-24 18:34:23
CMake
Mars36, 2021-02-24 18:34:23

How to build a project with cmake along with a third party library?

There is my project and there is a third-party lib from github with its own CMakeLists. I added this CMakelists via

add_subdirectory
but how do i run
make
to get lib.a and add it to the project?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
klirichek, 2021-06-07
@Mars36

What for?
If you link with her, then just call her by name. Inclusion via add_subdirectory implies that all links and dependencies are monitored by cmake. You just write target_link_libraries for your project with this either.
If "just collect" - then there is no need to turn it on at all. Instead of make, it is now customary to run cmake --build (because besides make there are all sorts of ninja and msbuild)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question