ports/math/eigen3/patches/patch-cmake_FindGoogleHash_cmake

32 lines
1.5 KiB
Text

Fix configure check.
--- cmake/FindGoogleHash.cmake.orig Tue Jul 30 15:24:36 2013
+++ cmake/FindGoogleHash.cmake Tue Jul 30 15:24:20 2013
@@ -1,4 +1,7 @@
+include(CMakePushCheckState)
+include(CheckCXXSourceCompiles)
+
if (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
set(GOOGLEHASH_FIND_QUIETLY TRUE)
endif (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
@@ -9,12 +12,16 @@ find_path(GOOGLEHASH_INCLUDES
PATHS
${INCLUDE_INSTALL_DIR}
)
+message(STATUS "GOOGLEHASH_INCLUDES: ${GOOGLEHASH_INCLUDES}")
if(GOOGLEHASH_INCLUDES)
- # let's make sure it compiles with the current compiler
- file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp
- "#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")
- try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_FLAGS)
+ set(CMAKE_REQUIRED_DEFINITIONS)
+ set(CMAKE_REQUIRED_INCLUDES ${GOOGLEHASH_INCLUDES})
+ set(CMAKE_REQUIRED_LIBRARIES)
+ 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)
+ cmake_pop_check_state()
endif(GOOGLEHASH_INCLUDES)
include(FindPackageHandleStandardArgs)