更新时间:2023-10-17 07:59:34
2.8.12我添加了一个target_compile_options命令来满足这个需求:
In CMake 2.8.12 I added a target_compile_options command to address this need:
http://public.kitware.com/Bug/view.php?id=6493
http://www.cmake.org/cmake/help/git-master/manual/cmake- generator-expressions.7.html
target_compile_options(tgt PRIVATE "/MD$<$<CONFIG:Debug>:d>")
请参阅
更多关于CMAKE_BUILD_TYPE以及生成器表达式更好的几个原因(例如IMPORTED目标配置映射)。
for more relating to CMAKE_BUILD_TYPE and several reasons why the generator expression is better (eg IMPORTED target config mapping).