diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 230d1bd..8ddade4 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,27 +1,6 @@ #vim: et ts =4 sts = 4 sw = 4 tw = 0 -set(EXAMPLES - readFromString - readFromStream - stringWrite - streamWrite -) -add_definitions(-D_GLIBCXX_USE_CXX11_ABI) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_compile_options(-Wall -Wextra) -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - add_definitions( - -D_SCL_SECURE_NO_WARNINGS - -D_CRT_SECURE_NO_WARNINGS - -D_WIN32_WINNT=0x601 - -D_WINSOCK_DEPRECATED_NO_WARNINGS - ) -endif() - -foreach(example ${EXAMPLES}) - add_executable(${example} ${example}/${example}.cpp) - target_include_directories(${example} PUBLIC ${CMAKE_SOURCE_DIR}/include) - target_link_libraries(${example} jsoncpp_lib) -endforeach() - -add_custom_target(examples ALL DEPENDS ${EXAMPLES}) +ADD_SUBDIRECTORY(readFromStream/) +ADD_SUBDIRECTORY(readFromString/) +ADD_SUBDIRECTORY(streamWrite/) +ADD_SUBDIRECTORY(stringWrite/) \ No newline at end of file diff --git a/example/readFromStream/CMakeLists.txt b/example/readFromStream/CMakeLists.txt new file mode 100644 index 0000000..e779db6 --- /dev/null +++ b/example/readFromStream/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(readFromStream readFromStream.cpp) +target_include_directories(readFromStream PUBLIC ${CMAKE_SOURCE_DIR}/include) +target_link_libraries(readFromStream jsoncpp_lib) \ No newline at end of file diff --git a/example/readFromString/CMakeLists.txt b/example/readFromString/CMakeLists.txt new file mode 100644 index 0000000..5c55ae2 --- /dev/null +++ b/example/readFromString/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(readFromString readFromString.cpp) +target_include_directories(readFromString PUBLIC ${CMAKE_SOURCE_DIR}/include) +target_link_libraries(readFromString jsoncpp_lib) \ No newline at end of file diff --git a/example/streamWrite/CMakeLists.txt b/example/streamWrite/CMakeLists.txt new file mode 100644 index 0000000..8bdb061 --- /dev/null +++ b/example/streamWrite/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(streamWrite streamWrite.cpp) +target_include_directories(streamWrite PUBLIC ${CMAKE_SOURCE_DIR}/include) +target_link_libraries(streamWrite jsoncpp_lib) \ No newline at end of file diff --git a/example/stringWrite/CMakeLists.txt b/example/stringWrite/CMakeLists.txt new file mode 100644 index 0000000..6676b02 --- /dev/null +++ b/example/stringWrite/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(stringWrite stringWrite.cpp) +target_include_directories(stringWrite PUBLIC ${CMAKE_SOURCE_DIR}/include) +target_link_libraries(stringWrite jsoncpp_lib) \ No newline at end of file