跨平台控制台应用程序结构 - Windows和Linux的独立项目? [英] Cross platform console app structure - Separate projects for windows and linux?

查看:71
本文介绍了跨平台控制台应用程序结构 - Windows和Linux的独立项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用CMake编写跨平台应用程序时,我有一个代码库,然后当我告诉编译时,Cmake编译目标体系结构的代码库。  

When using CMake to write a cross-platform application, I have one codebase, and then Cmake compiles the codebase for the target architecture when i tell it to compile.  

我是VS for C ++的新手,但它看起来像是"推荐"的制作跨平台应用程序的方法是为每个操作系统创建一个项目。  在每个此类项目中,您可以拥有不同体系结构的配置,但是
基本上至少需要2个项目。  如果您想共享代码,则需要使用"共享项目"的第三个项目。项目类型。  这是正确的吗? 

I'm new to VS for C++, but it looks like the "recommended" approach to making a cross-platform application is two create one project for each OS.  In each such project, you can have configurations for different architectures, but you basically need at least 2 projects.  If you want to share code, you need a third project using the "shared items" project type.   Is this correct? 




推荐答案

CmakeLists.txt文件是Windows,Linux和所有其他受支持目标的单一源项目文件。

The CmakeLists.txt file is the single source project file for Windows, Linux and all other supported targets.


这篇关于跨平台控制台应用程序结构 - Windows和Linux的独立项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆