[CMake] FIND_PROGRAM Question.

Lars Pechan lars.pechan at parkerpechan.com
Wed Mar 30 00:27:03 EST 2005


Hi there,
I have a question about using the results of a FIND_PROGRAM on Windows.

I have a couple of FIND_PROGRAMS going to locate cat and awk (available 
from the UnixUtils pkg).

They work fine a return a Unix-style path, i.e.
${CAT} = G:/UnixUtils/usr/local/wbin/cat.exe and
${AWK} = G:/UnixUtils/usr/local/wbin/gawk.exe.

I then use these in a custom command like so:

ADD_CUSTOM_COMMAND(
   OUTPUT ${SOMEWHERE}/Somefile.txt
   COMMAND ${CAT}
   ARGS aFile | ${AWK} -f bFile > ${SOMEWHERE}/Somefile.txt
   DEPENDS aFile bFile
)

Now, CMake (CMakeCVS built 28/3/5) creates this Makefile:

G:\UnixUtils\usr\local\wbin\cat.exe aFile | 
G:/UnixUtils/usr/local/wbin/gawk.exe -f bFile ...

The problem is that CMake correctly generates a correct Windows path 
for the COMMAND argument but not so when another FIND_PROGRAM entity 
exists in the ARGS?

Is there any simple way around this? Is it a bug? Wouldn't it make 
sense if whenever the result of FIND_PROGRAM is used it is modified for 
the target platform? (as is the case for ${CAT} above but not ${GAWK}.

Regards,

/Lars 



More information about the CMake mailing list