CMake: Add option to link against system-wide Gflags library
[blender.git] / build_files / cmake / Modules / GTestTesting.cmake
index e688db35ef12be6e9ff58948bad2e8b3431e54eb..9fd082ee40203989fd7891da1e0886ea35b38585 100644 (file)
@@ -21,7 +21,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
                        ${_current_include_directories}
                        ${CMAKE_SOURCE_DIR}/tests/gtests
                        ${CMAKE_SOURCE_DIR}/extern/glog/src
-                       ${CMAKE_SOURCE_DIR}/extern/gflags/src
+                       ${GFLAGS_INCLUDE_DIRS}
                        ${CMAKE_SOURCE_DIR}/extern/gtest/include
                        ${CMAKE_SOURCE_DIR}/extern/gmock/include
                )
@@ -38,7 +38,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
                                      # needed for glog
                                      ${PTHREADS_LIBRARIES}
                                      extern_glog
-                                     extern_gflags)
+                                     ${GFLAGS_LIBRARIES})
                if(WITH_OPENMP_STATIC)
                        target_link_libraries(${NAME}_test ${OpenMP_LIBRARIES})
                endif()