且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

《Cmake 实践》【初试 cmake – cmake 的 helloworld】CMakeLists.txt错误

更新时间:2022-08-21 16:18:56

书中所写CMakeLists.txt截图:

《Cmake 实践》【初试 cmake – cmake 的 helloworld】CMakeLists.txt错误

构建时报错:

《Cmake 实践》【初试 cmake – cmake 的 helloworld】CMakeLists.txt错误

原因:最后一行引用SRC_LIST变量需要添加${}符号,正确的代码如下:

《Cmake 实践》【初试 cmake – cmake 的 helloworld】CMakeLists.txt错误

再次构建成功

《Cmake 实践》【初试 cmake – cmake 的 helloworld】CMakeLists.txt错误


      本文转自dongsong1117 51CTO博客,原文链接:http://blog.51cto.com/dongsong/1594003,如需转载请自行联系原作者