diff --git a/tools/python/CMakeLists.txt b/tools/python/CMakeLists.txt index 7b31f98f2..0b68f53e4 100644 --- a/tools/python/CMakeLists.txt +++ b/tools/python/CMakeLists.txt @@ -1,5 +1,16 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) + +if (WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio") + message(FATAL_ERROR "\n" + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + "You must use Visual Studio to build a python extension on windows. If you " + "are getting this error it means you have not installed Visual C++. Note that " + "there are many flavors of Visual Studio, like Visual Studio for C\# development. " + "You need to install Visual Studio for C++. \n" + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n") +endif() + project(dlib_python_bindings) # Pybind11's cmake scripts enable link time optimization by default. However,