Browse code

Add project

Robert Cranston authored on 22/12/2021 10:42:11
Showing 1 changed files
... ...
@@ -7,6 +7,94 @@ A [GLSL][]/[OpenGL][] [\>=2.0][] hash and noise function library.
7 7
 [OpenGL]: https://en.wikipedia.org/wiki/OpenGL
8 8
 [\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history
9 9
 
10
+## Build system
11
+
12
+This project has support for [CMake][], and uses [`cmake-cxx`][].
13
+
14
+There are several ways to use this project in another CMake-based project:
15
+
16
+-   Use [`FetchContent`][] to download it and import the targets automatically
17
+    as part of the configure step:
18
+
19
+    ```cmake
20
+    include(FetchContent)
21
+    FetchContent_Declare(project-name
22
+        GIT_REPOSITORY https://example.com/user/project-name
23
+    )
24
+    FetchContent_MakeAvailable(
25
+        project-name
26
+    )
27
+    ```
28
+
29
+-   Bundle it and import the targets with [`add_subdirectory`][].
30
+
31
+-   Use [`find_package`][] (requires that the project is [packaged](#packaging)
32
+    or [installed](#installing)).
33
+
34
+As usual, use [`add_dependencies`][]/[`target_link_libraries`][] to declare the
35
+dependency.
36
+
37
+[CMake]: https://cmake.org
38
+[`cmake-cxx`]: https://git.rcrnstn.net/rcrnstn/cmake-cxx
39
+[`FetchContent`]: https://cmake.org/cmake/help/v3.14/module/FetchContent.html
40
+[`add_subdirectory`]: https://cmake.org/cmake/help/v3.14/command/add_subdirectory.html
41
+[`find_package`]: https://cmake.org/cmake/help/v3.14/command/find_package.html
42
+[`add_dependencies`]: https://cmake.org/cmake/help/v3.14/command/add_dependencies.html
43
+[`target_link_libraries`]: https://cmake.org/cmake/help/v3.14/command/target_link_libraries.html
44
+
45
+### Configure and generate
46
+
47
+To configure and generate a build tree, use `cmake`:
48
+
49
+```sh
50
+cmake -B build
51
+```
52
+
53
+To set the [`CMAKE_BUILD_TYPE`][], pass e.g. `-DCMAKE_BUILD_TYPE=Release`.
54
+
55
+[`cmake`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#generate-a-project-buildsystem
56
+[`CMAKE_BUILD_TYPE`]: https://cmake.org/cmake/help/v3.14/variable/CMAKE_BUILD_TYPE.html
57
+
58
+### Build
59
+
60
+To build, use [`cmake --build`][]:
61
+
62
+```sh
63
+cmake --build build
64
+```
65
+
66
+[`cmake --build`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#build-a-project
67
+
68
+### Test
69
+
70
+To run tests, use [`ctest`][]:
71
+
72
+```sh
73
+(cd build && ctest --output-on-failure)
74
+```
75
+
76
+[`ctest`]: https://cmake.org/cmake/help/v3.14/manual/ctest.1.html
77
+
78
+### Package
79
+
80
+To package, use [`cpack`][]:
81
+
82
+```sh
83
+(cd build && cpack)
84
+```
85
+
86
+[`cpack`]: https://cmake.org/cmake/help/v3.14/manual/cpack.1.html
87
+
88
+### Install
89
+
90
+To install onto the current system, use [`cmake --install`][]:
91
+
92
+```sh
93
+cmake --install build
94
+```
95
+
96
+[`cmake --install`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#install-a-project
97
+
10 98
 ## License
11 99
 
12 100
 Licensed under the [ISC License][] unless otherwise noted, see the
Browse code

Add license

Robert Cranston authored on 17/12/2021 08:35:45
Showing 1 changed files
... ...
@@ -6,3 +6,10 @@ A [GLSL][]/[OpenGL][] [\>=2.0][] hash and noise function library.
6 6
 [GLSL]: https://en.wikipedia.org/wiki/OpenGL_Shading_Language
7 7
 [OpenGL]: https://en.wikipedia.org/wiki/OpenGL
8 8
 [\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history
9
+
10
+## License
11
+
12
+Licensed under the [ISC License][] unless otherwise noted, see the
13
+[`LICENSE`](LICENSE) file.
14
+
15
+[ISC License]: https://choosealicense.com/licenses/isc/
Browse code

Add readme

Robert Cranston authored on 17/12/2021 08:34:30
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+# [`glhashnoise`][]
2
+
3
+A [GLSL][]/[OpenGL][] [\>=2.0][] hash and noise function library.
4
+
5
+[`glhashnoise`]: https://git.rcrnstn.net/rcrnstn/glhashnoise
6
+[GLSL]: https://en.wikipedia.org/wiki/OpenGL_Shading_Language
7
+[OpenGL]: https://en.wikipedia.org/wiki/OpenGL
8
+[\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history