THRIFT-3097 cmake targets unconditionally depend on optional libraries
diff --git a/lib/py/CMakeLists.txt b/lib/py/CMakeLists.txt
index e92658d..ef987b6 100755
--- a/lib/py/CMakeLists.txt
+++ b/lib/py/CMakeLists.txt
@@ -17,6 +17,8 @@
 # under the License.
 #
 
+include_directories(${PYTHON_INCLUDE_DIRS})
+
 add_custom_target(python_build ALL
     COMMAND ${PYTHON_EXECUTABLE} setup.py build
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}