[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [vidalia/alpha] Improve GeoIP lookup
commit 1999b2fd72e3e3a68a6414d4ef4606a5898bf648
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date: Mon Feb 13 12:35:59 2012 -0300
Improve GeoIP lookup
---
cmake/FindGeoIP.cmake | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/cmake/FindGeoIP.cmake b/cmake/FindGeoIP.cmake
index 76986bf..9554082 100644
--- a/cmake/FindGeoIP.cmake
+++ b/cmake/FindGeoIP.cmake
@@ -16,18 +16,22 @@
message(STATUS "Looking for MaxMind GeoIP header files")
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH} ${GEOIP_INCLUDE_DIR}")
-check_include_file("GeoIP.h" HAVE_GEOIP_H)
-check_include_file("GeoIPCity.h" HAVE_GEOIPCITY_H)
-if (HAVE_GEOIP_H AND HAVE_GEOIPCITY_H)
+find_path(GEOIP_INCLUDE_DIR
+ NAMES GeoIP.h GeoIPCity.h
+ PATHS ${GEOIP_INCLUDE_DIR}
+)
+
+if (GEOIP_INCLUDE_DIR)
message(STATUS "Looking for MaxMind GeoIP header files - found")
-else(HAVE_GEOIP_H AND HAVE_GEOIPCITY_H)
+else(GEOIP_INCLUDE_DIR)
message(FATAL_ERROR "Could not find one or more MaxMind GeoIP header files. If the MaxMind GeoIP library is installed, you can run CMake again and specify its location with -DGEOIP_INCLUDE_DIR=<path>")
-endif(HAVE_GEOIP_H AND HAVE_GEOIPCITY_H)
+endif(GEOIP_INCLUDE_DIR)
message(STATUS "Looking for MaxMind GeoIP libraries")
-find_library(GEOIP_LIB
- NAMES GeoIP geoip
- PATHS ${GEOIP_LIBRARY_DIR}
+find_file(GEOIP_LIB
+ NAMES libGeoIP.a
+ PATHS ${GEOIP_LIBRARY_DIR}/.libs/
+ HINTS ${GEOIP_LIBRARY_DIR}/.libs/
)
if (GEOIP_LIB)
message(STATUS "Looking for MaxMind GeoIP libraries - found")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits