[CMake] no space between include path

frederic heem frederic.heem at telsey.it
Tue Oct 3 12:28:23 EDT 2006


Hi,
Wireshark is being converted to cmake, when the dbus library is added, cmake 
doesn't add any space between the current source include path and the dbus 
path, and it adds the character "\" after each dbus path.
/usr/bin/gcc  -I/home/heefre/software/dbus/wireshark/build -I/home/heefre/software/dbus/wireshark -I/home/heefre/software/dbus/wireshark/wiretap -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/home/heefre/software/dbus/wireshark/-I/usr/include/dbus-1.0\ -I/usr/lib/dbus-1.0/include\ -I/usr/include/glib-2.0\ -I/usr/lib/glib-2.0/include   -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -o 
CMakeFiles/dumpcap.dir/capture_loop.o   -c /home/heefre/software/dbus/wireshark/capture_loop.c
If instead of adding the dbus library, another library is added, space are 
present.
Here is the wireshark CMakeLists.txt snippet:

set(PACKAGELIST ZLIB PCAP)

#D-Bus
option(ENABLE_DBUS	    "Build with D-Bus support" ON)
if(ENABLE_DBUS)
  set(PACKAGELIST DBUSGLIB ${PACKAGELIST})
  set(dumpcap_FILES ${dumpcap_FILES} dbus/wireshark-dbus-sniffer.c)
endif(ENABLE_DBUS)

foreach(PACKAGE ${PACKAGELIST})
	find_package(${PACKAGE})
	message(${PACKAGE}_FOUND)
	if (${PACKAGE}_FOUND)
		include_directories(${${PACKAGE}_INCLUDE_DIR})
		set(dumpcap_LIBS ${dumpcap_LIBS} ${${PACKAGE}_LIBRARIES})
	endif (${PACKAGE}_FOUND)
endforeach(PACKAGE)


here is the  FindDBUSGLIB.cmake
# - Locate DBusGlib include paths and libraries
#  DBusGlib can be found at http://www.freedesktop.org/wiki/Software/dbus
#  Written by Frederic Heem, frederic.heem _at_ telsey.it

# This module defines
#  DBUSGLIB_FOUND, true if DBusGlib has been found
#  DBUSGLIB_VERSION, the DBusGlib version 
#  DBUSGLIB_INCLUDE_DIRS, where to find dbus/dbus-glib.h, etc.
#  DBUSGLIB_LIBRARIES, library to link againt DBusGlib
#  DBUSGLIB_DEFINITIONS, the definitions used to compile DBusGlib

#D-Bus is required by DBusGlib
FIND_PACKAGE(DBUS REQUIRED)

#Found the DBusGlib package
PKGCONFIG_FOUND(dbus-glib-1 DBUSGLIB_FOUND)

IF(DBUSGLIB_FOUND)
  MESSAGE(STATUS "DBusGlib found")
ELSE(DBUSGLIB_FOUND)
  MESSAGE(FATAL "DBusGlib cannot be found")
ENDIF(DBUSGLIB_FOUND)

#use pkgconfig to fill information
PKGCONFIG(dbus-glib-1 DBUSGLIB_INCLUDE_DIR_SYSTEM DBUSGLIB_LIBRARY_DIR 
DBUSGLIB_LINK_FLAGS DBUSGLIB_C_FLAGS)

#Include path
SET(DBUSGLIB_INCLUDE_PATH_DESCRIPTION "directory containing the dbus-glib-1 
include files. E.g /home/fred/dbus-glib-1/include or c:
\\dbus-glib-1\\include")

SET(DBUSGLIB_INCLUDE_DIR ${DBUSGLIB_INCLUDE_DIR_SYSTEM})
SET(DBUSGLIB_INCLUDE_DIRS ${DBUSGLIB_INCLUDE_DIR})

IF(DBUSGLIB_INCLUDE_DIRS)
  MESSAGE(STATUS "DBusGlib include dir set to ${DBUSGLIB_INCLUDE_DIRS}")
ELSE(DBUSGLIB_INCLUDE_DIRS)
  MESSAGE(FATAL "DBusGlib include dir cannot be found")
ENDIF(DBUSGLIB_INCLUDE_DIRS)

#Library
SET(PWLIB_LIB_PATH_DESCRIPTION "The directory containing the dbus-glib-1 
library. E.g /home/fred/dbus-glib-1/lib or c:\\dbus-glib-1\\lib")

FIND_LIBRARY(DBUSGLIB_LIBRARY
  NAMES 
    dbus-glib-1
  PATHS
    ${DBUSGLIB_LIBRARY_DIR}
  DOC " ${DBUSGLIB_LIB_PATH_DESCRIPTION}"
  NO_DEFAULT_PATH  
)

FIND_LIBRARY(DBUSGLIB_LIBRARY
  NAMES 
    dbus-glib-1
  DOC " ${DBUSGLIB_LIB_PATH_DESCRIPTION}"  
)

SET(DBUSGLIB_LIBRARIES ${DBUSGLIB_LIBRARY}) 

IF(DBUSGLIB_LIBRARIES)
  MESSAGE(STATUS "DBusGlib lib set to ${DBUSGLIB_LIBRARIES}")
ELSE(DBUSGLIB_LIBRARIES)
  MESSAGE(FATAL "DBusGlib library cannot be found")
ENDIF(DBUSGLIB_LIBRARIES)

#Version
PKGCONFIG_VERSION(dbus-glib-1 DBUSGLIB_VERSION)
MESSAGE(STATUS "DBusGlib version is ${DBUSGLIB_VERSION}")

#Definition
PKGCONFIG_DEFINITION(dbus-glib-1 DBUSGLIB_DEFINITIONS)
MESSAGE(STATUS "DBusGlib definitions are ${DBUSGLIB_DEFINITIONS}")

MARK_AS_ADVANCED(
  DBUSGLIB_INCLUDE_DIR
  DBUSGLIB_LIBRARY
) 


______________________________________________________________________________

--- NOTICE ---

CONFIDENTIALITY - This  email  and  any  attachments  are confidential and are
intended  for  the  addressee  only.   If  you  have  received this message by
mistake,  please  contact us immediately and then delete the message from your
system.  You  must  not copy, distribute, disclose or act upon the contents of
this email. Thank you.

PERSONAL DATA PROTECTION  (Law  by  Decree  30.06.2003  n. 196) - Personal and
corporate  data  submitted  will  be used in a correct, transparent and lawful
manner. The data collected will be processed in paper or computerized form for
the performance of contractual  and  lawful  obligations  as  well  as for the
effective management of business relationship. Data may be disclosed, in Italy
or abroad, for the purpose above mentioned to third  parties  which  cooperate
with Telsey, agents, banks, factoring companies,  credit recovering companies,
credit  insurance  companies,  professional  and  consultants,  and   shipping
companies. In relation to the same purposes, data  may  be  processed  by  the
following  classes  of  executors  or  processors:  management; administration
department; logistics  and  purchase  department; sales department; post sales
department quality department; R&D department; IT department; legal department.
The  data  processor  is  Telsey S.p.A.  The data subject may exercise all the
rights set forth in art. 7 of Law by Decree 30.06.2003  n. 196 as reported  in
in the following link http://www.telsey.it/privacy.jsp. 

______________________________________________________________________________


More information about the CMake mailing list