0602ea1369934ee343da37e6a92da22b58c3d629
[AGL/documentation.git] / docs / 3_Developer_Guides / 5_Using_CMAKE_Applications_Module / 1_Project_Architecture.md
1 ---
2 title: Project Architecture
3 ---
4
5 The following tree structure represents a typical CMake project
6 directory structure:
7
8 ```tree
9 <project-root-path>
10 |
11 ├── CMakeLists.txt
12
13 ├── autobuild/
14 │   ├── agl
15 │   │   └── autobuild
16 │   ├── linux
17 │   │   └── autobuild
18 │   └── windows
19 │       └── autobuild
20 ├── conf.d/
21 │   ├── packaging/
22 │   │   ├── rpm
23 │   │   │   └── package.spec
24 │   │   └── deb
25 │   │       ├── package.dsc
26 │   │       ├── debian.package.install
27 │   │       ├── debian.changelog
28 │   │       ├── debian.compat
29 │   │       ├── debian.control
30 │   │       └── debian.rules
31 │   ├── cmake
32 │   │   ├── 00-debian-osconfig.cmake
33 │   │   ├── 00-suse-osconfig.cmake
34 │   │   ├── 01-default-osconfig.cmake
35 │   │   └── config.cmake
36 │   └── wgt
37 │       ├── icon.png
38 │       └── config.xml.in
39 ├── <target>
40 │   └── <files>
41 ├── <target>
42 │   └── <file>
43 └── <target>
44     └── <files>
45 ```
46
47 | File or Directory | Parent | Description |
48 |----|----|----|
49 | *root_path* | n/a | CMake project root path. Holds the master CMakeLists.txt file and all general project files.
50 | CMakeLists.txt | The master CMakeLists.txt file.
51 | autobuild/ | *root_path* | Scripts generated from app-templates to build packages the same way for differents platforms.
52 | conf.d/ | *root_path* | Holds needed files to build, install, debug, and package an AGL application project.
53 | packaging/ | conf.d/ | Contains output files used to build packages.
54 | cmake/ | conf.d/ | Minimally contains the config.cmake file, which is modified from the sample provided in the app-templates submodule.
55 | 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.
56 | *target* | *root_path* | A target to build, which is typically a library or executable.
57
58 When building projects using CMake, the build process automatically detects
59 the `CMakeLists.txt` and `*.cmake` files.
60 To help with this process, the `PROJECT_SRC_DIR_PATTERN` variable
61 is used for recursive pattern searching from the CMake project's
62 *root_path* downward.
63 Each sub-folder below *root_path* in the project is searched and included
64 during compilation.
65 The directories matching the pattern `PROJECT_SRC_DIR_PATTERN` variable
66 are scanned.
67
68 **NOTE:** The `PROJECT_SRC_DIR_PATTERN` variable defaults to "*".
69
70 When the `CMakeLists.txt` file is found, the directory in which it is found
71 is automatically added to the CMake project.
72
73 Similarly, when a file whose extension is `.cmake` is found, the directory in
74 which that file resides is also added to the CMake project.