summaryrefslogtreecommitdiff
path: root/docs/markdown/Include-directories.md
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2017-03-29 15:03:43 -0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-04-26 17:56:33 +0300
commitb371875e02cce2fb3fbb9fbb8f07eb5817ae0e8f (patch)
tree6e1a3c34b1a85479d3b9f42ccd071096e637929b /docs/markdown/Include-directories.md
parent7dc747ea54480c452b913e4bfe682ec67061c9bf (diff)
downloadmeson-b371875e02cce2fb3fbb9fbb8f07eb5817ae0e8f.tar.gz
docs: Import the website and wiki and build with hotdoc
This allows us to more easily have the documentation in sync with the source code as people will have to document new features etc right at the time where they implement it.
Diffstat (limited to 'docs/markdown/Include-directories.md')
-rw-r--r--docs/markdown/Include-directories.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/markdown/Include-directories.md b/docs/markdown/Include-directories.md
new file mode 100644
index 000000000..949bf2c5a
--- /dev/null
+++ b/docs/markdown/Include-directories.md
@@ -0,0 +1,17 @@
+# Include directories
+
+Most `C`/`C++` projects have headers in different directories than sources. Thus you need to specify include directories. Let's assume that we are at some subdirectory and wish to add its `include` subdirectory to some target's search path. To create a include directory object we do this:
+
+```meson
+incdir = include_directories('include')
+```
+
+The `incdir` variable now holds a reference to the `include` subdir. Now we pass that as an argument to a build target:
+
+```meson
+executable('someprog', 'someprog.c', include_directories : incdir)
+```
+
+Note that these two commands can be given in any subdirectories and it will still work. Meson will keep track of the locations and generate proper compiler flags to make it all work.
+
+Another thing to note is that `include_directories` adds both the source directory and corresponding build directory to include path, so you don't have to care.