steinbergmedia / vst3sdk

VST 3 Plug-In SDK
Other
1.61k stars 163 forks source link

cmake fails if `${CMAKE_CURRENT_LIST_DIR}` includes a directory recognized as regular expression #76

Closed wrist closed 3 years ago

wrist commented 3 years ago

https://github.com/steinbergmedia/vst3sdk/blob/8199057209c2b45f7482b2962c4e25a5399447dc/CMakeLists.txt#L36 The above code uses MATCHES to compare ${CMAKE_SOURCE_DIR} and ${CMAKE_CURRENT_LIST_DIR} but the right hand side of MATCHES is recognized as regular expression, so if ${CMAKE_CURRENT_LIST_DIR} includes a string such like c++, then cmake fails with the below error messages.

RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at /Users/wrist/work/vst/c++/VST_SDK/VST3_SDK/CMakeLists.txt:36 (if):
  if given arguments:

    "NOT" "/Users/wrist/work/vst/MyVSTPlug" "MATCHES" "/Users/wrist/work/vst/c++/VST_SDK/VST3_SDK"

  Regular expression "/Users/wrist/work/vst/c++/VST_SDK/VST3_SDK" cannot
  compile

-- Configuring incomplete, errors occurred!

I think STREQUAL should be used instead of MATCHES if there isn't any reason to use MATCHES.

ygrabit commented 3 years ago

yes, we already changed it to: if(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_LIST_DIR}) is part of the next update Thanks