On Friday 28 July 2006 15:49, William A. Hoffman wrote:
> At 07:20 PM 7/27/2006, Andreas Beckermann wrote:
> >Hi
> >I have a problem with the search order of FIND_PROGRAM in cmake 2.4.2. The
> >docs say:
> >
[...]
> >SET(KDE3_DCOPIDL_EXECUTABLE "")
> >FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAME dcopidl)
> >
> >This code won't find dcopidl. If I remove the SET() line however, dcopidl
> > _is_ found.
> >
> >So to me this looks like a cmake bug. Any idea how to work around this?
>
> The key word is NAMES and not name, that is the problem.  It should be :
[...]

Interesting - this indeed fixes the problem, thanks a lot. Attached is a patch 
that fixes cmake's official FindKDE3.cmake from cvs accordingly.
The other issues mentioned at
  http://www.cmake.org/Bug/bug.php?op=show&bugid=3325&pos=1
are not addressed by this patch. See that bug report for fixes for them.


Anyway I'd like to know why 
  FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAME dcopidl)
works at all then. From the docs I'd say find_program should search for a 
program named "NAME" now, which of course does not exist.
However if KDE3_DCOPIDL_EXECUTABLE is not set, this call _does_ 
find /usr/bin/dcopidl, although the "dcopidl" is at a meaningless (according 
to the docs) position.

Why is that so?
And why does it behave differently when KDE3_DCOPIDL_EXECUTABLE has been set 
to something before?
I'd really like to understand that.

CU
Andi
Index: FindKDE3.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindKDE3.cmake,v
retrieving revision 1.3
diff -u -3 -p -r1.3 FindKDE3.cmake
--- FindKDE3.cmake	21 Mar 2006 17:56:01 -0000	1.3
+++ FindKDE3.cmake	28 Jul 2006 14:10:56 -0000
@@ -132,18 +132,18 @@ GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KD
 #)
 
 #now search for the dcop utilities
-FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAME dcopidl PATHS
+FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl PATHS
   $ENV{KDEDIR}/bin
   /opt/kde/bin
   /opt/kde3/bin
   )
 
-FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAME dcopidl2cpp PATHS
+FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp PATHS
   $ENV{KDEDIR}/bin
   /opt/kde/bin
   /opt/kde3/bin)
 
-FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAME kconfig_compiler PATHS
+FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler PATHS
   $ENV{KDEDIR}/bin
   /opt/kde/bin
   /opt/kde3/bin)
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to