[Cmake] CMake string matching in an IF condition

Wheeler, Fred (CRD) wheeler at crd . ge . com
Tue, 15 Jan 2002 15:04:36 -0500


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)