diff options
author | Joakim Soderberg <joakim.soderberg@gmail.com> | 2015-01-13 16:17:48 +0100 |
---|---|---|
committer | Joakim Soderberg <joakim.soderberg@gmail.com> | 2015-01-13 16:17:48 +0100 |
commit | d0a8ad4c064151b11c5fe7958713272079877d9a (patch) | |
tree | f6ad89f23738887819e94c0b2a7a38c26f87c22c /CMakeLists.txt | |
parent | c244b1483e524da441b5d9545444220d451a899b (diff) | |
download | jansson-d0a8ad4c064151b11c5fe7958713272079877d9a.zip jansson-d0a8ad4c064151b11c5fe7958713272079877d9a.tar.gz jansson-d0a8ad4c064151b11c5fe7958713272079877d9a.tar.bz2 |
Compile simple_parse example for CMake project.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 648de04..bfe8604 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,8 @@ if (MSVC) option(JANSSON_STATIC_CRT "Link the static CRT libraries" OFF ) endif () +option(JANSSON_EXAMPLES "Compile example applications" ON) + if (UNIX) option(JANSSON_COVERAGE "(GCC Only! Requires gcov/lcov to be installed). Include target for doing coverage analysis for the test suite. Note that -DCMAKE_BUILD_TYPE=Debug must be set" OFF) option(JANSSON_COVERALLS "Generate coverage info for Coveralls" OFF) @@ -78,7 +80,6 @@ set(JANSSON_TEMP_DIR ${PROJECT_BINARY_DIR}/tmp) # same build-tree on Windows (MSVC). if (WIN32) set(CMAKE_DEBUG_POSTFIX "_d") -else (WIN32) endif (WIN32) # This is how I thought it should go @@ -385,6 +386,10 @@ else() ${JANSSON_HDR_PUBLIC}) endif() +if (JANSSON_EXAMPLES) + add_executable(simple_parse "${PROJECT_SOURCE_DIR}/examples/simple_parse.c") + target_link_libraries(simple_parse jansson) +endif() # For building Documentation (uses Sphinx) option(JANSSON_BUILD_DOCS "Build documentation (uses python-sphinx)." ON) |