使用CMake建立一个跨平台库? [英] Making a cross platform library with CMake?
问题描述
CMake难以使用?我一直在开发一个使用Windows和MSVC ++的库。
Is CMake difficult to use? I've been developing a library using Windows and MSVC++ . I tested my code in Linux and OSX by tediously making objects from each file and making a library out of this.
我有几个目录,例如:
Agui
-> Widgets
->Button
->ListBox
-> Backends
-> Allegro
我想要的是,例如,如果我在Windows上,
And what I'd like is, for example, if I'm on Windows, it auto generates an msvc project with all these directories and files included and ready to be compiled.
在Linux和OSX上,我希望能够执行类似于
On Linux and OSX I'd like to be able to do something like
cmake
make
给我的情况容易做。
感谢
is this possible with CMake, and easy to do given my situation. Thanks
推荐答案
是的,这正是CMake的原因。 巨大的项目像KDE使用CMake。
它很容易设置。
Yes, that is exactly the reason CMake is made for. Huge projects like KDE use CMake. And its easy to setup.
这篇关于使用CMake建立一个跨平台库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!