GithubHelp home page GithubHelp logo

use-cmake's Introduction

How to use CMake

如何使用Cmake编译C++项目的示例,参照每个Demo里的CMakeLists文件,有具体注释。

编译方法:进入到当前Demobuild.sh脚本文件所在目录,执行该脚本即可。以Demo_1Demo_8为例:

# Demo_1 
cd Demo_1
sh build.sh


# Demo_8
cd Demo_8/main 
sh build.sh
Demo 示例说明
Demo_01 编译单个文件
Demo_02 同一目录下引用一个头文件的编译
Demo_03 同一目录下引用一个头文件和一个源文件
Demo_04 同一目录下引用多个头文件和源文件的
Demo_05 仅引用一个子目录
Demo_06 引用多个子目录
Demo_07 引用多个子目录,同时引用同一目录下的多个文件
Demo_08 多级目录项目中,引用其他目录的文件进行编译
Demo_09 将编译文件和源代码文件区分开。新建build目录存放相关的编译文件,注意执行build.sh脚本编译后可执行文件是在Demo_9/main/build目录下。
Demo_10 指定可执行文件的生成目录。注意执行build.sh后与Demo_9不同的是可执行文件是在Demo_10/main目录下。
Demo_11 多级目录项目中,引用外部文件夹代码,同时引用子目录的文件进行编译
Demo_12 多级目录项目中,引用外部文件夹代码,同时引用子目录以及同一目录下的文件进行编译

use-cmake's People

Contributors

vitahlin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.