[Cmake] Conditional CMakeLists.txt on CMake version?

Ken Martin ken.martin at kitware.com
Wed May 22 20:10:05 EDT 2002


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




More information about the CMake mailing list