Ask Your Question
1

How can the configuration of directory "B" be made to rely on the build of directory "A" in CMake?

asked 2023-07-08 15:33:20 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-08 15:41:02 +0000

huitzilopochtli gravatar image

To make the configuration of directory "B" rely on the build of directory "A" in CMake, we need to use the add_dependencies command in CMake.

In the CMakeLists.txt file of directory "B", we need to add the following line:

add_dependencies(B A)

This tells CMake that the target "B" depends on the target "A" and that "A" must be built before "B".

It's important to note that "A" must be a target defined in the CMakeLists.txt file of directory "A" and that the name "A" should be replaced with the actual name of the target.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-08 15:33:20 +0000

Seen: 13 times

Last updated: Jul 08 '23