summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grc/CMakeLists.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
index 3714401bbb..859b9e9045 100644
--- a/grc/CMakeLists.txt
+++ b/grc/CMakeLists.txt
@@ -72,13 +72,16 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
set(blocksdir ${blocksdir}:/usr/local/${GRC_BLOCKS_DIR})
endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
-if (APPLE)
- set(GRC_XTERM_EXE "xterm")
-elseif(CYGWIN)
- set(GRC_XTERM_EXE "xterm")
-elseif(UNIX)
- set(GRC_XTERM_EXE "x-terminal-emulator")
-else()
+if(UNIX)
+ find_program(GRC_XTERM_EXE
+ NAMES xterminal-emulator gnome-terminal konsole xterm
+ HINTS ENV PATH
+ DOC "graphical terminal emulator used in GRC's no-gui-mode"
+ )
+ if(NOT GRC_XTERM_EXE)
+ set(GRC_XTERM_EXE "")
+ endif()
+else() # APPLE CYGWIN
set(GRC_XTERM_EXE "xterm")
endif()