[CMake] FIND_PROGRAM w/ CMake 2.8.2 and Cygwin

marco atzeri marco.atzeri at gmail.com
Tue Jan 11 03:49:59 EST 2011


On Mon, Jan 10, 2011 at 6:55 PM, Emmanuel Blot <eblot.ml at gmail.com> wrote:
> On Mon, Jan 10, 2011 at 5:56 PM, marco atzeri <marco.atzeri at gmail.com> wrote:
>> I don't understand why you find and empty definition
>
> Well, it seems that CYGWIN is not defined:
>
>  MESSAGE (STATUS "CYGWIN: ${CYGWIN}")
>  MESSAGE (STATUS "Suffix: ${CMAKE_EXECUTABLE_SUFFIX}")
>  FIND_PROGRAM (xcc1 ${XTOOLCHAIN}-gcc-${XCC_VER})
>  MESSAGE (STATUS "XCC1 evaluates to ${xcc1}")
>  SET (CMAKE_EXECUTABLE_SUFFIX ".exe")
>  MESSAGE (STATUS "Suffix: ${CMAKE_EXECUTABLE_SUFFIX}")
>  FIND_PROGRAM (xcc2 ${XTOOLCHAIN}-gcc-${XCC_VER})
>  MESSAGE (STATUS "XCC2 evaluates to ${xcc2}")
>  FIND_PROGRAM (xcc3 ${XTOOLCHAIN}-gcc-${XCC_VER}.exe)
>  MESSAGE (STATUS "XCC3 evaluates to ${xcc3}")
>
> gives:
>
> -- CYGWIN:
> -- Suffix:
> -- XCC1 evaluates to xcc1-NOTFOUND
> -- Suffix: .exe
> -- XCC2 evaluates to xcc2-NOTFOUND
> -- XCC3 evaluates to /usr/local/gnu-eabi-4.5.2/bin/arm-eabi-gcc-4.5.2.exe
>
> Forcing CMAKE_EXECUTABLE_SUFFIX does not help either.
>
> Is there some special invokation to perform so that CYGWIN gets detected?
> Maybe some cross-compilation setting invalidates the CYGWIN detection?
>
> Cheers,
> Manu
>

Manu,
please maintain the discussion on the mailing list as these is a general issue

if you are cross compiling, the target is not cygwin, so CYGWIN is not defined.
However on cygwin both

arm-eabi-gcc-4.5.2.exe
arm-eabi-gcc-4.5.2

are valid program names and you can call them.

I am not familiar with cmake and cross compiling, so I can help you on
the specific matter.

Marco


More information about the CMake mailing list