[CMake] problem with ADD_DEFINITION
Nuno Lopes
nunoplopes at sapo.pt
Thu Aug 10 15:27:06 EDT 2006
Hello,
I'm new to cmake and I'm trying to port one of my projects to cmake, but I'm
having some difficulties with this:
# libxml2
PKGCONFIG( libxml-2.0 XML_INCLUDE_DIR XML_LIBRARY_DIR XML_LINK_FLAGS
XML_CFLAGS)
IF( NOT XML_INCLUDE_DIR )
MESSAGE("WARNING: libxml2 is not installed.")
ELSE( NOT XML_INCLUDE_DIR )
# Add libXML2 stuff
LINK_LIBRARIES(${XML_LINK_FLAGS})
ADD_DEFINITIONS(${XML_CFLAGS})
ENDIF( NOT XML_INCLUDE_DIR )
XML_CFLAGS is set to: -I/usr/include/libxml2
after running "cmake ." (2.4.2) with no errors/warnings, make fails with the
following message:
Frameworks/Communication/CMakeFiles/Communication.dir/flags.make:5: ***
missing separator. Stop.
make[1]: *** [Frameworks/Communication/CMakeFiles/Communication.dir/all]
Error 2
make: *** [all] Error 2
the contents of that file:
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.4
CXX_FLAGS
= -DCommunication_EXPORTS -fPIC -I/socrob/co/common/Frameworks/Predicates
-I/socrob/co/common/Frameworks/StateMachine -I/socrob/co/common/Frameworks/Communication
-I/socrob/co/common/Frameworks/Data -I/socrob/co/common/Frameworks/Logging
-I/socrob/co/common/Frameworks/Math -I/socrob/co/common/Frameworks/ObjectFunctions
-I/socrob/co/common/Frameworks/SocRobXML -I/socrob/co/common/Frameworks/Support
-I/socrob/co/common/Components/Cortex/TeamOrganizer -I/socrob/co/common/Components/Cortex/BehaviorCoordinator
-I/socrob/co/common/Components/Cortex/BehaviorExecutor -I/socrob/co/common/Components/EventManager
-I/socrob/co/common/Components/WorldInfo
-I/usr/include/libxml2
So the problem is that there is a newline before the libxml2 cflags. Is this
a bug in cmake or am I just doing something wrong?
Thanks in advance,
Nuno Lopes
More information about the CMake
mailing list