Skip to content

pllee4/cmake-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmake-tutorial

master

Buy Me a Coffee at ko-fi.com

Build process in C/C++

image

Dependencies

$ sudo apt install build-essential

Get started

$ cd src/app
  • Follow the README.md in each folder of tutorial starting from tutorial1 to tutorial3

Using CMake

  • Make sure you are at top level directory of this repo
$ ls
  • You should be able to see
cmake CMakeLists.txt docs README.md src
  • Now run the following command:
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
  • You should be able to see all the program under build/bin directory

  • To pack the program, currently applicable under cmake version greater than 3.11 in this repo, go to build directory then

$ cpack
  • You should see a .deb package with named cmake_tutorial_1.0.0_architecture for example cmake_tutorial_1.0.0_amd64.deb
$ sudo dpkg -i cmake_tutorial_1.0.0_amd64.deb
  • The package in installed under /opt/cmake_tutorial

References

  • For detail information, kindly refer to cmake guide
  • If you are interested in getting to know how compiler works, this will give some insights.