1 # DetectBrowser.cmake -- Detect web browser launcher application
3 # Set default command to open browser. Override with -DWEB_BROWSER=...
5 # opening the web browser is hardcoded for Mac and Windows,
6 # so this doesn't really have an effect...
7 set(WEB_BROWSER "open")
9 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
10 # "xdg-open" provides run-time detection of user's preferred browser on (most) Linux.
11 if (NOT LINUX_DISTRO MATCHES "Debian")
12 set(WEB_BROWSER "xdg-open" CACHE STRING "Command to open web browser")
14 # Debian is different: "sensible-browser" provides auto-detection
15 set(WEB_BROWSER "sensible-browser" CACHE STRING "Command to open web browser")
18 # Default for non Linux/non Mac/non Windows platform...
19 set(WEB_BROWSER "firefox" CACHE STRING "Command to open web browser")
21 message(STATUS "Web browser launcher command is: ${WEB_BROWSER}")