[Cmake] CMake string matching in an IF condition

Bill Hoffman bill.hoffman at kitware.com
Tue Jan 15 17:27:51 EST 2002


The NOT part will not work.

However, you can have an empty IF,
so it would be:

IF( ${allvxl_BUILD_DIR} MATCHES ${allvxl_SOURCE_DIR} )
ELSE( ${allvxl_BUILD_DIR} MATCHES ${allvxl_SOURCE_DIR} )
  INCLUDE( ${allvxl_BUILD_DIR}/CMakeListsLocal.txt OPTIONAL )
ENDIF

At 03:04 PM 1/15/2002 -0500, Wheeler, Fred (CRD) wrote:
>Is something like the MATCHES line below possible in CMake?  Can I test whether two strings are (not)
>equal?  The manual is not clear on the subject.  I'd like to scan the BUILD dir for CMakeListsLocal
>to keep the source dir pure, but I don't want to include CMakeListsLocal twice.
>
># This line is already in VXLSRC/CMakeLists.txt
>INCLUDE( ${allvxl_SOURCE_DIR}/CMakeListsLocal.txt OPTIONAL )
># The rest is new, and I think useful
># include CMakeListsLocal.txt from BUILD dir if not the same as SOURCE
>IF( NOT ${allvxl_BUILD_DIR} MATCHES ${allvxl_SOURCE_DIR} )
>  INCLUDE( ${allvxl_BUILD_DIR}/CMakeListsLocal.txt OPTIONAL )
>ENDIF
>
>Thanks,
>Fred Wheeler
>
>--
>Fred Wheeler, GE CRD, KWC-303
>Phone: 518-387-7225 (GE Internal Dialcom: 8*833-7225)
>Fax:   518-387-4042 (GE Internal Dialcom: 8*833-4042)
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake 




More information about the CMake mailing list