Skip to content

Commit 9930958

Browse files
committed
build: ask Python for the path to its header files
CMake can sometimes guess the wrong path to Python's header files. Ask Python for the path directly.
1 parent f4479d6 commit 9930958

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/SeExprEditor/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ macro(get_build_info NAME STORAGE)
2424
endmacro()
2525

2626
get_build_info(python-site PYTHON_SITE)
27+
get_build_info(python-inc PYTHON_INCLUDE_DIR)
2728
get_build_info(sip-inc SIP_INCLUDE_DIR)
2829
get_build_info(pyqt4-sip PYQT4_SIP)
2930

@@ -90,7 +91,7 @@ ENDIF(WIN32)
9091
set(CMAKE_CXX_FLAGS "-std=c++0x")
9192
set(CMAKE_INSTALL_PYTHON "${PYTHON_SITE}/SeExpr" )
9293
include_directories(${SIP_INCLUDE_DIR} ${PYQT4_SIP}
93-
${PYTHON_INCLUDE_DIRS} ${QT_INCLUDE_DIR}/QtCore
94+
${PYTHON_INCLUDE_DIR} ${QT_INCLUDE_DIR}/QtCore
9495
${QT_INCLUDE_DIR}/QtGui)
9596

9697
add_custom_command(OUTPUT sipexpreditorpart0.cpp

src/build/build-info

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def main():
1919

2020
callbacks = (
2121
('python-site', python_site),
22+
('python-inc', python_inc),
2223
('pyqt4-sip', pyqt4_sip),
2324
('sip-inc', sip_inc),
2425
)
@@ -44,6 +45,10 @@ def python_ver(args):
4445
return sc.get_python_version()
4546

4647

48+
def python_inc(args):
49+
return sc.get_config_var('CONFINCLUDEPY')
50+
51+
4752
def python_site(args):
4853
ver = python_ver(args)
4954
return os.path.join(lib(args), 'python' + ver, 'site-packages')

0 commit comments

Comments
 (0)