1 2 SET(GTEST_SEARCH_PATH 3 "${GTEST_SOURCE_DIR}" 4 "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest") 5 6 IF(UNIX) 7 IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST) 8 LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest") 9 ELSE() 10 LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest") 11 ENDIF() 12 ENDIF() 13 14 FIND_PATH(GTEST_SOURCE_DIR 15 NAMES CMakeLists.txt src/gtest_main.cc 16 PATHS ${GTEST_SEARCH_PATH}) 17 18 19 # Debian installs gtest include directory in /usr/include, thus need to look 20 # for include directory separately from source directory. 21 FIND_PATH(GTEST_INCLUDE_DIR 22 NAMES gtest/gtest.h 23 PATH_SUFFIXES include 24 HINTS ${GTEST_SOURCE_DIR} 25 PATHS ${GTEST_SEARCH_PATH}) 26 27 INCLUDE(FindPackageHandleStandardArgs) 28 find_package_handle_standard_args(GTestSrc DEFAULT_MSG 29 GTEST_SOURCE_DIR 30 GTEST_INCLUDE_DIR) 31