aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMAKE.md
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2017-11-20 14:38:44 -0800
committerGravatar GitHub <noreply@github.com>2017-11-20 14:38:44 -0800
commit1670f1c5ddf1d9b4fab6b9b6d0e00323af48e967 (patch)
tree98eb2ba2de062ed5b6564db306e2453b75c1dd88 /CMAKE.md
parent4a1f29b9b3f742cc722af9f5f2a77e3aad89022e (diff)
Initial CMake-based build (#472)
Initial CMake-based build This knows how to download and build googletest.
Diffstat (limited to 'CMAKE.md')
-rw-r--r--CMAKE.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/CMAKE.md b/CMAKE.md
new file mode 100644
index 0000000..09ce143
--- /dev/null
+++ b/CMAKE.md
@@ -0,0 +1,62 @@
+# Building with CMake
+
+Some portions of this repository are portable beyond iOS and can be built using
+CMake.
+
+## Dependencies
+
+You need:
+ * A C++ compiler
+ * `cmake`
+
+### macOS
+
+You need [Xcode](https://developer.apple.com/xcode/), which you can get from
+the Mac App Store.
+
+You can get other development tools via [homebrew](https://brew.sh). Adjust as
+needed for other package managers.
+```
+brew install cmake
+```
+
+### Ubuntu
+
+Ubuntu Trusty includes CMake 2.8.12 which should be sufficient. Newer versions
+are fine too.
+
+```
+sudo apt-get install cmake
+```
+
+### Windows
+
+An easy way to get development tools is via [Chocolatey](https://chocolatey.org/).
+
+Unfortunately, the `cmake.install` package is semi-broken, so use the portable
+version.
+
+```
+choco install cmake.portable
+```
+
+## Setup
+
+CMake builds out-of source, so create a separate build directory for the target
+you want to work on.
+
+```
+mkdir build
+cd build
+cmake ..
+```
+
+## Testing
+
+Once CMake has run once, you can just run `make` repeatedly and it will
+regenerate Makefiles as needed.
+
+To build everything and run tests:
+```
+make -j all test
+```