1
2if (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
3  set(GOOGLEHASH_FIND_QUIETLY TRUE)
4endif (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
5
6find_path(GOOGLEHASH_INCLUDES
7  NAMES
8  google/dense_hash_map
9  PATHS
10  ${INCLUDE_INSTALL_DIR}
11)
12
13if(GOOGLEHASH_INCLUDES)
14  # let's make sure it compiles with the current compiler
15  file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp
16  "#include <google/sparse_hash_map>\n#include <google/dense_hash_map>\nint main(int argc, char** argv) { google::dense_hash_map<int,float> a; google::sparse_hash_map<int,float> b; return 0;}\n")
17  try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT)
18endif(GOOGLEHASH_INCLUDES)
19
20include(FindPackageHandleStandardArgs)
21find_package_handle_standard_args(GOOGLEHASH DEFAULT_MSG GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE)
22
23mark_as_advanced(GOOGLEHASH_INCLUDES)
24