I have ported a few applications to OpenBSD, but never an X-based one.
But ....
If you look at any Makefile for an existing port that uses X -- along with a bunch of X libraries in WANTLIB, you should see USE_X11=Yes. According to
bsd.port.mk(5), this is required to build ports that require X facilities.
Some analysis, such as:
$ find /usr/ports/infrastructure -type f -exec grep -i x11 {} /dev/null \; | less
may help you uncover information about how X applications are ported. You should note tools like build/resolve-lib and db/config.x11.site that set library and include paths for X, respectively. Based on my cursory review of this -- perhaps 30 seconds worth of find commands, CPATH is not set within the ports infrastructure.
You may want to start with an existing port with similar infrastructure requirements, and build your own based on its Makefile structure.
See
www.openbsd.org/porting.html for the start of many web pages on porting applications.