[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Using CMake on CLion and adding geoip library
From:       Hgfjj Hhjgf <umihhgm () gmail ! com>
Date:       2016-07-18 6:56:24
Message-ID: CAEMWhjKeQyJ+UUucFMfdEekYP4DHBMua5OqX5eefZQXvcNiZkQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


thanks for your time :)
I managed to solve the problem. Thanks for your reply again.

On Sat, Jun 25, 2016 at 5:50 PM, Jakob van Bethlehem <
jsvanbethlehem@gmail.com> wrote:

> Hej,
> 
> According to
> https://cmake.org/cmake/help/v3.4/module/CheckIncludeFile.html the
> ‘check_include_file' is a function provided by a module. So you'll need to
> include(CheckIncludeFile) at the beginning of your lists-file
> 
> Sincerely,
> Jakob
> 
> On 25 Jun 2016, at 08:09, Hgfjj Hhjgf <umihhgm@gmail.com> wrote:
> 
> 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
> 
> 
> 
> --
> 
> 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
> 


[Attachment #5 (text/html)]

<div dir="ltr">thanks for your time :)<br>I managed to solve the problem. Thanks for \
your reply again.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, \
Jun 25, 2016 at 5:50 PM, Jakob van Bethlehem <span dir="ltr">&lt;<a \
href="mailto:jsvanbethlehem@gmail.com" \
target="_blank">jsvanbethlehem@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div \
style="word-wrap:break-word">Hej,<div><br></div><div>According to  <a \
href="https://cmake.org/cmake/help/v3.4/module/CheckIncludeFile.html" \
target="_blank">https://cmake.org/cmake/help/v3.4/module/CheckIncludeFile.html</a> \
the ‘check_include_file' is a function provided by a module. So you'll need to \
include(CheckIncludeFile) at the beginning of your \
lists-file</div><div><br></div><div>Sincerely,</div><div>Jakob</div><div><br><div><blockquote \
type="cite"><div><div class="h5"><div>On 25 Jun 2016, at 08:09, Hgfjj Hhjgf &lt;<a \
href="mailto:umihhgm@gmail.com" target="_blank">umihhgm@gmail.com</a>&gt; \
wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><span \
style="font-size:12.8px">I am trying to use an external library (GeoIP). CMake list \
contains:</span><br style="font-size:12.8px"><pre \
style="white-space:pre-wrap;font-family:&#39;DejaVu Sans \
Mono&#39;;font-size:9pt"><span \
style="background-color:rgb(228,228,255)">message</span>(<span \
style="color:rgb(0,128,0);font-weight:bold">STATUS &quot;Looking for MaxMind GeoIP \
header files&quot;</span>)<br><br>set(<span \
style="color:rgb(0,128,0);font-weight:bold">CMAKE_INCLUDE_PATH \
&quot;${CMAKE_INCLUDE_PATH} \
${GEOIP_INCLUDE_DIR}&quot;</span>)<br>check_include_file(<span \
style="color:rgb(0,128,0);font-weight:bold">&quot;GeoIP.h&quot; \
HAVE_GEOIP_H</span>)<br>check_include_file(<span \
style="color:rgb(0,128,0);font-weight:bold">&quot;GeoIPCity.h&quot; \
HAVE_GEOIPCITY_H</span>)<br><span style="color:rgb(0,0,128);font-weight:bold">if \
</span>(<span style="color:rgb(0,128,0);font-weight:bold">HAVE_GEOIP_H AND \
HAVE_GEOIPCITY_H</span>)<br>    message(<span \
style="color:rgb(0,128,0);font-weight:bold">STATUS &quot;Looking for MaxMind GeoIP \
header files - found&quot;</span>)<br><span \
style="color:rgb(0,0,128);font-weight:bold">else</span>(<span \
style="color:rgb(0,128,0);font-weight:bold">HAVE_GEOIP_H AND \
HAVE_GEOIPCITY_H</span>)<br>    message(<span \
style="color:rgb(0,128,0);font-weight:bold">FATAL_ERROR &quot;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=&lt;path&gt;&quot;</span>)<br><span \
style="color:rgb(0,0,128);font-weight:bold">endif</span>(<span \
style="color:rgb(0,128,0);font-weight:bold">HAVE_GEOIP_H AND \
HAVE_GEOIPCITY_H</span>)<br><br>message(<span \
style="color:rgb(0,128,0);font-weight:bold">STATUS &quot;Looking for MaxMind GeoIP \
libraries&quot;</span>)<br>find_library(<span \
style="color:rgb(0,128,0);font-weight:bold">GEOIP_LIB<br></span><span \
style="color:rgb(0,128,0);font-weight:bold">        NAMES GeoIP geoip<br></span><span \
style="color:rgb(0,128,0);font-weight:bold">        PATHS \
${GEOIP_LIBRARY_DIR}<br></span><span style="color:rgb(0,128,0);font-weight:bold">     \
</span>)<br><span style="color:rgb(0,0,128);font-weight:bold">if </span>(<span \
style="color:rgb(0,128,0);font-weight:bold">GEOIP_LIB</span>)<br>    message(<span \
style="color:rgb(0,128,0);font-weight:bold">STATUS &quot;Looking for MaxMind GeoIP \
libraries - found&quot;</span>)<br>    set(<span \
style="color:rgb(0,128,0);font-weight:bold">GEOIP_LIBRARIES \
${GEOIP_LIB}</span>)<br><span \
style="color:rgb(0,0,128);font-weight:bold">else</span>(<span \
style="color:rgb(0,128,0);font-weight:bold">GEOIP_LIB</span>)<br>    message(<span \
style="color:rgb(0,128,0);font-weight:bold">FATAL_ERROR &quot;Could not find MaxMind \
GeoIP library&quot;</span>)<br><span \
style="color:rgb(0,0,128);font-weight:bold">endif</span>(<span \
style="color:rgb(0,128,0);font-weight:bold">GEOIP_LIB</span>) <br></pre><pre \
style="white-space:pre-wrap;font-family:&#39;DejaVu Sans Mono&#39;;font-size:9pt">but \
getting error like &quot;Unknown cmake command: check_include_file&quot; what&#39;s \
                the problem here then?</pre></div></div></div>
-- <br><span class=""><br>Powered by <a href="http://www.kitware.com" \
target="_blank">www.kitware.com</a><br><br>Please keep messages on-topic and check \
the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Kitware offers various \
services to support the CMake community. For more information on each offering, \
please visit:<br><br>CMake Support: <a \
href="http://cmake.org/cmake/help/support.html" \
target="_blank">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a \
href="http://cmake.org/cmake/help/consulting.html" \
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training \
Courses: <a href="http://cmake.org/cmake/help/training.html" \
target="_blank">http://cmake.org/cmake/help/training.html</a><br><br>Visit other \
Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Follow \
this link to subscribe/unsubscribe:<br><a \
href="http://public.kitware.com/mailman/listinfo/cmake" \
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a></span></div></blockquote></div><br></div></div><br>--<br>
 <br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" \
target="_blank">www.kitware.com</a><br> <br>
Please keep messages on-topic and check the CMake FAQ at: <a \
href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:<br> <br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/support.html</a><br> CMake Consulting: <a \
href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br> CMake Training \
Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/training.html</a><br> <br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" \
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>




-- 

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic