Skip to content

Instantly share code, notes, and snippets.

View JesseTG's full-sized avatar
💯
Certified authentic.

Jesse Talavera JesseTG

💯
Certified authentic.
View GitHub Profile
@JesseTG
JesseTG / FindPythonModule.cmake
Created December 6, 2015 19:10
CMake module for detecting the presence of a given Python module
# Find if a Python module is installed
# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
# To use do: find_python_module(PyQt4 REQUIRED)
function(find_python_module module)
string(TOUPPER ${module} module_upper)
if(NOT PY_${module_upper})
if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
set(${module}_FIND_REQUIRED TRUE)
endif()
# A module's location is usually a directory, but for binary modules