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