Simplified doc-site generation
[AGL/documentation.git] / docs / 3_Developer_Guides / 3_Using_the_CMAKE_Applications_Module / 5_Project_Architecture.md
1 ---
2 edit_link: ''
3 title: Project Architecture
4 origin_url: >-
5   https://git.automotivelinux.org/src/cmake-apps-module/plain/docs/dev_guide/project-architecture.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/cmake-apps-module-guides-devguides-book.yml -->
9
10 # Project Architecture
11
12 The following tree structure represents a typical CMake project
13 directory structure:
14
15 ```tree
16 <project-root-path>
17 |
18 ├── CMakeLists.txt
19
20 ├── autobuild/
21 │   ├── agl
22 │   │   └── autobuild
23 │   ├── linux
24 │   │   └── autobuild
25 │   └── windows
26 │       └── autobuild
27 ├── conf.d/
28 │   ├── packaging/
29 │   │   ├── rpm
30 │   │   │   └── package.spec
31 │   │   └── deb
32 │   │       ├── package.dsc
33 │   │       ├── debian.package.install
34 │   │       ├── debian.changelog
35 │   │       ├── debian.compat
36 │   │       ├── debian.control
37 │   │       └── debian.rules
38 │   ├── cmake
39 │   │   ├── 00-debian-osconfig.cmake
40 │   │   ├── 00-suse-osconfig.cmake
41 │   │   ├── 01-default-osconfig.cmake
42 │   │   └── config.cmake
43 │   └── wgt
44 │       ├── icon.png
45 │       └── config.xml.in
46 ├── <target>
47 │   └── <files>
48 ├── <target>
49 │   └── <file>
50 └── <target>
51     └── <files>
52 ```
53
54 | File or Directory | Parent | Description |
55 |----|----|----|
56 | *root_path* | n/a | CMake project root path. Holds the master CMakeLists.txt file and all general project files.
57 | CMakeLists.txt | The master CMakeLists.txt file.
58 | autobuild/ | *root_path* | Scripts generated from app-templates to build packages the same way for differents platforms.
59 | conf.d/ | *root_path* | Holds needed files to build, install, debug, and package an AGL application project.
60 | packaging/ | conf.d/ | Contains output files used to build packages.
61 | cmake/ | conf.d/ | Minimally contains the config.cmake file, which is modified from the sample provided in the app-templates submodule.
62 | wgt/ | conf.d/ | Contains config.xml.in and optionaly the test-config.xml.in template files that are modified from the sample provided with the CMake module for the needs of the project.  For more details, see the config.xml.in.sample and test-config.xml.in.sample files.
63 | *target* | *root_path* | A target to build, which is typically a library or executable.
64
65 When building projects using CMake, the build process automatically detects
66 the `CMakeLists.txt` and `*.cmake` files.
67 To help with this process, the `PROJECT_SRC_DIR_PATTERN` variable
68 is used for recursive pattern searching from the CMake project's
69 *root_path* downward.
70 Each sub-folder below *root_path* in the project is searched and included
71 during compilation.
72 The directories matching the pattern `PROJECT_SRC_DIR_PATTERN` variable
73 are scanned.
74
75 **NOTE:** The `PROJECT_SRC_DIR_PATTERN` variable defaults to "*".
76
77 When the `CMakeLists.txt` file is found, the directory in which it is found
78 is automatically added to the CMake project.
79
80 Similarly, when a file whose extension is `.cmake` is found, the directory in
81 which that file resides is also added to the CMake project.
82
83
84