Skip to content

Commit 849e596

Browse files
authored
Merge pull request python-cmake-buildsystem#189 from msmolens/fix-apply-patches-external-source
Fix applying patches when external source is provided
2 parents 03616b1 + 99caa2d commit 849e596

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ If you already downloaded the source, you could try to re-configure this project
235235
endif()
236236
message(STATUS "SRC_DIR: ${SRC_DIR}")
237237

238-
# Apply patches
239-
option(PYTHON_APPLY_PATCHES "Apply patches" ON)
240-
if(PYTHON_APPLY_PATCHES)
241-
include(cmake/PythonApplyPatches.cmake)
242-
endif()
243-
244238
# Extract version from python source (Copied from FindPythonLibs.cmake)
245239
file(STRINGS "${SRC_DIR}/Include/patchlevel.h" python_version_str
246240
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
@@ -258,6 +252,12 @@ if(NOT DEFINED _download_${PY_VERSION}_md5)
258252
message(FATAL_ERROR "error: unknown python version '${PY_VERSION}'. Valid version should match '2.7.[3-13]' or '3.5.[1-2]'")
259253
endif()
260254

255+
# Apply patches
256+
option(PYTHON_APPLY_PATCHES "Apply patches" ON)
257+
if(PYTHON_APPLY_PATCHES)
258+
include(cmake/PythonApplyPatches.cmake)
259+
endif()
260+
261261
# Convenience boolean variables to easily test python version
262262
set(IS_PY3 0)
263263
set(IS_PY2 1)

0 commit comments

Comments
 (0)