forked from cart0909/libcppt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindGTest.cmake
More file actions
41 lines (35 loc) · 1.04 KB
/
FindGTest.cmake
File metadata and controls
41 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# - Try to find GTest
#
# The following variables are optionally searched for defaults
# GTEST_ROOT_DIR: Base directory where all GTEST components are found
#
# The following are set after configuration is done:
# GTEST_FOUND
# GTEST_INCLUDE_DIRS
# GTEST_LIBRARIES
include(FindPackageHandleStandardArgs)
# GTest should be installed at /usr/local
set(GTEST_ROOT_DIR /usr/local
CACHE PATH "Folder contains Google gtest"
)
find_path(GTEST_INCLUDE_DIR gtest/gtest.h
PATHS ${GTEST_ROOT_DIR}/include)
find_library(GTEST_LIBRARY gtest
PATHS ${GTEST_ROOT_DIR}
PATH_SUFFIXES
lib
lib64)
find_package_handle_standard_args(GTEST
DEFAULT_MSG
GTEST_INCLUDE_DIR
GTEST_LIBRARY
)
if(GTEST_FOUND)
set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
set(GTEST_LIBRARIES ${GTEST_LIBRARY})
message(STATUS "Found GTEST:")
message(STATUS "GTEST_INCLUDE_DIRS=${GTEST_INCLUDE_DIRS}")
message(STATUS "GTEST_LIBRARIES =${GTEST_LIBRARIES}")
else()
message(STATUS "GTEST is not found")
endif()