diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index f13b85f68..af04597c6 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -34,24 +34,24 @@ function(add_cppinterop_unittest name) add_dependencies(CppInterOpUnitTests ${name}) target_include_directories(${name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR}) set_property(TARGET ${name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -if(WIN32) - target_link_libraries(${name} PUBLIC ${ARG_LIBRARIES} ${gtest_libs}) - set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS "${MSVC_EXPORTS}") -else() - target_link_libraries(${name} PRIVATE ${ARG_LIBRARIES} ${gtest_libs} ${link_pthreads_lib}) -endif() -if(EMSCRIPTEN) - # Without this cmake will try and get node to run the html file. - # This guarantees that it runs the js file, and uses emsdks node. - add_test(NAME cppinterop-${name} COMMAND $ENV{EMSDK_NODE} ${name}.js) -else() - add_test(NAME cppinterop-${name} COMMAND ${name}) -endif() + if(WIN32) + target_link_libraries(${name} PUBLIC ${ARG_LIBRARIES} ${gtest_libs}) + set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS "${MSVC_EXPORTS}") + else() + target_link_libraries(${name} PRIVATE ${ARG_LIBRARIES} ${gtest_libs} ${link_pthreads_lib}) + endif() + if(EMSCRIPTEN) + # Without this cmake will try and get node to run the html file. + # This guarantees that it runs the js file, and uses emsdks node. + add_test(NAME cppinterop-${name} COMMAND $ENV{EMSDK_NODE} ${name}.js) + else() + add_test(NAME cppinterop-${name} COMMAND ${name}) + endif() set_tests_properties(cppinterop-${name} PROPERTIES - TIMEOUT "${TIMEOUT_VALUE}" - ENVIRONMENT "CPLUS_INCLUDE_PATH=${CMAKE_BINARY_DIR}/etc" - LABELS - DEPENDS) + TIMEOUT "${TIMEOUT_VALUE}" + ENVIRONMENT "CPLUS_INCLUDE_PATH=${CMAKE_BINARY_DIR}/etc" + LABELS + DEPENDS) # FIXME: Just call gtest_add_tests this function is available. #gtest_add_tests(${name} "${Arguments}" AUTO) endfunction()