[Cmake] Conditional CMakeLists.txt on CMake version?
Ken Martin
ken.martin at kitware.com
Thu May 23 11:39:53 EDT 2002
This doesn't really help with CMake 1.0 or 1.2 but for versions 1.4
and later I have added more options to the if command so that you can
do:
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.2)
MESSAGE ("It is greater than 1.2")
ELSE (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.2)
MESSAGE ("It is not greater than 1.2")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.2)
Ken
> -----Original Message-----
> From: cmake-admin at public.kitware.com
> [mailto:cmake-admin at public.kitware.com]On Behalf Of Ken Martin
> Sent: Wednesday, May 22, 2002 8:10 PM
> To: 'Amitha Perera'; cmake at public.kitware.com
> Subject: RE: [Cmake] Conditional CMakeLists.txt on CMake version?
>
>
> Something like the following will work,
>
> IF (CMAKE_MAJOR_VERSION MATCHES [1-9][0-9]*)
> IF (CMAKE_MINOR_VERSION MATCHES [2-9][0-9]*)
> SET(TIFF_RIGHT_VERSION 1)
> ENDIF (CMAKE_MINOR_VERSION MATCHES [2-9][0-9]*)
> ENDIF (CMAKE_MAJOR_VERSION MATCHES [1-9][0-9]*)
>
> but... it would be really nice to have LESS GREATER. We
> would need to
> agree on if the comparison would always be numeric or
> strcmp based. I'd
> say maybe have four keywords
>
> LESS
> GREATER
> STRLESS
> STRGREATER
>
> The only mods would be to cmIfCommand and cmElseCommand
>
> Ken
>
>
>
> -----Original Message-----
> From: cmake-admin at public.kitware.com
> [mailto:cmake-admin at public.kitware.com] On Behalf Of Amitha Perera
> Sent: Wednesday, May 22, 2002 6:37 PM
> To: cmake at public.kitware.com
> Subject: [Cmake] Conditional CMakeLists.txt on CMake version?
>
> Is there a way to condition CMakeLists.txt on the CMake version? I'd
> like to implement some changes to the vxl CMakeLists.txt
> files to use
> some of the 1.3 functionality, without breaking the builds for 1.2
> users. Something like
> IF( CMAKE<1.3 )
> do old stuff
> ELSE
> do new stuff
> ENDIF
>
> Thanks,
> Amitha.
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake
>
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake
More information about the CMake
mailing list