Skip to content

Commit 8d3673e

Browse files
committed
Make example build optional with cmake
1 parent 767099a commit 8d3673e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ FIND_PACKAGE (Threads)
102102
IF (GTEST_FOUND AND ZLIB_FOUND AND THREADS_FOUND)
103103
OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." ON)
104104
ENDIF ()
105+
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples." ON)
105106

106107
OPTION (MSGPACK_ENABLE_CXX "Enable C++ interface." ON)
107108
OPTION (MSGPACK_ENABLE_SHARED "Build shared libaries in addition to static libraries." ON)
@@ -292,7 +293,9 @@ IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
292293
SET(CMAKE_INSTALL_LIBDIR lib)
293294
ENDIF ()
294295

295-
ADD_SUBDIRECTORY (example)
296+
IF (MSGPACK_BUILD_EXAMPLES)
297+
ADD_SUBDIRECTORY (example)
298+
ENDIF ()
296299

297300
IF (MSGPACK_ENABLE_SHARED)
298301
SET (MSGPACK_INSTALLTARGETS msgpack msgpack-static)

0 commit comments

Comments
 (0)