[CMake] Expat problem

a.neundorf-work at gmx.net a.neundorf-work at gmx.net
Fri Oct 19 08:52:38 EDT 2007


On Thursday 18 October 2007 01:42, 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 )

CMake can't find a file named "Findexpat.cmake". If it works on OS X, check 
the case of "expat", OS X will also find "FindExpat.cmake" 
or "FindEXPAT.cmake", while on Linux only "FindExpat.cmake" matches.

Alex


More information about the CMake mailing list