Skip to content

Commit

Permalink
Issue #42: using Python version suffix for discovering relevant Boost…
Browse files Browse the repository at this point in the history
… components
  • Loading branch information
dzhoshkun committed Apr 15, 2019
1 parent ee0b644 commit 84b418f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cmake/boost.python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ if(NOT PYTHONLIBS_VERSION_STRING)
MESSAGE(FATAL_ERROR "Could not determine Python version")
endif()
if(PYTHONLIBS_VERSION_STRING MATCHES ^3\.*)
SET(GG_BOOST_COMPONENTS python3)
SET(GG_BOOST_PYTHON_SUFFIX 3)
elseif(PYTHONLIBS_VERSION_STRING MATCHES ^2\.7\.*)
SET(GG_BOOST_COMPONENTS python)
SET(GG_BOOST_PYTHON_SUFFIX "")
else()
MESSAGE(FATAL_ERROR "Found unsupported Python version ${PYTHONLIBS_VERSION_STRING}")
endif()

SET(GG_BOOST_COMPONENTS python${GG_BOOST_PYTHON_SUFFIX})
if(USE_NUMPY)
LIST(APPEND GG_BOOST_COMPONENTS numpy)
LIST(APPEND GG_BOOST_COMPONENTS numpy${GG_BOOST_PYTHON_SUFFIX})
endif(USE_NUMPY)
FIND_PACKAGE(Boost COMPONENTS ${GG_BOOST_COMPONENTS} REQUIRED)
SET(Boost_INCLUDE_DIR ${Boost_INCLUDE_DIR}
Expand Down

0 comments on commit 84b418f

Please sign in to comment.