]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/zstd/build/cmake/README.md
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / zstd / build / cmake / README.md
index 681b14cef3940eac48ecf57d43303ed5959d6ca2..73b30dc773bd82462a327b89430884d51c749d27 100644 (file)
@@ -5,9 +5,48 @@ use case sensitivity that matches modern (ie. cmake version 2.6 and above)
 conventions of using lower-case for commands, and upper-case for
 variables.
 
-# CMake Style Recommendations
+## How to build
+
+As cmake doesn't support command like `cmake clean`, it's recommended to perform a "out of source build".
+To do this, you can create a new directory and build in it:
+```sh
+cd build/cmake
+mkdir builddir
+cd builddir
+cmake ..
+make
+```
+Then you can clean all cmake caches by simply delete the new directory:
+```sh
+rm -rf build/cmake/builddir
+```
+
+And of course, you can directly build in build/cmake:
+```sh
+cd build/cmake
+cmake
+make
+```
+
+To show cmake build options, you can:
+```sh
+cd build/cmake/builddir
+cmake -LH ..
+```
+
+Bool options can be set to `ON/OFF` with `-D[option]=[ON/OFF]`. You can configure cmake options like this:
+```sh
+cd build/cmake/builddir
+cmake -DZSTD_BUILD_TESTS=ON -DZSTD_LEGACY_SUPPORT=ON ..
+make
+```
+
+### referring
+[Looking for a 'cmake clean' command to clear up CMake output](https://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output)
+
+## CMake Style Recommendations
 
-## Indent all code correctly, i.e. the body of
+### Indent all code correctly, i.e. the body of
 
  * if/else/endif
  * foreach/endforeach
@@ -18,7 +57,7 @@ variables.
 Use spaces for indenting, 2, 3 or 4 spaces preferably. Use the same amount of
 spaces for indenting as is used in the rest of the file. Do not use tabs.
 
-## Upper/lower casing
+### Upper/lower casing
 
 Most important: use consistent upper- or lowercasing within one file !
 
@@ -38,7 +77,7 @@ Add_Executable(hello hello.c)
 aDd_ExEcUtAbLe(blub blub.c)
 ```
 
-## End commands
+### End commands
 To make the code easier to read, use empty commands for endforeach(), endif(),
 endfunction(), endmacro() and endwhile(). Also, use empty else() commands.
 
@@ -60,6 +99,6 @@ if(BARVAR)
 endif(BARVAR)
 ```
 
-## Other resources for best practices
+### Other resources for best practices
 
-`https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#modules`
+https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#modules