`
aigo
  • 浏览: 2541837 次
  • 性别: Icon_minigender_1
  • 来自: 宜昌
社区版块
存档分类
最新评论

[cmake]target_link_libraries参数:PRIVATE、PUBLIC、INTERFACE三者区别

阅读更多

 

原文:

CMake target_link_libraries Interface Dependencies

http://stackoverflow.com/questions/26037954/cmake-target-link-libraries-interface-dependencies

 

 

If you are creating a shared library and your source cpp files #include the headers of another library (Say, QtNetwork for example), but your header files don't include QtNetwork headers, then QtNetwork is a PRIVATE dependency.

 

If your source files and your headers include the headers of another library, then it is a PUBLIC dependency.

 

If your header files but not your source files include the headers of another library, then it is an INTERFACE dependency.

 

Other build properties of PUBLIC and INTERFACE dependencies are propagated to consuming libraries. http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#transitive-usage-requirements

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics