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

Dancefire dancefire at gmail.com
Fri Mar 20 02:38:55 EDT 2009


Hi, Philip,

I tested your script FindGTK2.cmake on my computer, I got some problems, but
I fixed them. The problem is that I install gtkmm only for current user, so
the path can not be found at
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path], so I add some lines for
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]. And one more suggestion, I
don't know how, but if it is possible to use the environment variable
"GTKMM_BASEPATH", which contain the gtkmm installation base path and setup
by installer, then it will more easily locate the gtkmm.

The following is the path for adding HKEY_CURRENT_USER one:

=======  CUT BEGIN =======
--- FindGTK2.orig.cmake    2009-03-20 17:15:44.383749000 +1100
+++ FindGTK2.cmake    2009-03-20 17:12:49.334827000 +1100
@@ -91,6 +91,8 @@
             /usr/lib
             [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/include
             [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+            [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include
+            [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
         PATH_SUFFIXES
             ${_suffixes}
     )
@@ -188,6 +190,7 @@
         NAMES ${_lib_list}
         PATHS
         [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+        [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
         )
     IF(${_expand_vc} AND MSVC)

@@ -199,6 +202,7 @@
             NAMES ${_libd_list}
             PATHS
             [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+            [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
         )
         IF(NOT GTK2_SKIP_MARK_AS_ADVANCED)
             MARK_AS_ADVANCED(${_var}_DEBUG)
=======   CUT END  =======

On Fri, Mar 20, 2009 at 2:45 PM, Philip Lowman <philip at yhbt.com> wrote:

> On Thu, Mar 19, 2009 at 8:24 PM, Dancefire <dancefire at gmail.com> wrote:
>
>> I'm using the latest stable version, 2.6.3, which is downloaded from
>> http://www.cmake.org/cmake/resources/software.html
>
>
> Yes, the problem is most likely in FindPkgConfig.cmake:136.  This module
> looks like it takes the output from pkg-config --cflags and assumes that
> each compilation flag is separated by spaces.  Can you open a bug for this
> and include the output from "pkg-config --cflags gtkmm"?
>

I get the output of pkg-config --cflags gtkmm-2.4, however, the problem may
be pkg-config. The returned path from pkg-config are broken by space.

E:\Program Files\gtkmm>pkg-config --libs gtkmm-2.4
Files/gtkmm/lib -LE:/Program -lgtkmm-2.4 -lgiomm-2.4 -lgdkmm-2.4 -latkmm-1.6
-lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0
-lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0
-lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0
-lglib-2.0 -lintl

E:\Program Files\gtkmm>pkg-config --cflags gtkmm-2.4
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



>
> Not sure how best to fix the issue if it is what I suspect it is.
>
>
>> Yeah, it is might be a bug in FindPkgConfig.cmake. I will have a try of
>> your script. And hope it can be integrated in to CMake modules if it works
>> better.
>
>
> I have an outstanding action item to check it into CVS and promise
> certainly do so if it works for you too. :)
>
> I have been meaning to add version checking and try it out on some older
> systems with GTK 2.2 or 2.6 on them but I haven't gotten around to it yet
> because my RHEL3 box died at work.  Part of the problem of not using
> pkg-config is that you also loose the dependency list so the module needs to
> know things like "not having cairo on GTK < 2.x is not a big deal", etc.
>
> --
> Philip Lowman
>



-- 
Tao Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090320/b4bed43e/attachment.htm>


More information about the CMake mailing list