From f3c6eba389bd1284c0013322ef0c7da61949c2b7 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 2 Feb 2013 12:22:26 -0800 Subject: [PATCH] Throw fatal error if cmake finds python3 --- cpp/BoostParts/CMakeLists.txt | 6 ++++++ cpp/ycm/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/cpp/BoostParts/CMakeLists.txt b/cpp/BoostParts/CMakeLists.txt index 51dd1f82..1d7a5bfc 100644 --- a/cpp/BoostParts/CMakeLists.txt +++ b/cpp/BoostParts/CMakeLists.txt @@ -34,6 +34,12 @@ project( BoostParts ) set( Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 ) find_package( PythonLibs 2 REQUIRED ) +if ( NOT PYTHONLIBS_VERSION_STRING VERSION_LESS "3.0.0" ) + message( FATAL_ERROR + "CMake found python3 libs instead of python2 libs. YCM works only with " + "python2.\n" ) +endif() + file( GLOB_RECURSE SOURCES *.cpp ) # We need to remove all the thread cpp files and then add them on a per-platform diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index b2514f8c..a55ffaf1 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -22,6 +22,12 @@ project( ycm_core ) set( Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 ) find_package( PythonLibs 2 REQUIRED ) +if ( NOT PYTHONLIBS_VERSION_STRING VERSION_LESS "3.0.0" ) + message( FATAL_ERROR + "CMake found python3 libs instead of python2 libs. YCM works only with " + "python2.\n" ) +endif() + option( USE_CLANG_COMPLETER "Use Clang semantic completer for C/C++/ObjC" OFF ) option( PATH_TO_LLVM_ROOT "Path to the root of a LLVM+Clang binary distribution" ) option( USE_SYSTEM_LIBCLANG "Set to ON to use the system libclang library" OFF )