| 1 | = Building sv8 tools = |
| 2 | |
| 3 | This page shows how to build libmpc using [http://www.cmake.org cmake] with the command line. The examples are from a Linux system, but cmake can be used on Windows to generate msvc project files. You may feel more comfortable using the cmake GUI. |
| 4 | |
| 5 | == Getting the sources == |
| 6 | First, you need the sources. You can browse [source: musepack svn] for a complete view.[[BR]] |
| 7 | libmpc needs libcuefile for reading .cue files to import chapters informations. This is the same libcuefile as in [http://developer.berlios.de/projects/cuetools cuetools], but we made it a standalone library for our use.[[BR]] |
| 8 | Also libreplaygain is needed to build mpcgain application.[[BR]] |
| 9 | So, here we go : |
| 10 | {{{ |
| 11 | $ mkdir musepack |
| 12 | $ cd musepack |
| 13 | $ svn export http://svn.musepack.net/libmpc/trunk libmpc |
| 14 | $ svn export http://svn.musepack.net/libcuefile libcuefile |
| 15 | $ svn export http://svn.musepack.net/libreplaygain libreplaygain |
| 16 | }}} |
| 17 | You now got the sources |
| 18 | |
| 19 | == libcuefile == |
| 20 | === compiling === |
| 21 | Move to the libcuefile directory : |
| 22 | {{{ |
| 23 | $ cd libcuefile |
| 24 | }}} |
| 25 | Generate makefiles : |
| 26 | {{{ |
| 27 | $ cmake -G "Unix Makefiles" |
| 28 | }}} |
| 29 | If you want to build other projects files (ex : msvc), check the available generators on your system using the cmake help command (at the end of the output) : |
| 30 | {{{ |
| 31 | $ cmake --help |
| 32 | cmake version 2.6-patch 2 |
| 33 | |
| 34 | [...] |
| 35 | |
| 36 | The following generators are available on this platform: |
| 37 | Unix Makefiles = Generates standard UNIX makefiles. |
| 38 | CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. |
| 39 | Eclipse CDT4 - Unix Makefiles |
| 40 | = Generates Eclipse CDT 4.0 project files. |
| 41 | KDevelop3 = Generates KDevelop 3 project files. |
| 42 | KDevelop3 - Unix Makefiles = Generates KDevelop 3 project files. |
| 43 | }}} |
| 44 | Now we are ready to build : |
| 45 | {{{ |
| 46 | $ make |
| 47 | }}} |
| 48 | === installing === |
| 49 | There may be a make install command, but the current CMakeLists.txt doesn't properly install the lib (the include dir is not installed). Contributions welcome ! |
| 50 | |
| 51 | == libreplaygain == |
| 52 | === compiling === |
| 53 | Compiling libreplaygain is as easy as libcuefile : |
| 54 | {{{ |
| 55 | $ cd ../libreplaygain |
| 56 | $ cmake -G "Unix Makefiles" |
| 57 | $ make |
| 58 | }}} |
| 59 | === installing === |
| 60 | I fear make install doesn't install the include file heather. |
| 61 | |
| 62 | == libmpc == |
| 63 | === compiling === |
| 64 | Cmake needs to know where to find the two libs above and their includes. It will probably guess right for most of them, but the following values needs to be known : CUEFILE_INCLUDE_DIR, CUEFILE_LIBRARY, REPLAY_GAIN_INCLUDE_DIR and REPLAY_GAIN_LIBRARY.[[BR]] |
| 65 | You can check this : |
| 66 | {{{ |
| 67 | $ cd ../libmpc |
| 68 | $ cmake -L |
| 69 | -- The C compiler identification is GNU |
| 70 | -- Check for working C compiler: /usr/bin/gcc |
| 71 | -- Check for working C compiler: /usr/bin/gcc -- works |
| 72 | -- Detecting C compiler ABI info |
| 73 | -- Detecting C compiler ABI info - done |
| 74 | -- Check if the system is big endian |
| 75 | -- Searching 16 bit integer |
| 76 | -- Looking for sys/types.h |
| 77 | -- Looking for sys/types.h - found |
| 78 | -- Looking for stdint.h |
| 79 | -- Looking for stdint.h - found |
| 80 | -- Looking for stddef.h |
| 81 | -- Looking for stddef.h - found |
| 82 | -- Check size of unsigned short |
| 83 | -- Check size of unsigned short - done |
| 84 | -- Using unsigned short |
| 85 | -- Check if the system is big endian - little endian |
| 86 | CMake Error: The following variables are used in this project, but they are set to NOTFOUND. |
| 87 | Please set them or make sure they are set and tested correctly in the CMake files: |
| 88 | REPLAY_GAIN_LIBRARY |
| 89 | linked by target "mpcgain" in directory /your/path/musepack/libmpc/mpcgain |
| 90 | |
| 91 | -- Configuring incomplete, errors occurred! |
| 92 | -- Cache values |
| 93 | CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4 |
| 94 | CMAKE_BUILD_TYPE:STRING= |
| 95 | CMAKE_INSTALL_PREFIX:PATH=/usr/local |
| 96 | CUEFILE_INCLUDE_DIR:PATH=/your/path/musepack/libcuefile/include |
| 97 | CUEFILE_LIBRARY:FILEPATH=/your/path/musepack/libcuefile/src/libcuefile.a |
| 98 | EXECUTABLE_OUTPUT_PATH:PATH= |
| 99 | LIBRARY_OUTPUT_PATH:PATH= |
| 100 | REPLAY_GAIN_INCLUDE_DIR:PATH=/your/path/musepack/libreplaygain/include |
| 101 | REPLAY_GAIN_LIBRARY:FILEPATH=REPLAY_GAIN_LIBRARY-NOTFOUND |
| 102 | }}} |
| 103 | As you can see REPLAY_GAIN_LIBRARY:FILEPATH was not found on my system. So we say it were to find it : |
| 104 | {{{ |
| 105 | $ cmake -DREPLAY_GAIN_LIBRARY:FILEPATH=/your/path/musepack/libreplaygain/src/libreplaygain.so |
| 106 | }}} |
| 107 | And we are now ready to build : |
| 108 | {{{ |
| 109 | $ make |
| 110 | }}} |
| 111 | All the built executables are found in there respective directories. Note that libmpcdec is not built as a shared library here. Use the autotools build system to build it as a shared library, or provide a patch to build it as static on the Windows platform and shared on others platforms. |
| 112 | |
| 113 | === installing === |
| 114 | Guess what ? |