Home | History | Annotate | Download | only in jsontestrunner
      1 FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
      2 
      3 IF(JSONCPP_LIB_BUILD_SHARED)
      4   ADD_DEFINITIONS( -DJSON_DLL )
      5 ENDIF(JSONCPP_LIB_BUILD_SHARED)
      6 
      7 ADD_EXECUTABLE(jsontestrunner_exe
      8                main.cpp
      9                )
     10 TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib)
     11 SET_TARGET_PROPERTIES(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)
     12 
     13 IF(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)
     22 ENDIF(PYTHONINTERP_FOUND)
     23