Skip to content

Commit

Permalink
Merge pull request #185 from ChinouneMehdi/mingw-python
Browse files Browse the repository at this point in the history
Enable Python with MinGW-w64.
  • Loading branch information
highperformancecoder committed Jan 17, 2021
2 parents 98f8485 + 631b165 commit e350b26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/main.yml
Expand Up @@ -158,6 +158,10 @@ jobs:
mingw-w64-x86_64-gsl
mingw-w64-x86_64-gl2ps
mingw-w64-x86_64-boost
mingw-w64-x86_64-unittest-cpp
mingw-w64-x86_64-sip
mingw-w64-x86_64-python-pyqt5
mingw-w64-x86_64-python-numpy
- name: Download Qwt5 and QwtPlot3D
run: |
Expand All @@ -169,15 +173,6 @@ jobs:
tar -xzf qwtplot3d-qt5_0.2.7.orig.tar.gz && rm qwtplot3d-qt5_0.2.7.orig.tar.gz
patch -p1 < qwtplot3d.diff
- name: Install UnitTest++
run: |
git clone --single-branch --branch master --depth 1 https://github.com/unittest-cpp/unittest-cpp
cd unittest-cpp
mkdir build && cd build
cmake .. -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64
make -j$(nproc)
make install
- name: Configuring
run: |
mkdir build && cd build
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -67,11 +67,11 @@ option( SCRIPTING_MUPARSER "Enable muParser Scripting" ON )

option( ENABLE_Testing "Enable testing" ON )

if( WIN32 )
if( MSVC )
option( ENABLE_Python3 "Enable Python3 support" OFF )
else( WIN32 )
else()
option( ENABLE_Python3 "Enable Python3 support" ON )
endif( WIN32 )
endif()

if( ENABLE_Python3 )
if( MINGW )
Expand Down
11 changes: 11 additions & 0 deletions libscidavis/CMakeLists.txt
Expand Up @@ -427,6 +427,17 @@ if( ENABLE_Python3 )
PYTHON_UTIL_PATH="${CMAKE_INSTALL_PREFIX}/share/scidavis"
SCRIPTING_PYTHON
)
if( MINGW )
get_filename_component( PYTHON_DIR ${Python3_EXECUTABLE} DIRECTORY )
file( REAL_PATH "${PYTHON_DIR}/.." PYTHON_ROOT_DIR )
set( PYTHONHOME "${PYTHON_ROOT_DIR}" CACHE PATH "Python Home" )
message( STATUS "PYTHONHOME = ${PYTHONHOME}" )
set_property( SOURCE "src/PythonScripting.cpp"
APPEND
PROPERTY COMPILE_DEFINITIONS
PYTHONHOME=${PYTHONHOME}
)
endif()
endif( ENABLE_Python3 )

if( SEARCH_FOR_UPDATE OR DOWNLOAD_LINKS )
Expand Down

0 comments on commit e350b26

Please sign in to comment.