aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-06-06 21:55:55 +0300
committerGitHub <noreply@github.com>2019-06-06 21:55:55 +0300
commit266b297515f0e6d0e864564a2fc2f079e829a033 (patch)
tree79d0cacab38ea2919ee52786ac601aa7ba80fe10 /docs/markdown/snippets
parent7561926a70e1920c6ff8754ee1a66ab0bc3ff431 (diff)
parent9a9ea1434ab4d204d73503a61d5c1a044ce07366 (diff)
downloadmeson-266b297515f0e6d0e864564a2fc2f079e829a033.zip
meson-266b297515f0e6d0e864564a2fc2f079e829a033.tar.gz
meson-266b297515f0e6d0e864564a2fc2f079e829a033.tar.bz2
Merge pull request #4969 from mensinda/cmakeSubProject
CMake subprojects
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/cmake_subprojects.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/markdown/snippets/cmake_subprojects.md b/docs/markdown/snippets/cmake_subprojects.md
new file mode 100644
index 0000000..07ff868
--- /dev/null
+++ b/docs/markdown/snippets/cmake_subprojects.md
@@ -0,0 +1,30 @@
+## CMake subprojects
+
+Meson can now directly consume CMake based subprojects with the
+CMake module.
+
+Using CMake subprojects is similar to using the "normal" meson
+subprojects. They also have to be located in the `subprojects`
+directory.
+
+Example:
+
+```cmake
+add_library(cm_lib SHARED ${SOURCES})
+```
+
+```meson
+cmake = import('cmake')
+
+# Configure the CMake project
+sub_proj = cmake.subproject('libsimple_cmake')
+
+# Fetch the dependency object
+cm_lib = sub_proj.dependency('cm_lib')
+
+executable(exe1, ['sources'], dependencies: [cm_lib])
+```
+
+It should be noted that not all projects are guaranteed to work. The
+safest approach would still be to create a `meson.build` for the
+subprojects in question.