我知道如何根据构建配置是Debug还是Release. 我用:
foreach(dep ${DEPENDENCIES})
target_link_libraries (${PROJECT_NAME}
debug ${dep}_d
optimized ${dep}
)
endforeach(dep)
Debug, Release, RelWithDebugInfo, MinSizeReleaseCMake 默认在 VS2010 ( )中创建 4 个构建配置。但是如何定义用于RelWithDebugInfo配置的taget链接库呢?
Bakcground:
我只使用Debug,Release和RelWithDebugInfo. 我的调试库有后缀_d,其他的没有后缀。Release所以从和输出文件RelWithDebugInfo是相同的。有时当我构建RelWithDebugInfo然后Release一些输出文件没有被覆盖,因此加载了坏的文件并且程序崩溃了。我想通过在配置中添加一些其他后缀来解决这个问题RelWithDebugInfo。