[CMake] Does CMake cannot handle directory name with space?

Dancefire dancefire at gmail.com
Thu Mar 19 03:53:22 EDT 2009


Hi,

I'm working on a gtkmm program. I got success using CMake under Linux.
However, I got problems when I try to use it under Windows.

My gtkmm installation directory is "E:\Program Files\gtkmm", I also use
boost, which I unzipped it under "E:\Program Files\boost_1_38_0".

I put following lines in CMakeLists.txt for using gtkmm and Boost library.

find_package( Boost REQUIRED )
find_package( PkgConfig REQUIRED )
pkg_check_modules(GTKMM gtkmm-2.4)

include_directories(${Boost_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS})
link_directories( ${GTKMM_LIBRARY_DIRS} )
add_executable (curves ${CURVES_SRCS})
target_link_libraries (curves ${Boost_LIBRARY_DIRS} ${GTKMM_LIBRARIES})

There are 2 problems I got.

The first one is that CMake cannot find Boost library, which I just unzipped
it to the above directory, since I only need some headers, no linking
required. How find_package(boost) works? How can I make it find the boost
library automatically, without manually specify the boost location?

The second problem is that, for gtkmm, CMake found gtkmm, it is good,
however, it breaks the path, "E:\Program Files\gtkmm" to "E:\Program", and
treat "Files\gtkmm" as the second arguments. So, in generated MSVC project
file, the include directories setting is :

"E:\Program Files\boost_1_38_0";E:\Program;

Which cause fail to compile my project using generated MSVC project. And in
CMakeCache.txt, there are many things like:

GTKMM_CFLAGS:INTERNAL=Files/gtkmm/include/gtkmm-2.4;Files/gtkmm/lib/gtkmm-2.4/include;Files/gtkmm/include/glibmm-2.4;Files/gtkmm/lib/glibmm-2.4/include;Files/gtkmm/include/giomm-2.4;Files/gtkmm/lib/giomm-2.4/include;Files/gtkmm/include/gdkmm-2.4;Files/gtkmm/lib/gdkmm-2.4/include;Files/gtkmm/include/pangomm-1.4;Files/gtkmm/include/atkmm-1.6;Files/gtkmm/include/gtk-2.0;-mms-bitfields;Files/gtkmm/include/sigc++-2.0;Files/gtkmm/lib/sigc++-2.0/include;Files/gtkmm/include/glib-2.0;Files/gtkmm/lib/glib-2.0/include;Files/gtkmm/lib/gtk-2.0/include;Files/gtkmm/include/cairomm-1.0;Files/gtkmm/include/pango-1.0;Files/gtkmm/include/cairo;Files/gtkmm/include/libpng12;Files/gtkmm/include/atk-1.0;-IE:/Program
GTKMM_INCLUDEDIR:INTERNAL=E:/Program;Files/gtkmm/include

Is this a bug of CMake? or anything I missed?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090319/b41402d4/attachment.htm>


More information about the CMake mailing list