mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-03-04 07:27:24 +01:00
Update CMake build to include external_schema example, and add usage info to external_schema.cpp.
This commit is contained in:
parent
89b58d84c8
commit
280250dbc8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
build
|
||||
bin
|
||||
xcode/valijson.xcodeproj/project.xcworkspace
|
||||
xcode/valijson.xcodeproj/project.xcworkspace/xcuserdata
|
||||
|
@ -20,6 +20,11 @@ add_subdirectory(thirdparty/gtest-1.7.0)
|
||||
# Include path
|
||||
include_directories(include thirdparty/gtest-1.7.0/include thirdparty/jsoncpp-0.5.0/include thirdparty/rapidjson-0.1/include)
|
||||
|
||||
# External schema validation example
|
||||
add_executable(external_schema
|
||||
examples/external_schema.cpp
|
||||
)
|
||||
|
||||
# Unit tests executable
|
||||
add_executable(test_suite
|
||||
tests/test_adapter_comparison.cpp
|
||||
@ -35,3 +40,5 @@ add_executable(test_suite
|
||||
set(TEST_LIBS gtest gtest_main jsoncpp)
|
||||
|
||||
target_link_libraries(test_suite ${TEST_LIBS} ${Boost_LIBRARIES})
|
||||
|
||||
target_link_libraries(external_schema ${Boost_LIBRARIES})
|
||||
|
@ -29,6 +29,11 @@ using valijson::adapters::RapidJsonAdapter;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3) {
|
||||
cerr << "Usage: " << argv[0] << " <schema document> <test/target document>" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Load the document containing the schema
|
||||
rapidjson::Document schemaDocument;
|
||||
if (!valijson::utils::loadDocument(argv[1], schemaDocument)) {
|
||||
@ -73,4 +78,4 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user