4

请教 cmake 中如何兼容不同的编译环境

 3 years ago
source link: https://www.v2ex.com/t/799826
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  C++

请教 cmake 中如何兼容不同的编译环境

  Yc1992 · 17 小时 42 分钟前 · 631 次点击
举个例子,我同时需要在 linux 和 macos 上编译一个 c++ 的程序,但是静态库的路径是不一样的。

目前我的做法是在 cmakelists.txt 中同时硬编码两个不同环境的静态库路径,编译的时候注释掉 linux 的库路径来编译 macos 平台的程序这样,但是我觉得应该有更好的办法,不知道谁能告知一下,谢谢

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK