File: CMakeLists.txt

package info (click to toggle)
msgpack-c 1.4.2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,448 kB
  • ctags: 23,997
  • sloc: cpp: 74,169; ansic: 6,333; sh: 4,181; makefile: 619
file content (381 lines) | stat: -rw-r--r-- 15,279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.6)
PROJECT (msgpack)

FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.h contents)
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
SET (VERSION_MAJOR ${CMAKE_MATCH_1})
STRING (REGEX MATCH "#define MSGPACK_VERSION_MINOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
SET (VERSION_MINOR ${CMAKE_MATCH_1})
STRING (REGEX MATCH "#define MSGPACK_VERSION_REVISION *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
SET (VERSION_REVISION ${CMAKE_MATCH_1})
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})

SET (prefix ${CMAKE_INSTALL_PREFIX})
SET (exec_prefix "\${prefix}")
SET (libdir "\${exec_prefix}/lib")
SET (includedir "\${prefix}/include")
SET (GNUCXX_STD_SUPPORT_VERSION "4.3")
SET (GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION "4.4")

OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_BOOST "Using boost libraries" OFF)

SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_NIL ${CMAKE_CXX_FLAGS}")
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_CONVERT ${CMAKE_CXX_FLAGS}")

IF (APPLE)
    SET(CMAKE_MACOSX_RPATH ON)
    SET(CMAKE_SKIP_BUILD_RPATH FALSE)
    SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
    LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
    IF ("${isSystemDir}" STREQUAL "-1")
        SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    ENDIF ()
ENDIF ()

IF (MSGPACK_CXX11)
   IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
      SET (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
   ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
      SET (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
   ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
      IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
          MESSAGE ( FATAL_ERROR "MSVC doesn't support C++11.")
      ENDIF ()
   ENDIF ()
ELSE ()
   IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
      IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_STD_SUPPORT_VERSION}) OR
          (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL   ${GNUCXX_STD_SUPPORT_VERSION}))
          SET (CMAKE_CXX_FLAGS "-std=c++03 ${CMAKE_CXX_FLAGS}")
      ENDIF ()
   ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
      SET (CMAKE_CXX_FLAGS "-std=c++03 ${CMAKE_CXX_FLAGS}")
   ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
      IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18)
          SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_CPP03 ${CMAKE_CXX_FLAGS}")
      ENDIF ()
   ENDIF ()
ENDIF ()

IF (MSGPACK_32BIT)
   IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
      SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
      SET (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
      SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
   ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
      SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
      SET (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
      SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
   ENDIF ()
ENDIF ()

IF (MSGPACK_BOOST)
   SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_BOOST ${CMAKE_CXX_FLAGS}")
   SET (Boost_USE_STATIC_LIBS        ON) # only find static libs
   SET (Boost_USE_MULTITHREADED      ON)
   SET (Boost_USE_STATIC_RUNTIME    OFF)
   FIND_PACKAGE (Boost COMPONENTS chrono timer system)
   INCLUDE_DIRECTORIES (
       ${MSGPACK_BOOST_DIR}
   )
ENDIF ()

IF (MSGPACK_CHAR_SIGN)
   SET (CMAKE_C_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_C_FLAGS}")
   SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
ENDIF ()

FILE (GLOB_RECURSE PREDEF_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost/*.h)
FOREACH (F ${PREDEF_FILES})
   SET(M "Converting ${F}")
   MESSAGE(STATUS ${M})
   FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost/${F} CONTENT)
   STRING(REPLACE "BOOST_" "MSGPACK_" CONTENT ${CONTENT})
   STRING(REPLACE "boost/" "msgpack/" CONTENT ${CONTENT})
   FILE (WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/${F} ${CONTENT})
ENDFOREACH ()

FILE (GLOB_RECURSE PREPROCESSOR_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost/*.hpp)
FOREACH (F ${PREPROCESSOR_FILES})
   SET(M "Converting ${F}")
   MESSAGE(STATUS ${M})
   FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost/${F} CONTENT)
   STRING(REPLACE "BOOST_" "MSGPACK_" CONTENT ${CONTENT})
   STRING(REPLACE "boost/" "msgpack/" CONTENT ${CONTENT})
   FILE (WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/${F} ${CONTENT})
ENDFOREACH ()

FIND_PACKAGE (GTest)
FIND_PACKAGE (ZLIB)
FIND_PACKAGE (Threads)
IF (GTEST_FOUND AND ZLIB_FOUND AND THREADS_FOUND)
    OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." ON)
ENDIF ()
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples." ON)

OPTION (MSGPACK_ENABLE_CXX "Enable C++ interface." ON)
OPTION (MSGPACK_ENABLE_SHARED "Build shared libaries in addition to static libraries." ON)

INCLUDE (CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES ("
#include <bits/atomicity.h>
int atomic_sub(int i) { return __gnu_cxx::__exchange_and_add(&i, -1) - 1; }
int atomic_add(int i) { return __gnu_cxx::__exchange_and_add(&i, 1) + 1; }
int main(int argc, char * argv[])
{
    atomic_sub(1);
    atomic_add(1);
}
" MSGPACK_ENABLE_GCC_CXX_ATOMIC)


LIST (APPEND msgpackc_SOURCES
    src/unpack.c
    src/objectc.c
    src/version.c
    src/vrefbuffer.c
    src/zone.c
)

LIST (APPEND msgpackc_HEADERS
    include/msgpack/pack_define.h
    include/msgpack/pack_template.h
    include/msgpack/unpack_define.h
    include/msgpack/unpack_template.h
    include/msgpack/util.h
    include/msgpack/sysdep.h
    include/msgpack/gcc_atomic.h
    include/msgpack.h
    include/msgpack/sbuffer.h
    include/msgpack/version.h
    include/msgpack/version_master.h
    include/msgpack/vrefbuffer.h
    include/msgpack/zbuffer.h
    include/msgpack/fbuffer.h
    include/msgpack/pack.h
    include/msgpack/unpack.h
    include/msgpack/object.h
    include/msgpack/zone.h
)

FILE (GLOB_RECURSE PREDEF_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/predef/*.h)

LIST (APPEND msgpackc_HEADERS ${PREDEF_FILES})
LIST (APPEND msgpackc_HEADERS include/msgpack/predef.h)

IF (MSGPACK_ENABLE_CXX)
    LIST (APPEND msgpack_HEADERS
        include/msgpack.hpp
        include/msgpack/adaptor/adaptor_base.hpp
        include/msgpack/adaptor/array_ref.hpp
        include/msgpack/adaptor/bool.hpp
        include/msgpack/adaptor/boost/fusion.hpp
        include/msgpack/adaptor/boost/msgpack_variant.hpp
        include/msgpack/adaptor/boost/optional.hpp
        include/msgpack/adaptor/boost/string_ref.hpp
        include/msgpack/adaptor/char_ptr.hpp
        include/msgpack/adaptor/check_container_size.hpp
        include/msgpack/adaptor/cpp11/array.hpp
        include/msgpack/adaptor/cpp11/array_char.hpp
        include/msgpack/adaptor/cpp11/array_unsigned_char.hpp
        include/msgpack/adaptor/cpp11/forward_list.hpp
        include/msgpack/adaptor/cpp11/reference_wrapper.hpp
        include/msgpack/adaptor/cpp11/shared_ptr.hpp
        include/msgpack/adaptor/cpp11/tuple.hpp
        include/msgpack/adaptor/cpp11/unique_ptr.hpp
        include/msgpack/adaptor/cpp11/unordered_map.hpp
        include/msgpack/adaptor/cpp11/unordered_set.hpp
        include/msgpack/adaptor/define.hpp
        include/msgpack/adaptor/deque.hpp
        include/msgpack/adaptor/detail/cpp03_define_array.hpp
        include/msgpack/adaptor/detail/cpp03_define_map.hpp
        include/msgpack/adaptor/detail/cpp03_msgpack_tuple.hpp
        include/msgpack/adaptor/detail/cpp11_define_array.hpp
        include/msgpack/adaptor/detail/cpp11_define_map.hpp
        include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp
        include/msgpack/adaptor/ext.hpp
        include/msgpack/adaptor/fixint.hpp
        include/msgpack/adaptor/float.hpp
        include/msgpack/adaptor/int.hpp
        include/msgpack/adaptor/list.hpp
        include/msgpack/adaptor/map.hpp
        include/msgpack/adaptor/msgpack_tuple.hpp
        include/msgpack/adaptor/nil.hpp
        include/msgpack/adaptor/pair.hpp
        include/msgpack/adaptor/raw.hpp
        include/msgpack/adaptor/v4raw.hpp
        include/msgpack/adaptor/set.hpp
        include/msgpack/adaptor/string.hpp
        include/msgpack/adaptor/tr1/unordered_map.hpp
        include/msgpack/adaptor/tr1/unordered_set.hpp
        include/msgpack/adaptor/vector.hpp
        include/msgpack/adaptor/vector_bool.hpp
        include/msgpack/adaptor/vector_char.hpp
        include/msgpack/adaptor/vector_unsigned_char.hpp
        include/msgpack/cpp_config.hpp
        include/msgpack/detail/cpp03_zone.hpp
        include/msgpack/detail/cpp11_zone.hpp
        include/msgpack/fbuffer.hpp
        include/msgpack/iterator.hpp
        include/msgpack/meta.hpp
        include/msgpack/object.hpp
        include/msgpack/object_fwd.hpp
        include/msgpack/pack.hpp
        include/msgpack/sbuffer.hpp
        include/msgpack/type.hpp
        include/msgpack/unpack.hpp
        include/msgpack/version.hpp
        include/msgpack/versioning.hpp
        include/msgpack/vrefbuffer.hpp
        include/msgpack/zbuffer.hpp
        include/msgpack/zone.hpp
    )
    FILE (GLOB_RECURSE PREPROCESSOR_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/preprocessor/*.hpp)

    LIST (APPEND msgpackc_HEADERS ${PREPROCESSOR_FILES})
    LIST (APPEND msgpackc_HEADERS include/msgpack/preprocessor.hpp)
ENDIF ()

EXECUTE_PROCESS (
    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/msgpack
)

CONFIGURE_FILE (
    msgpack.pc.in
    msgpack.pc
    @ONLY
)

INCLUDE_DIRECTORIES (
    ./
    include/
    ${CMAKE_CURRENT_BINARY_DIR}/include/
)

IF (MSGPACK_ENABLE_SHARED)
    ADD_LIBRARY (msgpackc SHARED
        ${msgpackc_SOURCES}
        ${msgpackc_HEADERS}
    )
ENDIF ()

ADD_LIBRARY (msgpackc-static STATIC
    ${msgpackc_SOURCES}
    ${msgpackc_HEADERS}
)

SET_TARGET_PROPERTIES (msgpackc-static PROPERTIES OUTPUT_NAME "msgpackc")
IF (MSGPACK_ENABLE_SHARED)
    SET_TARGET_PROPERTIES (msgpackc PROPERTIES IMPORT_SUFFIX "_import.lib")
    SET_TARGET_PROPERTIES (msgpackc PROPERTIES SOVERSION 2 VERSION 2.0.0)
ENDIF ()

IF (MSGPACK_BUILD_TESTS)
    ENABLE_TESTING ()
    # MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND
    SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1")
    FIND_PROGRAM(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
    INCLUDE(Dart)
    ADD_SUBDIRECTORY (test)
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    IF (MSGPACK_ENABLE_SHARED)
        SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3 -DPIC")
    ENDIF ()
    SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3" )
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
        (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL   ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
    SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
    ENDIF ()
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
    IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
        STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
    ELSE ()
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX")
    ENDIF ()
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC90" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC10")
    SET_SOURCE_FILES_PROPERTIES(${msgpackc_SOURCES} PROPERTIES LANGUAGE CXX)
ENDIF()

IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
    SET(CMAKE_INSTALL_LIBDIR lib)
ENDIF ()

IF (MSGPACK_BUILD_EXAMPLES)
    ADD_SUBDIRECTORY (example)
ENDIF ()

IF (MSGPACK_ENABLE_SHARED)
    SET (MSGPACK_INSTALLTARGETS msgpackc msgpackc-static)
ELSE()
    SET (MSGPACK_INSTALLTARGETS msgpackc-static)
ENDIF ()

INSTALL (TARGETS ${MSGPACK_INSTALLTARGETS} DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL (DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX})
IF (NOT MSVC)
    INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/msgpack.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
ENDIF ()

# Doxygen
FIND_PACKAGE (Doxygen)
IF (DOXYGEN_FOUND)
    LIST (APPEND Doxyfile_c_CONTENT
        COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS      = *.h" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        COMMAND ${CMAKE_COMMAND} -E echo "OUTPUT_DIRECTORY   = doc_c" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        COMMAND ${CMAKE_COMMAND} -E echo "INPUT              = ${CMAKE_CURRENT_SOURCE_DIR}/include" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        COMMAND ${CMAKE_COMMAND} -E echo "EXTRACT_ALL        = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME       = \"MessagePack for C\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
    )
    IF (DOXYGEN_DOT_FOUND)
        LIST (APPEND Doxyfile_c_CONTENT
            COMMAND ${CMAKE_COMMAND} -E echo "HAVE_DOT       = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        )
    ENDIF ()
    ADD_CUSTOM_TARGET (
        doxygen_c
        ${Doxyfile_c_CONTENT}
        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
        VERBATIM
    )
    LIST (APPEND Doxyfile_cpp_CONTENT
        COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS      = *.hpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        COMMAND ${CMAKE_COMMAND} -E echo "OUTPUT_DIRECTORY   = doc_cpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        COMMAND ${CMAKE_COMMAND} -E echo "INPUT              = ${CMAKE_CURRENT_SOURCE_DIR}/include" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        COMMAND ${CMAKE_COMMAND} -E echo "EXTRACT_ALL        = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
    )
    IF (DOXYGEN_DOT_FOUND)
        LIST (APPEND Doxyfile_cpp_CONTENT
            COMMAND ${CMAKE_COMMAND} -E echo "HAVE_DOT       = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        )
    ENDIF ()
    ADD_CUSTOM_TARGET (
        doxygen_cpp
        ${Doxyfile_cpp_CONTENT}
        COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME       = \"MessagePack for C++\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
        VERBATIM
    )
    ADD_CUSTOM_TARGET (
        doxygen
        DEPENDS doxygen_c doxygen_cpp
    )
ENDIF ()