From a1e6fcbfc5493a4559c2581ef077bd4666dfcd39 Mon Sep 17 00:00:00 2001 From: q-posev Date: Wed, 17 Nov 2021 10:07:19 +0100 Subject: [PATCH] add detection of emacs and min required version of Python3 --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b688d92..073d0f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,19 @@ option(TREXIO_DEVEL "TREXIO developer mode (for code generation)." OFF) if(EXISTS ".git/config") set(TREXIO_DEVEL ON) - find_package(Python3) + find_package(Python3 REQUIRED) if(Python3_FOUND) - message(STATUS "Python3 version :: ${Python3_VERSION}") + if(Python3_VERSION_MINOR LESS 6) + message(FATAL_ERROR "Required Python3 version :: >= 3.6; Found :: ${Python3_VERSION}") + else() + message(STATUS "Python3 version :: ${Python3_VERSION}") + endif() + endif() + find_program(EMACS NAMES emacs REQUIRED) + if(NOT EMACS-NOTFOUND) + message(STATUS "EMACS detected :: ${EMACS}") + else() + message(FATAL_ERROR "EMACS not found. It is required to produce TREXIO source code from org-mode files.") endif() endif()