Skip to content

Commit 643b0c9

Browse files
committed
Supported shared library on cmake.
Updated the documentation.
1 parent 0693061 commit 643b0c9

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,19 @@ INCLUDE_DIRECTORIES (
117117
${CMAKE_CURRENT_BINARY_DIR}/src/msgpack/
118118
)
119119

120-
ADD_LIBRARY (msgpack
120+
ADD_LIBRARY (msgpack SHARED
121121
${msgpack_SOURCES}
122122
${msgpack_HEADERS}
123123
)
124124

125+
ADD_LIBRARY (msgpack-static STATIC
126+
${msgpack_SOURCES}
127+
${msgpack_HEADERS}
128+
)
129+
130+
SET_TARGET_PROPERTIES (msgpack-static PROPERTIES OUTPUT_NAME "msgpack")
131+
SET_TARGET_PROPERTIES (msgpack PROPERTIES IMPORT_SUFFIX "_import.lib")
132+
125133
IF (MSGPACK_BUILD_TESTS)
126134
ENABLE_TESTING ()
127135
ADD_SUBDIRECTORY (test)

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ To report an issue, use the [msgpack-c issue tracker](https://github.com/msgpack
2626

2727
#### Install from git repository
2828

29+
##### Using autotools
2930
You will need gcc (4.1.0 or higher), autotools.
3031

3132
```
@@ -37,6 +38,16 @@ $ make
3738
$ sudo make install
3839
```
3940

41+
##### Using cmake
42+
You will need gcc (4.1.0 or higher), cmake.
43+
44+
```
45+
$ git clone https://github.com/msgpack/msgpack-c.git
46+
$ cd msgpack-c
47+
$ cmake .
48+
$ make
49+
```
50+
4051
#### Install from package
4152

4253
##### UNIX-like platform with ./configure
@@ -79,16 +90,29 @@ $ sudo brew install msgpack
7990

8091
##### Windows
8192

82-
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.
83-
84-
You can build using command line as follows:
93+
Clone msgpack-c git repository.
8594

8695
```
87-
> vcbuild msgpack_vc2008.vcproj
88-
> dir lib % DLL files are here
89-
> dir include % header files are here
96+
$ git clone https://github.com/msgpack/msgpack-c.git
9097
```
9198

99+
or using GUI git client.
100+
101+
e.g.) tortoise git https://code.google.com/p/tortoisegit/
102+
103+
Launch cmake GUI client. http://www.cmake.org/cmake/resources/software.html
104+
105+
Set 'Where is the source code:' text box and 'Where to build the binaries:' text box.
106+
107+
Click 'Configure' button.
108+
109+
Choose your Visual Studio version.
110+
111+
Click 'Generate' button.
112+
113+
Open the created msgpack.sln on Visual Studio.
114+
115+
Build all.
92116

93117
### Linking with an Application
94118

0 commit comments

Comments
 (0)