Commit 590072c 1 parent 4ff2a87 commit 590072c Copy full SHA for 590072c
File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ EXEC_PROGRAM(
39
39
)
40
40
41
41
IF (SC_GLOBAL_PYTHON_WRAPPER)
42
- FIND_PACKAGE (PythonLibs REQUIRED)
42
+ IF (APPLE )
43
+ FIND_PACKAGE (PythonLibsApple REQUIRED)
44
+ ELSE (APPLE )
45
+ FIND_PACKAGE (PythonLibs REQUIRED)
46
+ ENDIF (APPLE )
43
47
FIND_PACKAGE (PythonInterp REQUIRED)
44
48
ENDIF (SC_GLOBAL_PYTHON_WRAPPER)
45
49
@@ -85,7 +89,7 @@ IF (APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
85
89
ELSEIF (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
86
90
SET (LINUX 1)
87
91
ENDIF (APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
88
-
92
+
89
93
# If gcc is installed add -wall and -pedantic to the commandline
90
94
#
91
95
IF (CMAKE_COMPILER_IS_GNUCC)
Original file line number Diff line number Diff line change
1
+ # the idea comes from here: https://github.com/commontk/PythonQt/issues/24#issuecomment-127639573
2
+ # this overwrite is needed to avoid collision if python version an mac if homebrew python is used
3
+ find_program (PYTHON_CONFIG_EXECUTABLE python-config)
4
+ if (NOT PYTHON_CONFIG_EXECUTABLE)
5
+ message (SEND_ERROR "python-config executable not found, but python is required." )
6
+ endif ()
7
+ # using "python-config --prefix" so that cmake always uses
8
+ # the python that is
9
+ # in the user's path, this is a fix for homebrew on Mac:
10
+ # https://github.com/Homebrew/homebrew/issues/25118
11
+ execute_process (COMMAND ${PYTHON_CONFIG_EXECUTABLE} --prefix OUTPUT_VARIABLE python_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
12
+ set (PYTHON_INCLUDE_DIR ${python_prefix} /include /python2.7 CACHE PATH "Path to where Python.h is found" FORCE)
13
+ set (PYTHON_LIBRARY ${python_prefix} /lib/libpython2.7${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE PATH "Path to where libpython2.7.dylib is found" FORCE)
You can’t perform that action at this time.
0 commit comments