Skip to content

Commit

Permalink
Simplify build
Browse files Browse the repository at this point in the history
Set Python_ROOT_DIR to find
python. Should not require exact
python version anymore.
  • Loading branch information
tpeulen committed Nov 14, 2024
1 parent 53edb05 commit 7fd397f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
7 changes: 0 additions & 7 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ rmdir b2 /s /q
mkdir b2
cd b2

REM Call Python with the --version flag to get the version information
for /f "tokens=2 delims= " %%v in ('%PYTHON% --version 2^>^&1') do set PYTHON_VERSION=%%v

REM Extract only the numeric part of the version
for /f "tokens=1-3 delims=." %%a in ("%PYTHON_VERSION%") do set PYTHON_VERSION_NUMERIC=%%a.%%b.%%c

echo Python version: %PYTHON_VERSION_NUMERIC%
cmake .. -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
Expand All @@ -25,7 +19,6 @@ cmake .. -G "NMake Makefiles" ^
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="%SP_DIR%" ^
-DCMAKE_SWIG_OUTDIR="%SP_DIR%" ^
-DPython_ROOT_DIR="%PREFIX%\bin" ^
-DPYTHON_VERSION="%PYTHON_VERSION_NUMERIC%" ^
-DBUILD_LIBRARY=OFF ^
-DWITH_AVX=OFF ^
-DBoost_USE_STATIC_LIBS=OFF
Expand Down
1 change: 0 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cmake -S .. -B . \
-DWITH_AVX=OFF \
-DBoost_USE_STATIC_LIBS=OFF \
-DPython_ROOT_DIR="${PREFIX}/bin" \
-DPYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')\
-G Ninja \
${CONFIG_ARGS}

Expand Down
2 changes: 1 addition & 1 deletion ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IF(BUILD_PYTHON_INTERFACE)
MESSAGE(STATUS "Python version: '${PYTHON_VERSION}'")
cmake_policy(SET CMP0094 NEW)

FIND_PACKAGE(Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development.Module NumPy)
FIND_PACKAGE(Python COMPONENTS Interpreter Development.Module NumPy)
INCLUDE_DIRECTORIES(BEFORE ${Python_NumPy_PATH} ${Python_INCLUDE_DIRS})
LINK_LIBRARIES(${Python_LIBRARY} Python::NumPy)

Expand Down

0 comments on commit 7fd397f

Please sign in to comment.