patch-cmake_FindGoogleHash_cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. $OpenBSD: patch-cmake_FindGoogleHash_cmake,v 1.1.1.1 2014/07/10 08:59:52 zhuk Exp $
  2. Fix configure check.
  3. --- cmake/FindGoogleHash.cmake.orig Tue Jul 30 15:24:36 2013
  4. +++ cmake/FindGoogleHash.cmake Tue Jul 30 15:24:20 2013
  5. @@ -1,4 +1,7 @@
  6. +include(CMakePushCheckState)
  7. +include(CheckCXXSourceCompiles)
  8. +
  9. if (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
  10. set(GOOGLEHASH_FIND_QUIETLY TRUE)
  11. endif (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
  12. @@ -9,12 +12,16 @@ find_path(GOOGLEHASH_INCLUDES
  13. PATHS
  14. ${INCLUDE_INSTALL_DIR}
  15. )
  16. +message(STATUS "GOOGLEHASH_INCLUDES: ${GOOGLEHASH_INCLUDES}")
  17. if(GOOGLEHASH_INCLUDES)
  18. - # let's make sure it compiles with the current compiler
  19. - file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp
  20. - "#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")
  21. - try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT)
  22. + cmake_push_check_state()
  23. + set(CMAKE_REQUIRED_FLAGS)
  24. + set(CMAKE_REQUIRED_DEFINITIONS)
  25. + set(CMAKE_REQUIRED_INCLUDES ${GOOGLEHASH_INCLUDES})
  26. + set(CMAKE_REQUIRED_LIBRARIES)
  27. + check_cxx_source_compiles("#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" GOOGLEHASH_COMPILE)
  28. + cmake_pop_check_state()
  29. endif(GOOGLEHASH_INCLUDES)
  30. include(FindPackageHandleStandardArgs)