link library to all targets in cmake project

后端 未结 2 1070
夕颜
夕颜 2021-01-19 21:51

Let me describe what I think is a sufficiently common use case, that it should be supported. Consider a project which consists of a library and a set of executable that use

相关标签:
2条回答
  • 2021-01-19 22:38

    As mentioned at https://stackoverflow.com/a/50295894/129550 the requested link_libraries(example example2) function is actually now a part of cmake.

    0 讨论(0)
  • 2021-01-19 22:51

    This answer might be obsolete:
    Check the new set of variables CMAKE_<LANG>_STANDARD_LIBRARIES

    Original Answer: It appears that now a CMAKE_STANDARD_LIBRARIES variable exists, where you can append the libraries according to your need. However, this variable seemingly expect full path to the libraries.

    See here.

    0 讨论(0)
提交回复
热议问题