M
M
Mars362021-04-07 14:02:29
CMake
Mars36, 2021-04-07 14:02:29

How not to rebuild a dependency when building a project in cmake?

There is a lib and a project that uses it. I can add it to the assembly through a subdirectory. But the problem is that when I make changes to the cmake project, it goes through the new one, in which there are no changes, respectively. How can I make cmake just build the project and just link the lib to the project? In fact, I just need to check the existence of a lib. I tried this: if(NOT EXIST path/to/lib.a) //adding a lib through the subdirectory It sees the existence of the file, but one fig time is not reduced and the method is clumsy. For example, when I add some lib through find_package, it does not rebuild it every time and the project build is fast.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2021-04-12
@Mars36

The answer is in the comments here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question