1#make install of googletest a nop 2# 3function(install) 4endfunction() 5 6enable_testing() 7 8add_definitions(-D_VARIADIC_MAX=10) 9if (WIN32) 10 set (gtest_force_shared_crt ON CACHE BOOL "Force GTest to use shared CRT") 11endif (WIN32) 12add_subdirectory(${SYST_BUILD_GTEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/gtest) 13mark_as_advanced(BUILD_SHARED_LIBS) 14 15include_directories( 16 ${SYST_BUILD_GTEST_DIR}/include 17 ${mipi_syst_Platform_include} 18 ${mipi_syst_Includes} 19 ../../platform/src 20 ../../platform/${SYST_BUILD_PLATFORM_NAME}/src 21) 22 23add_executable(syst_unittest 24 mipi_syst_gtest_main.cpp 25 mipi_syst_init_test.cpp 26 mipi_syst_disable_test.cpp 27 mipi_syst_clock_test.cpp 28 mipi_syst_crc32_test.cpp 29 mipi_syst_catid32_test.cpp 30 mipi_syst_catid64_test.cpp 31 mipi_syst_printf_test.cpp 32 mipi_syst_raw_test.cpp 33 mipi_syst_string_test.cpp 34 mipi_syst_build_test.cpp 35) 36 37target_link_libraries(syst_unittest gtest mipi_syst_static) 38set_target_properties(syst_unittest PROPERTIES COMPILE_FLAGS "-DMIPI_SYST_EXPORTS") 39 40foreach (target gtest gtest_main syst_unittest) 41 set_property(TARGET ${target} PROPERTY FOLDER "Unittests") 42endforeach (target) 43 44add_test( 45 NAME syst_unittest 46 COMMAND syst_unittest 47 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 48) 49 50 51if (CMAKE_CONFIGURATION_TYPES) 52 add_custom_target(RUN_TEST_VERBOSE COMMAND ${CMAKE_CTEST_COMMAND} 53 --force-new-ctest-process --verbose 54 --build-config "$<CONFIGURATION>") 55else() 56 add_custom_target(RUN_TEST_VERBOSE COMMAND ${CMAKE_CTEST_COMMAND} 57 --force-new-ctest-process --verbose) 58endif()