[CMake] comparing strings
cmake.cmake.narkive.com › 4jrIzJjL › comparing-stringsstring (COMPARE EQUAL "$ {build_system}" windows _cmp) if (_cmp) ... endif () It will make it ugly to create a nested if else block, but it'll work. You can do if ("$ {myvar}" MATCHES "somestring") or more strict if ("$ {myvar}" MATCHES "^somestring$") Alex Shaun Williams 9 years ago Thanks, I will be using this method: