Skip to content

Commit

Permalink
Handle case if emacs --version fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
casch-at committed Nov 4, 2015
1 parent 42d244c commit fe85f94
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,19 @@ else ()
endif ()

if (EMACS_EXECUTABLE)
execute_process(COMMAND ${EMACS_EXECUTABLE} --version OUTPUT_VARIABLE EMACS_VERSION_INFORMATION ERROR_QUIET)
string(REGEX MATCH "[0-9]+(\\.[0-9])*" EMACS_VERSION ${EMACS_VERSION_INFORMATION})
if ("${EMACS_VERSION}" LESS "23")
message(STATUS "Installed emacs version is to old, elisp files are not going to be installed, minimum required version is >=23!")
set(RTAGS_NO_ELISP_FILES TRUE)
execute_process(COMMAND ${EMACS_EXECUTABLE} --version
RESULT_VARIABLE EMACS_ERROR
OUTPUT_VARIABLE EMACS_VERSION_INFORMATION
ERROR_QUIET)
if (NOT EMACS_ERROR)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)*" EMACS_VERSION ${EMACS_VERSION_INFORMATION})
if ("${EMACS_VERSION}" LESS "23")
message(STATUS "Installed emacs version is to old, elisp files are not going to be installed, minimum required version is >=23!")
set(RTAGS_NO_ELISP_FILES TRUE)
endif ()
else ()
message(STATUS "Could not get emacs version (\"emacs --version\"), elisp files are not going to be installed")
set(RTAGS_NO_ELISP_FILES TRUE)
endif ()
else ()
set(RTAGS_NO_ELISP_FILES TRUE)
Expand Down

0 comments on commit fe85f94

Please sign in to comment.