Skip to content

Commit

Permalink
Handle python2 not being installed, but python3 being present
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Nov 8, 2019
1 parent d10895e commit 8228578
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions PyIlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ endif()
find_package(Python2 COMPONENTS Interpreter Development)
find_package(Python3 COMPONENTS Interpreter Development)
if(TARGET Python2::Python AND TARGET Python3::Python)
message(NOTICE ": Found Python ${Python2_VERSION} and ${Python3_VERSION}")
message(STATUS ": Found Python ${Python2_VERSION} and ${Python3_VERSION}")
elseif(TARGET Python2::Python)
message(NOTICE ": Found Python ${Python2_VERSION}")
message(STATUS ": Found Python ${Python2_VERSION}")
elseif(TARGET Python3::Python)
message(NOTICE ": Found Python ${Python3_VERSION}")
message(STATUS ": Found Python ${Python3_VERSION}")
else()
message(WARNING ": Unable to find python development libraries for python 2 or 3")
return()
Expand Down Expand Up @@ -125,9 +125,15 @@ find_package(Boost OPTIONAL_COMPONENTS
set(_pyilmbase_have_perver_boost)
if(PYILMBASE_BOOST_PY2_COMPONENT)
string(TOUPPER ${PYILMBASE_BOOST_PY2_COMPONENT} PYILMBASE_PY2_UPPER)
else()
set(PYILMBASE_BOOST_PY2_COMPONENT python2x_NOTFOUND)
set(PYILMBASE_PY2_UPPER PYTHON2X_NOTFOUND)
endif()
if(PYILMBASE_BOOST_PY3_COMPONENT)
string(TOUPPER ${PYILMBASE_BOOST_PY3_COMPONENT} PYILMBASE_PY3_UPPER)
else()
set(PYILMBASE_BOOST_PY3_COMPONENT python3x_NOTFOUND)
set(PYILMBASE_PY3_UPPER PYTHON3X_NOTFOUND)
endif()
if(Boost_PYTHON2_FOUND OR Boost_${PYILMBASE_PY2_UPPER}_FOUND)
set(_pyilmbase_have_perver_boost TRUE)
Expand Down Expand Up @@ -167,9 +173,9 @@ else()
return()
endif()
endif()
set(PYILMBASE_PY2_UPPER)
set(PYILMBASE_PY3_UPPER)
set(_pyilmbase_have_perver_boost)
unset(PYILMBASE_PY2_UPPER)
unset(PYILMBASE_PY3_UPPER)
unset(_pyilmbase_have_perver_boost)

# unfortunately, we can't use the boost numpy stuff, as that requires a
# version of boost that is newer than is mandated by many active versions
Expand Down

0 comments on commit 8228578

Please sign in to comment.