Skip to content

Commit 7e5485a

Browse files
theirixdota17
authored andcommitted
Add option JSONCPP_WITH_EXAMPLE (open-source-parsers#1099)
* Add option JSONCPP_WITH_EXAMPLE Allows to conditionally build examples as it has been done for tests. Useful for packaging. * Do not build example by default
1 parent 92d9025 commit 7e5485a

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
@@ -82,6 +82,7 @@ option(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occ
8282
option(JSONCPP_WITH_STRICT_ISO "Issue all the warnings demanded by strict ISO C and ISO C++" ON)
8383
option(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON)
8484
option(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" ON)
85+
option(JSONCPP_WITH_EXAMPLE "Compile JsonCpp example" OFF)
8586
option(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
8687

8788
# Enable runtime search path support for dynamic libraries on OSX
@@ -228,4 +229,6 @@ add_subdirectory( src )
228229
add_subdirectory( include )
229230

230231
#install the example
231-
add_subdirectory( example )
232+
if(JSONCPP_WITH_EXAMPLE)
233+
add_subdirectory( example )
234+
endif()

0 commit comments

Comments
 (0)