cmake_minimum_required(VERSION 3.15)
#-------------------------------------json 环境-----------------------------------------#
#add_subdirectory(src)

#set(JSONCPP_SOURCES
#        ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_tool.h
#        ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_reader.cpp
#        ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_valueiterator.inl
#        ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_value.cpp
#        ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_writer.cpp
#        )

project(json-test)
add_compile_options(-std=c++11)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

message(${CMAKE_CURRENT_SOURCE_DIR})
FILE(GLOB JSON_ROOT_CPP ${CMAKE_CURRENT_SOURCE_DIR}/libs/lib_json/*.cpp)

#
#add_library(jsonlib SHARED IMPORTED)
#set_target_properties(jsonlib PROPERTIES IMPORTED_LOCATION
#        "${CMAKE_CURRENT_SOURCE_DIR}/thirdparties/libjsoncpp.24.dylib")

add_executable(json-test
        test/json.cpp
        ${JSON_ROOT_CPP}
        )
add_library(json-test-so SHARED
        test/json.cpp
        ${JSON_ROOT_CPP}
        )
target_link_libraries(json-test-so
        )
target_link_libraries(
        json-test
)
#-------------------------------------json 环境-----------------------------------------#