modify cmake guide in README

cmake in build dir is recommand by officially.

Signed-off-by: Ralph Giles <giles@thaumas.net>
This commit is contained in:
willson-chen 2019-08-29 19:33:45 +08:00 committed by Ralph Giles
parent 6d55ddf64b
commit c2c2f75571
No known key found for this signature in database
GPG Key ID: 9259A8F2D2D44C84

View File

@ -92,12 +92,14 @@ be found in those source modules' README files)
Ogg supports building using [CMake](http://www.cmake.org/). CMake is a meta build system that generates native projects for each platform. Ogg supports building using [CMake](http://www.cmake.org/). CMake is a meta build system that generates native projects for each platform.
To generate projects just run cmake replacing `YOUR-PROJECT-GENERATOR` with a proper generator from a list [here](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html): To generate projects just run cmake replacing `YOUR-PROJECT-GENERATOR` with a proper generator from a list [here](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html):
cmake -G YOUR-PROJECT-GENERATOR . mkdir build
cd build
cmake -G YOUR-PROJECT-GENERATOR ..
Note that by default cmake generates projects that will build static libraries. Note that by default cmake generates projects that will build static libraries.
To generate projects that will build dynamic library use `BUILD_SHARED_LIBS` option like this: To generate projects that will build dynamic library use `BUILD_SHARED_LIBS` option like this:
cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 . cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 ..
After projects are generated use them as usual After projects are generated use them as usual
@ -105,19 +107,19 @@ After projects are generated use them as usual
Use proper generator for your Visual Studio version like: Use proper generator for your Visual Studio version like:
cmake -G "Visual Studio 12 2013" . cmake -G "Visual Studio 12 2013" ..
#### Building on Mac OS X #### #### Building on Mac OS X ####
Use Xcode generator. To build framework run: Use Xcode generator. To build framework run:
cmake -G Xcode -DBUILD_FRAMEWORK=1 . cmake -G Xcode -DBUILD_FRAMEWORK=1 ..
#### Building on Linux #### #### Building on Linux ####
Use Makefile generator which is default one. Use Makefile generator which is default one.
cmake . cmake ..
make make
## License ## ## License ##