CMake: Attempted to add link library to target which is not built in this directory

前端 未结 1 1686
傲寒
傲寒 2021-01-17 13:02

I\'m having a an issue compiling some unit tests in my cmake project. The idea is to add these boost unit tests as executables, so that I can then run them. Anyway I\'m gett

1条回答
  •  臣服心动
    2021-01-17 13:28

    The target_link_libraries directive needs to be part of the same CMakeLists.txt as the add_executable directive. This also applies to libraries. Think of each directory and associated CMakeLists.txt as a subproject.

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