From 8d3673e7eea299e28346a686da8b935dac9b729f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Mon, 17 Aug 2015 10:55:30 -0400 Subject: [PATCH] Make example build optional with cmake --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d504408e..0b91fb7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,7 @@ 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) @@ -292,7 +293,9 @@ IF (NOT DEFINED CMAKE_INSTALL_LIBDIR) SET(CMAKE_INSTALL_LIBDIR lib) ENDIF () -ADD_SUBDIRECTORY (example) +IF (MSGPACK_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (example) +ENDIF () IF (MSGPACK_ENABLE_SHARED) SET (MSGPACK_INSTALLTARGETS msgpack msgpack-static)