1# vim: et ts=4 sts=4 sw=4 tw=0 2 3add_executable(jsoncpp_test 4 jsontest.cpp 5 jsontest.h 6 fuzz.cpp 7 fuzz.h 8 main.cpp 9) 10 11 12if(BUILD_SHARED_LIBS) 13 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0) 14 add_compile_definitions( JSON_DLL ) 15 else() 16 add_definitions( -DJSON_DLL ) 17 endif() 18endif() 19target_link_libraries(jsoncpp_test jsoncpp_lib) 20 21# another way to solve issue #90 22#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store) 23 24## Create tests for dashboard submission, allows easy review of CI results https://my.cdash.org/index.php?project=jsoncpp 25add_test(NAME jsoncpp_test 26 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test> 27) 28set_target_properties(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test) 29 30# Run unit tests in post-build 31# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?) 32if(JSONCPP_WITH_POST_BUILD_UNITTEST) 33 add_custom_command(TARGET jsoncpp_test 34 POST_BUILD 35 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test> 36 ) 37endif() 38