Programmatically checking for NSBundle in macOS

I am building my application for macOS using CMake. My application can either be MACOSX_BUNDLE i.e. generated as a .app through CMake or it can even be a Unix-style executable. Is there a programmatic way in Obj-C to check if the executable is Unix-Style or NSBundle?

Programmatically checking for NSBundle in macOS
 
 
Q