I observed that Cflags were corrupted during the cmake
I am working on a simple libxml example code from
http://www.xmlsoft.org/examples/xpath2.c
(http://www.xmlsoft.org/examples/xpath2.c). For some reason, my current working
directory is prepended without a space ' '.
CMakeFiles/nmapWrapper.dir/flags.make:C_FLAGS =
-I/Users/sriram/xmlparse/-I/Appl...
Removing this from the flags results in a successfull compilation:
$ cc
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2
`xml2-config --libs` xpath2.c -o xpath2
Thanks,
Sriram
cmake_minimum_required (VERSION 3.0.2)
project (nmapWrapper)
# The version number.
set (nmapWrapper_VERSION_MAJOR 1)
set (nmapWrapper_VERSION_MINOR 0)
# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/xpath2Config.h.in"
"${PROJECT_BINARY_DIR}/xpath2Config.h"
)
#
# Use xml2-libs
#
if (XML2_LIBS)
set (LIBS ${XML2_LIBS})
endif (XML2_LIBS)
#
# Use xml2 cflags
#
if (XML2_CFLAGS)
include_directories ("${XML2_CFLAGS}")
endif (XML2_CFLAGS)
#
# USe xml2
# add the binary tree to the search path for include files
# so that we will find xpath2Config.h
#include_directories("${PROJECT_BINARY_DIR}")
# add the executable
add_executable(nmapWrapper xpath2.c)
target_link_libraries (nmapWrapper ${LIBS} )
# add the install targets
install (TARGETS nmapWrapper DESTINATION bin)
install (FILES "${PROJECT_SOURCE_DIR}/xpath2Config.h"
DESTINATION .)
// the configured options and settings for nmapWrapper
#define nmapWrapper_VERSION_MAJOR @nmapWrapper_VERSION_MAJOR@
#define nmapWrapper_VERSION_MINOR @nmapWrapper_VERSION_MINOR@
--
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-developers