Giter Site home page Giter Site logo

cmakedemos's Introduction

CMakeDemo

一个简单易懂的CMake教程,主要包含:

  1. 在项目中添加自定义的共享库
  2. 在项目中引用第三方开源库

命令

编译可执行文件my_math_test

mkdir build
cd build
cmake ..
make -j 4

or

cmake -B build
cmake --build build

安装my_math_test

make install

or

 sudo cmake  --build build -- install

执行测试用例

$ cmake --build build -- test
Running tests...
Test project /data/jmtang/codes/CMakeDemos/build
    Start 1: example_test
1/1 Test #1: example_test .....................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.01 sec
$ ./build/test/simple_test 
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from MyMathTest
[ RUN      ] MyMathTest.vector_sum
[       OK ] MyMathTest.vector_sum (0 ms)
[----------] 1 test from MyMathTest (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

文字版教程

CMake引用自定义库和第三方库

cmakedemos's People

Contributors

russyyds 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.