rapidjson/example/CMakeLists.txt

37 lines
1.0 KiB
CMake
Raw Normal View History

# Copyright (c) 2011 Milo Yip (miloyip@gmail.com)
# Copyright (c) 2013 Rafal Jeczalik (rjeczalik@gmail.com)
# Distributed under the MIT License (see license.txt file)
cmake_minimum_required(VERSION 2.8)
set(EXAMPLES
capitalize
condense
2016-02-09 00:09:39 +08:00
jsonx
messagereader
pretty
prettyauto
2016-01-29 15:24:23 +08:00
schemavalidator
serialize
simpledom
simplereader
simplewriter
tutorial)
include_directories("../include/")
2016-02-09 00:53:49 +08:00
add_definitions(-D__STDC_FORMAT_MACROS)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
2015-12-18 18:34:04 +08:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
2015-02-19 22:41:31 +02:00
add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
endif()
foreach (example ${EXAMPLES})
add_executable(${example} ${example}/${example}.cpp)
endforeach()
add_custom_target(examples ALL DEPENDS ${EXAMPLES})