Diff of /CMakeLists.txt [b89155] .. [9928ad]  Maximize  Restore

Switch to side-by-side view

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -320,15 +320,21 @@
   endif()
   INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
   ADD_DEFINITIONS(-DHUGIN_HSI)
+  FIND_FILE(PYTHON_PATCHLEVEL_H patchlevel.h
+      PATHS ${PYTHON_INCLUDE_DIRS}
+  )
+  IF(${PYTHON_PATCHLEVEL_H} MATCHES "-NOTFOUND")
+      MESSAGE(FATAL_ERROR "Python patchlevel.h not found")
+  ENDIF()
   # get version of Python libs
-  FILE(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h"
-	  PY_DEF_MAJOR
-	  REGEX "#define[ \t]+PY_MAJOR_VERSION.*$")
-  FILE(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h"
+  FILE(STRINGS "${PYTHON_PATCHLEVEL_H}"
+      PY_DEF_MAJOR
+      REGEX "#define[ \t]+PY_MAJOR_VERSION.*$")
+  FILE(STRINGS "${PYTHON_PATCHLEVEL_H}"
       PY_DEF_MINOR
       REGEX "#define[ \t]+PY_MINOR_VERSION.*$")
 
-  FILE(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h"
+  FILE(STRINGS "${PYTHON_PATCHLEVEL_H}"
       PY_DEF_MICRO
       REGEX "#define[ \t]+PY_MICRO_VERSION.*$")
   STRING(REGEX

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks