Supported shared library on cmake.

Updated the documentation.
This commit is contained in:
Takatoshi Kondo 2014-06-07 00:13:23 +09:00
parent 06930616b2
commit 643b0c9523
2 changed files with 39 additions and 7 deletions

View File

@ -117,11 +117,19 @@ INCLUDE_DIRECTORIES (
${CMAKE_CURRENT_BINARY_DIR}/src/msgpack/
)
ADD_LIBRARY (msgpack
ADD_LIBRARY (msgpack SHARED
${msgpack_SOURCES}
${msgpack_HEADERS}
)
ADD_LIBRARY (msgpack-static STATIC
${msgpack_SOURCES}
${msgpack_HEADERS}
)
SET_TARGET_PROPERTIES (msgpack-static PROPERTIES OUTPUT_NAME "msgpack")
SET_TARGET_PROPERTIES (msgpack PROPERTIES IMPORT_SUFFIX "_import.lib")
IF (MSGPACK_BUILD_TESTS)
ENABLE_TESTING ()
ADD_SUBDIRECTORY (test)

View File

@ -26,6 +26,7 @@ To report an issue, use the [msgpack-c issue tracker](https://github.com/msgpack
#### Install from git repository
##### Using autotools
You will need gcc (4.1.0 or higher), autotools.
```
@ -37,6 +38,16 @@ $ make
$ sudo make install
```
##### Using cmake
You will need gcc (4.1.0 or higher), cmake.
```
$ git clone https://github.com/msgpack/msgpack-c.git
$ cd msgpack-c
$ cmake .
$ make
```
#### Install from package
##### UNIX-like platform with ./configure
@ -79,16 +90,29 @@ $ sudo brew install msgpack
##### Windows
On Windows, download source package from [here](https://sourceforge.net/projects/msgpack/files/) and extract it. Open `msgpack_vc8.vcproj` or msgpack_vc2008 file and build it using batch build. It builds libraries in `lib/` folder and header files in `include/` folder.
You can build using command line as follows:
Clone msgpack-c git repository.
```
> vcbuild msgpack_vc2008.vcproj
> dir lib % DLL files are here
> dir include % header files are here
$ git clone https://github.com/msgpack/msgpack-c.git
```
or using GUI git client.
e.g.) tortoise git https://code.google.com/p/tortoisegit/
Launch cmake GUI client. http://www.cmake.org/cmake/resources/software.html
Set 'Where is the source code:' text box and 'Where to build the binaries:' text box.
Click 'Configure' button.
Choose your Visual Studio version.
Click 'Generate' button.
Open the created msgpack.sln on Visual Studio.
Build all.
### Linking with an Application