code:work:generic:cmake:start
This is an old revision of the document!
Table of Contents
Layout
- https://cliutils.gitlab.io/modern-cmake/chapters/basics/structure.html ← good example layout
Example Structure Build
Sample structure layout
- project
- bin
- utils
- tests
- hello_world
- build
- include
- lib
- make a folder for your project and here is the top layer CMakeLists.txt file
project(lvis24) cmake_minimum_required(VERSION 3.0) add_subdirectory( bin )
- create a .gitignore to exclude build folder so repos/project/.gitignore should contain this
# ignore the build directory build/*
- CMakeLists.txt in bin
add_subdirectory( tests )
- CMakeLists.txt in tests
add_subdirectory( hello_world )
Now you can compile it all by
- going to ~/project/build
- cmake ..
- build
Example With Lib
- lvis24_cmake_source_tree_example.tar.gz very basic hello world and hello world library cmake skeleton example.
code/work/generic/cmake/start.1723568018.txt.gz · Last modified: 2024/08/13 16:53 by david