Detecting captive portal and showing a pop-up is something done by the OS of the device connecting to your AP. There is nothing much you can do it at your AP to show pop-up.
Most iOS and new Windows devices would do that but its not consistent on Android.
I am assuming you have a captive portal working already.
If you have captive portal working then you will be able to set a landing/splash page in its configuration. The way captive portals works is that when a user connects to your wifi hotspot he/she will be redirected to this landing page when they try to browse.
Pop-up is basically a browser too so when captive portal is detected by the OS the pop-up will opened by the OS which will then try to goto a URL (defined by the OS). However as user login has not been authorized by the wifi hotspot yet, user will be instead redirected to the landing page defined by you in captive portal setting.
If you do not have a fully functional captive portal working then you can use any of these, Coova Chilli, Chillispot, WiFiDog, NoCatSplash
Quoted in order of functionality supported and ease of implementation.