CMake: How to add .def file to Visual Studio proje

2019-07-18 13:55发布

How to add .def file to Visual Studio project filters (*.filters file)? Visual Studio consumes .def file.

CMake code:

set(a_src a.cpp a.def)
add_library(a SHARED ${a_src})

In solution and then in project there is no a.def file in filters, only a.cpp. But CMake generates a rule for .def file (/DEF:a.def option to linker).

Is there any way to show .def files in the project filters (a.filters file near the project)?

1条回答
贪生不怕死
2楼-- · 2019-07-18 13:56

This is a CMake bug. It is reported in their tracker at http://www.cmake.org/Bug/view.php?id=15313

查看更多
登录 后发表回答