• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
2
3IF(JSONCPP_LIB_BUILD_SHARED)
4  ADD_DEFINITIONS( -DJSON_DLL )
5ENDIF(JSONCPP_LIB_BUILD_SHARED)
6
7ADD_EXECUTABLE(jsontestrunner_exe
8               main.cpp
9               )
10TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib)
11SET_TARGET_PROPERTIES(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)
12
13IF(PYTHONINTERP_FOUND)
14    # Run end to end parser/writer tests
15    SET(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../test)
16    SET(RUNJSONTESTS_PATH ${TEST_DIR}/runjsontests.py)
17    ADD_CUSTOM_TARGET(jsoncpp_readerwriter_tests ALL
18                      "${PYTHON_EXECUTABLE}" -B "${RUNJSONTESTS_PATH}" $<TARGET_FILE:jsontestrunner_exe> "${TEST_DIR}/data"
19                      DEPENDS jsontestrunner_exe jsoncpp_test
20                      )
21    ADD_CUSTOM_TARGET(jsoncpp_check DEPENDS jsoncpp_readerwriter_tests)
22ENDIF(PYTHONINTERP_FOUND)
23