How to create a cmake header-only library that depends on external header files?

后端 未结 3 363
温柔的废话
温柔的废话 2020-12-30 04:56

I have a project with the following file structure:

project
 |
 |-------> lib1
 |           |----> lib1.h
 |
 |-------> lib2
 |           |---->          


        
3条回答
  •  半阙折子戏
    2020-12-30 05:36

    I've used an empty _only_for_compiling_the_lib.cpp file as the simplest and fastest workaround, but clearly the above solution is strongly advised.

    I simply wasn't aware of INTERFACE keyword.

提交回复
热议问题