diff options
author | Vitaliy Kirsanov <krokoziabla@yandex-team.ru> | 2019-05-01 01:07:09 +0300 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2019-05-04 11:41:48 +1000 |
commit | 95a94232a8c51f6433f33c2e8f1ae8a84813bb86 (patch) | |
tree | 945c1b75a280ad131d7223724ddcd1a6a656a279 | |
parent | 26cbd97884774b3da3a9f3d859715b47613a9013 (diff) | |
download | flac-95a94232a8c51f6433f33c2e8f1ae8a84813bb86.tar.gz |
Added README description for CMake
-rw-r--r-- | README | 82 |
1 files changed, 82 insertions, 0 deletions
@@ -52,6 +52,7 @@ FLAC - 1.3.2 - Contents - Building with Makefile.lite - Building with MSVC - Building on Mac OS X +- Building with CMake =============================================================================== @@ -252,3 +253,84 @@ Building on Mac OS X If you have Fink or a recent version of OS X with the proper autotools, the GNU flow above should work. + + +=============================================================================== +Building with CMake +=============================================================================== + +CMake is a cross-platform build system. FLAC can be built on Windows, Linux, Mac +OS X using CMake. + +You can use either CMake's CLI or GUI. We recommend you to have a separate build +folder outside the repository in order to not spoil it with generated files. + +CLI +--- + Go to your build folder and run something like this: + + /path/to/flac/build$ cmake /path/to/flac/source + + or e.g. in Windows shell + + C:\path\to\flac\build> cmake \path\to\flac\source + (provided that cmake is in your %PATH% variable) + + That will generate build scripts for the default build system (e.g. Makefiles + for UNIX). After that you start build with a command like this: + + /path/to/flac/build$ make + + And afterwards you can run tests or install the built libraries and headers + + /path/to/flac/build$ make test + /path/to/flac/build$ make install + + If you want use a build system other than default add -G flag to cmake, e.g.: + + /path/to/flac/build$ cmake /path/to/flac/source -GNinja + /path/to/flac/build$ ninja + + or: + + /path/to/flac/build$ cmake /path/to/flac/source -GXcode + + Use cmake --help to see the list of available generators. + + If you have OGG on your system you can tell CMake to use it: + + /path/to/flac/build$ cmake /path/to/flac/source -DWITH_OGG=ON + + If CMake fails to find it you can help CMake by specifying the exact path: + + /path/to/flac/build$ cmake /path/to/flac/source -DWITH_OGG=ON -DOGG_ROOT=/path/to/ogg + + CMake will search for OGG by default so if you don't have it you can tell + cmake to not do so: + + /path/to/flac/build$ cmake /path/to/flac/source -DWITH_OGG=OFF + + Other FLAC's options (e.g. building C++ lib or docs) can also be put to cmake + through -D flag. + +GUI +--- + It is likely that you would prefer to use it on Windows building for Visual + Studio. It's in essence the same process as building using CLI. + + Open cmake-gui. In the window select a source directory (the repository's + root), a build directory (some other directory outside the repository). Then + press button "Configure". CMake will ask you which build system you prefer. + Choose that version of Visual Studio which you have on your system, choose + whether you want to build for x86 or amd64. Press OK. After CMake finishes + press "Generate" button, and after that "Open Project". In response CMake + will launch Visual Studio and open the generated solution. You can use it as + usual but remember that it was generated by CMake. That means that your + changes (e.g. some addidional compile flags) will be lost when you run CMake + next time. + + Again, if you have OGG on your system set WITH_OGG flag in the list of + variables in cmake-gui window before you press "Configure". + + If CMake fails to find MSVC compiler then running cmake-gui from MS Developer + comand prompt should help. |