1 2IF(JSONCPP_LIB_BUILD_SHARED) 3 ADD_DEFINITIONS( -DJSON_DLL ) 4ENDIF(JSONCPP_LIB_BUILD_SHARED) 5 6ADD_EXECUTABLE( jsoncpp_test 7 jsontest.cpp 8 jsontest.h 9 main.cpp 10 ) 11 12TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib) 13 14# Run unit tests in post-build 15# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?) 16IF(JSONCPP_WITH_POST_BUILD_UNITTEST) 17 ADD_CUSTOM_COMMAND( TARGET jsoncpp_test 18 POST_BUILD 19 COMMAND $<TARGET_FILE:jsoncpp_test>) 20ENDIF(JSONCPP_WITH_POST_BUILD_UNITTEST) 21 22SET_TARGET_PROPERTIES(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test) 23