diff --git a/PyIlmBase/CMakeLists.txt b/PyIlmBase/CMakeLists.txt index eee43ebaff..f4748f7a1b 100644 --- a/PyIlmBase/CMakeLists.txt +++ b/PyIlmBase/CMakeLists.txt @@ -44,11 +44,11 @@ endif() # now determine which (or both), and compile for both find_package(Python2 COMPONENTS Interpreter Development) find_package(Python3 COMPONENTS Interpreter Development) -if(TARGET Python2::Python AND TARGET Python3::Python) +if(Python2_FOUND AND Python3_FOUND) message(STATUS ": Found Python ${Python2_VERSION} and ${Python3_VERSION}") -elseif(TARGET Python2::Python) +elseif(Python2_FOUND) message(STATUS ": Found Python ${Python2_VERSION}") -elseif(TARGET Python3::Python) +elseif(Python3_FOUND) message(STATUS ": Found Python ${Python3_VERSION}") else() message(WARNING ": Unable to find python development libraries for python 2 or 3") @@ -87,7 +87,7 @@ function(PYILMBASE_EXTRACT_REL_SITEARCH varname pyver pyexe pysitearch) message(STATUS " -> Will install to: ${_reldir}") endfunction() -if (TARGET Python2::Python) +if(Python2_FOUND) set(PYILMBASE_BOOST_PY2_COMPONENT "python${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR}") message(STATUS "Found Python2 libraries: ${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR}") # we can't just use the Python2_SITEARCH variable as that then will @@ -95,7 +95,7 @@ if (TARGET Python2::Python) # if it is generally useful pyilmbase_extract_rel_sitearch(PyIlmBase_Python2_SITEARCH_REL 2 ${Python2_EXECUTABLE} ${Python2_SITEARCH}) endif() -if (TARGET Python3::Python) +if(Python3_FOUND) set(PYILMBASE_BOOST_PY3_COMPONENT "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") message(STATUS "Found Python3 libraries: ${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") # and figure out the install root here