[CMake] Expat problem

Mike Jackson imikejackson at gmail.com
Wed Oct 17 21:07:26 EDT 2007


expat_DIR is an environment variable that should point to the  
installation location of Expat. expatConfig.cmake is probably located  
in the "include" directory of your expat installation.

These are just guesses.

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Oct 17, 2007, at 7:42 PM, eddy xu wrote:

> Hi all,
>
> When I try to generate Makefile on a gentoo box, one error message  
> comes out:
>
> CMake Error: expat_DIR is not set. It must be set to the directory  
> containing expatConfig.cmake in order to use expat.
>
> And I can not get any meaningful help from google the keyword  
> "expatConfig". Can any one gives some advices?
>
> My CMakeList.txt is below:
>
>
> SET( SRCS XML_Node.cpp XML_Parser_Base.cpp )
>
> IF ( WIN32 )
>         set ( EXPAT_LIBRARY "c:\\work\\expat\\Source\\lib" )
>         set ( EXPAT_INCLUDE_DIR "c:\\work\\expat\\Source\\lib" )
>
>         set ( SRCS ${SRCS} XML_Win32_Parser.cpp XML_Win32_Parser.h )
>         set ( SRCS ${SRCS} XML_Parser_Base.h XML_Node.h
>                 )
> ENDIF ( WIN32 )
>
> ADD_LIBRARY ( qlibxml SHARED ${SRCS} )
>
>
> IF ( ${CMAKE_SYSTEM} MATCHES Linux OR ${CMAKE_SYSTEM} MATCHES  
> Darwin OR ${CMAKE_SYSTEM} MATCHES Freebsd )
>
>         MESSAGE ( STATUS "Configure in Unix" )
>         set ( SRCS ${SRCS} XML_Stream_Parser.cpp )
>
>         # check for expat
>         FIND_PACKAGE ( expat REQUIRED )
>         IF ( EXPAT_FOUND )
>                 INCLUDE_DIRECTORIES ( ${EXPAT_INCLUDE_DIRS} )
>                 TARGET_LINK_LIBRARIES ( qlibxml ${EXPAT_LIBRARIES} )
>         ELSE ( EXPAT_FOUND )
>                 MESSAGE( FATAL_ERROR "No expat installed" )
>         ENDIF( EXPAT_FOUND )
>
> ENDIF ( ${CMAKE_SYSTEM} MATCHES Linux OR ${CMAKE_SYSTEM} MATCHES  
> Darwin OR ${CMAKE_SYSTEM} MATCHES Freebsd )
>
>
> And the expat configure part works fine on Mac OS X ( which kernel  
> names Darwin )
>
> Thanks for all advices!
>
> Eddy Xu
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071017/fff5163c/attachment-0001.html


More information about the CMake mailing list