Pārlūkot izejas kodu

Added cmake compile info

TheOnlyJoey 9 gadi atpakaļ
vecāks
revīzija
7015410d4a
1 mainītis faili ar 21 papildinājumiem un 1 dzēšanām
  1. 21 1
      README.md

+ 21 - 1
README.md

@@ -15,7 +15,8 @@ OpenHMD is released under the permissive Boost Software License (see LICENSE for
   * FreeBSD
 
 ## Requirements
-  * GNU Autotools (if you're building from the git repository)
+  * Option 1: GNU Autotools (if you're building from the git repository)
+  * Option 2: CMake
   * HIDAPI
     * http://www.signal11.us/oss/hidapi/
     * https://github.com/signal11/hidapi/
@@ -32,11 +33,22 @@ OpenHMD is released under the permissive Boost Software License (see LICENSE for
   * libvr - http://hg.sitedethib.com/libvr
 
 ## Compiling and Installing
+Using make:
+
     ./autogen.sh # (if you're building from the git repository)
     ./configure [--enable-openglexample]
     make
     sudo make install
 
+Using CMake:
+
+With CMake, you can enable and disable drivers to compile OpenHMD with.
+Current Available drivers are: OPENHMD_DRIVER_OCULUS_RIFT and OPENHMD_DRIVER_EXTERNAL.
+These can be enabled or disabled adding -DDRIVER_OF_CHOICE=ON after the cmake command (or using cmake-gui).
+
+    cmake .
+    make
+
 ### Configuring udev on Linux
 To avoid having to run your applications as root to access USB devices you have to add a udev rule (this will be included in .deb packages, etc).
 
@@ -49,11 +61,19 @@ After this you have to unplug your Rift and plug it back in. You should now be a
 
 
 ### Cross compiling for windows using mingw
+Using Make:
+
     export PREFIX=/usr/i686-w64-mingw32/ (or whatever your mingw path is)
     PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig ./configure --build=`gcc -dumpmachine` --host=i686-w64-mingw32 --prefix=$PREFIX
     make
 the library will end up in the .lib directory, you can use microsoft's lib.exe to make a .lib file for it
 
+Using CMake:
+
+For MinGW cross compiling, toolchain files tend to be the best solucion.
+Please check the CMake documentation on how to do this.
+A starting point might be the CMake wiki: http://www.vtk.org/Wiki/CmakeMingw
+
 ### Static linking on windows
 If you're linking statically with OpenHMD using windows/mingw you have to make sure the macro OHMD_STATIC is set before including openhmd.h. In GCC this can be done by adding the compiler flag -DOHMD_STATIC, and with msvc it can be done using /DOHMD_STATIC.