1SET(MODULE_NAME gtest) 2 3SET(${MODULE_NAME}_FOUND FALSE) 4 5FIND_PATH(${MODULE_NAME}_INCLUDE_DIRS 6 NAMES gtest/gtest.h 7 PATHS /usr/include /usr/local/include 8) 9 10FIND_LIBRARY(LIB_GTEST 11 NAMES gtest 12 PATHS /usr/lib 13 /usr/lib64 14 /usr/local/lib 15 /usr/local/lib64 16) 17 18FIND_LIBRARY(LIB_GTEST_MAIN 19 NAMES gtest_main 20 PATHS /usr/lib 21 /usr/lib64 22 /usr/local/lib 23 /usr/local/lib64 24) 25 26IF(LIB_GTEST AND LIB_GTEST_MAIN) 27 SET(${MODULE_NAME}_FOUND TRUE) 28 SET(${MODULE_NAME}_LIBRARIES ${LIB_GTEST} ${LIB_GTEST_MAIN}) 29ENDIF() 30 31MARK_AS_ADVANCED( 32 ${MODULE_NAME}_FOUND 33 ${MODULE_NAME}_INCLUDE_DIRS 34 ${MODULE_NAME}_LIBRARIES 35) 36 37MESSAGE(STATUS "${MODULE_NAME}_INCLUDE_DIRS: ${${MODULE_NAME}_INCLUDE_DIRS}") 38MESSAGE(STATUS "${MODULE_NAME}_LIBRARIES: ${${MODULE_NAME}_LIBRARIES}") 39