| 1 |
# DetectBrowser.cmake -- Detect web browser launcher application |
| 2 |
|
| 3 |
# Set default command to open browser. Override with -DWEB_BROWSER=... |
| 4 |
if (APPLE OR MSVC) |
| 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") |
| 8 |
else() |
| 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") |
| 13 |
else() |
| 14 |
# Debian is different: "sensible-browser" provides auto-detection |
| 15 |
set(WEB_BROWSER "sensible-browser" CACHE STRING "Command to open web browser") |
| 16 |
endif() |
| 17 |
else() |
| 18 |
# Default for non Linux/non Mac/non Windows platform... |
| 19 |
set(WEB_BROWSER "firefox" CACHE STRING "Command to open web browser") |
| 20 |
endif() |
| 21 |
message(STATUS "Web browser launcher command is: ${WEB_BROWSER}") |
| 22 |
endif() |