mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-02-09 03:06:44 +08:00
Update CMake build to support gflags and gtest correctly
The gflags library was missing from the CMake build and the gtest includes were not being set correctly. R=fbarchard@google.com Review URL: https://codereview.chromium.org/1692083002 .
This commit is contained in:
parent
cc33dc68c7
commit
20343f45c6
@ -110,12 +110,13 @@ endif()
|
|||||||
if(TEST)
|
if(TEST)
|
||||||
find_library(GTEST_LIBRARY gtest)
|
find_library(GTEST_LIBRARY gtest)
|
||||||
if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
|
if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
|
||||||
set(GTEST_SRC_DIR /usr/src/gtest)
|
set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources")
|
||||||
if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
||||||
message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
|
message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
|
||||||
set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
||||||
add_library(gtest STATIC ${gtest_sources})
|
add_library(gtest STATIC ${gtest_sources})
|
||||||
include_directories(${GTEST_SRC_DIR})
|
include_directories(${GTEST_SRC_DIR})
|
||||||
|
include_directories(${GTEST_SRC_DIR}/include)
|
||||||
set(GTEST_LIBRARY gtest)
|
set(GTEST_LIBRARY gtest)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "TEST is set but unable to find gtest library")
|
message(FATAL_ERROR "TEST is set but unable to find gtest library")
|
||||||
@ -133,6 +134,8 @@ if(NACL AND NACL_LIBC STREQUAL "newlib")
|
|||||||
target_link_libraries(libyuv_unittest glibc-compat)
|
target_link_libraries(libyuv_unittest glibc-compat)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(libyuv_unittest gflags)
|
||||||
|
|
||||||
install(TARGETS ${ly_lib_name} DESTINATION lib)
|
install(TARGETS ${ly_lib_name} DESTINATION lib)
|
||||||
install(FILES ${ly_header_files} DESTINATION include/libyuv)
|
install(FILES ${ly_header_files} DESTINATION include/libyuv)
|
||||||
install(FILES ${ly_inc_dir}/libyuv.h DESTINATION include/)
|
install(FILES ${ly_inc_dir}/libyuv.h DESTINATION include/)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user