diff --git a/scripts/AddGTest.cmake b/scripts/AddGTest.cmake index 4b5e36f..a8f7c52 100644 --- a/scripts/AddGTest.cmake +++ b/scripts/AddGTest.cmake @@ -19,11 +19,13 @@ macro(add_gtest name source) # "${source_dir}/include;${THISTEST_INCLUDE}") add_executable(test_${name} ${source}) - if(MSVC) + if(EXISTS ${EXTERNAL_ROOT}/lib/gtest.lib) target_link_libraries(test_${name} ${EXTERNAL_ROOT}/lib/gtest.lib) - else(MSVC) + elseif(EXISTS ${EXTERNAL_ROOT}/lib/libgtest.a) target_link_libraries(test_${name} ${EXTERNAL_ROOT}/lib/libgtest.a) - endif(MSVC) + elseif(NOT GTest_LOOKUP_BUILD) + message(FATAL_ERROR "Could not find gtest") + endif() if(CMAKE_THREAD_LIBS_INIT) target_link_libraries(test_${name} ${CMAKE_THREAD_LIBS_INIT}) endif(CMAKE_THREAD_LIBS_INIT)