2019-09-17 22:30:00 +02:00
|
|
|
#vim: et ts =4 sts = 4 sw = 4 tw = 0
|
|
|
|
set(EXAMPLES
|
2020-02-13 22:20:46 +01:00
|
|
|
readFromString
|
|
|
|
readFromStream
|
|
|
|
stringWrite
|
|
|
|
streamWrite
|
|
|
|
)
|
2019-09-17 22:30:00 +02:00
|
|
|
add_definitions(-D_GLIBCXX_USE_CXX11_ABI)
|
|
|
|
|
2020-01-01 04:38:39 +01:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2020-01-20 21:21:14 +01:00
|
|
|
add_compile_options(-Wall -Wextra)
|
2020-01-01 04:38:39 +01:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
2020-02-13 22:20:46 +01:00
|
|
|
add_definitions(
|
|
|
|
-D_SCL_SECURE_NO_WARNINGS
|
|
|
|
-D_CRT_SECURE_NO_WARNINGS
|
|
|
|
-D_WIN32_WINNT=0x601
|
|
|
|
-D_WINSOCK_DEPRECATED_NO_WARNINGS
|
|
|
|
)
|
2019-09-17 22:30:00 +02:00
|
|
|
endif()
|
|
|
|
|
2020-02-13 22:20:46 +01:00
|
|
|
foreach(example ${EXAMPLES})
|
|
|
|
add_executable(${example} ${example}/${example}.cpp)
|
|
|
|
target_include_directories(${example} PUBLIC ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_link_libraries(${example} jsoncpp_lib)
|
2019-09-17 22:30:00 +02:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(examples ALL DEPENDS ${EXAMPLES})
|