(1)
Instead of changing the behavior of cmake itself,
Two lines to setup CMAKE environment in this side.
(2)
Now condition is added for X11_TYPE is modular or not.
This also related to cmake PATH only.

Thanks obache@
Use CMAKE_PREFIX_PATH correctly as argument of cmake.