I am trying to use an external library (GeoIP). CMake list contains:

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)
    message(STATUS "Looking for MaxMind GeoIP header files - found")
else(HAVE_GEOIP_H AND HAVE_GEOIPCITY_H)
    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)

message(STATUS "Looking for MaxMind GeoIP libraries")
find_library(GEOIP_LIB
        NAMES GeoIP geoip
        PATHS ${GEOIP_LIBRARY_DIR}
        )
if (GEOIP_LIB)
    message(STATUS "Looking for MaxMind GeoIP libraries - found")
    set(GEOIP_LIBRARIES ${GEOIP_LIB})
else(GEOIP_LIB)
    message(FATAL_ERROR "Could not find MaxMind GeoIP library")
endif(GEOIP_LIB)

but getting error like "Unknown cmake command: check_include_file"
what's the problem here then?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to