cmake finds libxml2 but still says its missing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

cmake finds libxml2 but still says its missing

Florian Lindner
Hello,

I try to compile my software like

cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake -DBUILD_SHARED_LIBS=off ../..

> cat ../../toolchain.cmake
SET(CMAKE_SYSTEM_NAME Hazelhen)
SET(CMAKE_C_COMPILER       cc)
SET(CMAKE_CXX_COMPILER     CC)
SET(CMAKE_Fortran_COMPILER ftn)

which gives me the error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES) (found version "2.9.4")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindLibXml2.cmake:69 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:73 (find_package)


I am a bit puzzled, because it says it found libxml 2.9.4, but then again does not set the $LIBXML2_LIBRARIES.

Usage is

find_package(LibXml2 REQlesUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})

and later

target_link_libraries(foobar PUBLIC ${LIBXML2_LIBRARIES})

cmake version 3.5.2

Thanks!
Florian
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake finds libxml2 but still says its missing

Rolf Eike Beer
Am 2018-05-08 14:51, schrieb Florian Lindner:

> Hello,
>
> I try to compile my software like
>
> cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake
> -DBUILD_SHARED_LIBS=off ../..
>
>> cat ../../toolchain.cmake
> SET(CMAKE_SYSTEM_NAME Hazelhen)
> SET(CMAKE_C_COMPILER       cc)
> SET(CMAKE_CXX_COMPILER     CC)
> SET(CMAKE_Fortran_COMPILER ftn)
>
> which gives me the error:
>
> CMake Error at
> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148
> (message):
>   Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES) (found version
> "2.9.4")
> Call Stack (most recent call first):
>   /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388
> (_FPHSA_FAILURE_MESSAGE)
>   /usr/share/cmake/Modules/FindLibXml2.cmake:69
> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>   CMakeLists.txt:73 (find_package)

It can determine the version, e.g. because it can ask pkg-config or
finds the header, but it does not find the library to link to.

> I am a bit puzzled, because it says it found libxml 2.9.4, but then
> again does not set the $LIBXML2_LIBRARIES.
>
> Usage is
>
> find_package(LibXml2 REQlesUIRED)

sure?

Eike
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

cmake finds libxml2 but still says its missing

Florian Lindner


Am 08.05.2018 um 15:12 schrieb Rolf Eike Beer:

> Am 2018-05-08 14:51, schrieb Florian Lindner:
>> Hello,
>>
>> I try to compile my software like
>>
>> cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake -DBUILD_SHARED_LIBS=off ../..
>>
>>> cat ../../toolchain.cmake
>> SET(CMAKE_SYSTEM_NAME Hazelhen)
>> SET(CMAKE_C_COMPILER       cc)
>> SET(CMAKE_CXX_COMPILER     CC)
>> SET(CMAKE_Fortran_COMPILER ftn)
>>
>> which gives me the error:
>>
>> CMake Error at
>> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148
>> (message):
>>   Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES) (found version "2.9.4")
>> Call Stack (most recent call first):
>>   /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388
>> (_FPHSA_FAILURE_MESSAGE)
>>   /usr/share/cmake/Modules/FindLibXml2.cmake:69
>> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>>   CMakeLists.txt:73 (find_package)
>
> It can determine the version, e.g. because it can ask pkg-config or finds the header, but it does not find the library
> to link to.

Ok, is there any way to get more information on that? CMakeOutput.log contains no reference at all to "xml".

The library files are there:

> ls /usr/lib/libxml*
/usr/lib/libxml2.so.2  /usr/lib/libxml2.so.2.9.4

>> I am a bit puzzled, because it says it found libxml 2.9.4, but then
>> again does not set the $LIBXML2_LIBRARIES.
>>
>> Usage is
>>
>> find_package(LibXml2 REQlesUIRED)
>
> sure?

Haha, not really. Obviously was typing in the wrong window, in the file it's REQUIRED, of course.

> Eike

Best,
Florian


--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake finds libxml2 but still says its missing

Rolf Eike Beer
Florian Lindner wrote:

> Am 08.05.2018 um 15:12 schrieb Rolf Eike Beer:
>> Am 2018-05-08 14:51, schrieb Florian Lindner:
>>> Hello,
>>>
>>> I try to compile my software like
>>>
>>> cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake
>>> -DBUILD_SHARED_LIBS=off ../..
>>>
>>>> cat ../../toolchain.cmake
>>> SET(CMAKE_SYSTEM_NAME Hazelhen)
>>> SET(CMAKE_C_COMPILER       cc)
>>> SET(CMAKE_CXX_COMPILER     CC)
>>> SET(CMAKE_Fortran_COMPILER ftn)
>>>
>>> which gives me the error:
>>>
>>> CMake Error at
>>> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148
>>> (message):
>>>   Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES) (found version
>>> "2.9.4")
>>> Call Stack (most recent call first):
>>>   /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388
>>> (_FPHSA_FAILURE_MESSAGE)
>>>   /usr/share/cmake/Modules/FindLibXml2.cmake:69
>>> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>>>   CMakeLists.txt:73 (find_package)
>>
>> It can determine the version, e.g. because it can ask pkg-config or
>> finds the header, but it does not find the library
>> to link to.
>
> Ok, is there any way to get more information on that? CMakeOutput.log
> contains no reference at all to "xml".
>
> The library files are there:
>
>> ls /usr/lib/libxml*
> /usr/lib/libxml2.so.2  /usr/lib/libxml2.so.2.9.4

So they are indeed not. The module is looking for libxml2.so, which
usually comes with the -dev or -devel package.

Eike
--

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:
https://cmake.org/mailman/listinfo/cmake