summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorov-l <186710607+ov-l@users.noreply.github.com>2024-12-03 18:50:11 +0100
committerGitHub <noreply@github.com>2024-12-03 17:50:11 +0000
commit5d8cf475b352ab517c565ccee59461640da63a2a (patch)
tree8e9a311cc712df112ffe290821751b0276e10f97 /docs
parent6c655ca927a440d1f03339295235fce2a764c26b (diff)
Add SlangConfig.cmake with slang build targets (#5674)
* Modify package config * Apply formatting. * Make sure build works for Emscripten * Add documentation on install target. --------- Co-authored-by: obhi-d <obi.de.online@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/building.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/building.md b/docs/building.md
index 0f76bb780..ea40be212 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -110,6 +110,31 @@ cmake --build --preset emscripten --target slang-wasm
> Note: If the last build step fails, try running the command that `emcmake`
> outputs, directly.
+## Installing
+
+Build targets may be installed using cmake:
+
+```bash
+cmake --build . --target install
+```
+
+This should install `SlangConfig.cmake` that should allow `find_package` to work.
+SlangConfig.cmake defines `SLANG_EXECUTABLE` variable that will point to `slangc`
+executable and also define `slang::slang` target to be linked to.
+
+For now, `slang::slang` is the only exported target defined in the config which can
+be linked to.
+
+Example usage
+
+```cmake
+find_package(slang REQUIRED PATHS ${your_cmake_install_prefix_path} NO_DEFAULT_PATH)
+# slang_FOUND should be automatically set
+target_link_libraries(yourLib PUBLIC
+ slang::slang
+)
+```
+
## Testing
```bash