Home > Back-end >  The question of cmake
The question of cmake

Time:09-22

Target_link_libraries and add_dependencies
What is the difference between the two?

CodePudding user response:

TARGET_LINK_LIBRARIES
TARGET_LINK_LIBRARIES (target lib1 lib2...).
Added to target need to link the Shared library
ADD_DEFINITIONS
To the C/C + + compiler to add definition - D
ADD_DEFINITIONS (- DENABLE_DEBUG - DABC), separated by a space between the parameters of
ADD_DEPENDENCIES
ADD_DEPENDENCIES (target - the name depend - target1 depend - target2...).
Define the target depend on other target, ensure the target before building, its dependence on target is built
  • Related