@@ -21,28 +21,17 @@ target_link_libraries(jsoncpp_test jsoncpp_lib)
2121# another way to solve issue #90
2222#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)
2323
24+ ## Create tests for dashboard submission, allows easy review of CI results https://my.cdash.org/index.php?project=jsoncpp
25+ add_test (NAME jsoncpp_test
26+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
27+ )
28+ set_target_properties (jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test)
29+
2430# Run unit tests in post-build
2531# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?)
2632if (JSONCPP_WITH_POST_BUILD_UNITTEST)
27- if (BUILD_SHARED_LIBS )
28- # First, copy the shared lib, for Microsoft.
29- # Then, run the test executable.
30- add_custom_command (TARGET jsoncpp_test
31- POST_BUILD
32- COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:jsoncpp_lib> $<TARGET_FILE_DIR:jsoncpp_test>
33- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
34- )
35- else ()
36- # Just run the test executable.
37- add_custom_command (TARGET jsoncpp_test
38- POST_BUILD
39- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
40- )
41- endif ()
42- ## Create tests for dashboard submission, allows easy review of CI results https://my.cdash.org/index.php?project=jsoncpp
43- add_test (NAME jsoncpp_test
33+ add_custom_command (TARGET jsoncpp_test
34+ POST_BUILD
4435 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
4536 )
4637endif ()
47-
48- set_target_properties (jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test)
0 commit comments