SET(BENCHMARK_SEARCH_PATH
    ${BENCHMARK_ROOT}
    ${PROJECT_ROOT_PATH}/third-party/)

FIND_PATH(BENCHMARK_SOURCE_DIR
    NAMES CMakeLists.txt src/benchmark_main.cc
    PATHS ${BENCHMARK_SEARCH_PATH})

IF(BENCHMARK_SOURCE_DIR)
    MESSAGE("find BENCHMARK_SOURCE_DIR: ${BENCHMARK_SOURCE_DIR}")
ENDIF()

FIND_PATH(BENCHMARK_INCLUDE_DIR
    NAMES benchmark/benchmark.h
    PATH_SUFFIXES include
    HINTS ${BENCHMARK_SOURCE_DIR}
    PATHS ${BENCHMARK_SEARCH_PATH})

IF(BENCHMARK_INCLUDE_DIR)
    MESSAGE("find BENCHMARK_INCLUDE_DIR: ${BENCHMARK_INCLUDE_DIR}")
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Benchmark DEFAULT_MSG
    BENCHMARK_SOURCE_DIR
    BENCHMARK_INCLUDE_DIR)