1# Suppress all warnings from external projects. 2set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w) 3 4if(BUILD_TESTING) 5 if(TARGET gmock) 6 message(STATUS "Google Mock already configured - use it") 7 elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest) 8 # We need to make sure Google Test does not mess up with the 9 # global CRT settings on Windows. 10 if(WIN32) 11 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 12 endif(WIN32) 13 add_subdirectory(googletest) 14 set(GTEST_TARGETS 15 gtest 16 gtest_main 17 gmock 18 gmock_main) 19 foreach(target ${GTEST_TARGETS}) 20 set_property(TARGET ${target} PROPERTY FOLDER gtest) 21 endforeach() 22 mark_as_advanced(gmock_build_tests 23 BUILD_GMOCK 24 BUILD_GTEST 25 BUILD_SHARED_LIBS 26 gtest_build_samples 27 gtest_build_tests 28 gtest_disable_pthreads 29 gtest_force_shared_crt 30 gtest_hide_internal_symbols) 31 else() 32 message(STATUS 33 "Google Mock was not found - tests based on that will not build") 34 endif() 35endif() 36 37if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt) 38 if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools) 39 set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests") 40 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools) 41 endif() 42endif() 43 44