-IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(PYTHON_LIBRARY_DLL "python27_d.lib")
+
+IF(WIN32)
+ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ SET(PYTHON_LIBRARY_FILE "python27_d.lib")
+ ElSE()
+ SET(PYTHON_LIBRARY_FILE "python27.lib")
+ ENDIF()
ElSE()
- SET(PYTHON_LIBRARY_DLL "python27.lib")
+ SET(PYTHON_LIBRARY_FILE "libpython2.7.so")
ENDIF()
-FILE(TO_CMAKE_PATH "$ENV{PYTHON_LIB_DIR}/${PYTHON_LIBRARY_DLL}" PYTHON_LIBRARY)
-FILE(TO_CMAKE_PATH $ENV{PYTHON_INC_DIR} PYTHON_INCLUDE_DIR)
+IF(WIN32)
+ FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/libs/${PYTHON_LIBRARY_FILE}" PYTHON_LIBRARY)
+ElSE()
+ FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/lib/${PYTHON_LIBRARY_FILE}" PYTHON_LIBRARY)
+ENDIF()
-FIND_PACKAGE(PythonLibs)
+FILE(TO_CMAKE_PATH $ENV{PYTHON_INCLUDE} PYTHON_INCLUDE_DIR)
+FIND_PACKAGE(PythonLibs REQUIRED)
+FIND_PACKAGE(PythonInterp REQUIRED)
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
+#MESSAGE(STATUS "PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES})
+#MESSAGE(STATUS "PYTHON_INCLUDE_DIR: " ${PYTHON_INCLUDE_DIR})