Improve the error a user gets when trying to build the pyhton extention on windows but they didn't install visual C++.

This commit is contained in:
Davis King 2020-06-27 20:08:39 -04:00
parent b9f4da5522
commit 71b303d883
1 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,16 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) 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) project(dlib_python_bindings)
# Pybind11's cmake scripts enable link time optimization by default. However, # Pybind11's cmake scripts enable link time optimization by default. However,