Skip to content
Snippets Groups Projects
Commit be036c15 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Update CMake boost python logic

We need to have at least one other required library, otherwise FindBoost will consider itself successful even if it didn't find anything.
Also, add Python 3.8 support by using the Python version numbers as library version numbers.
parent cf2af49a
Branches
Tags
No related merge requests found
...@@ -652,9 +652,14 @@ else() ...@@ -652,9 +652,14 @@ else()
list ( APPEND waLBerla_OPTIONAL_BOOST_COMPONENTS system ) list ( APPEND waLBerla_OPTIONAL_BOOST_COMPONENTS system )
endif() endif()
if ( WALBERLA_BUILD_WITH_PYTHON AND WALBERLA_CXX_COMPILER_IS_MSVC ) if ( WALBERLA_BUILD_WITH_PYTHON )
if( WALBERLA_CXX_COMPILER_IS_MSVC )
get_filename_component(PYTHON_REQUIRED_LIB ${PYTHON_LIBRARY} NAME_WE) get_filename_component(PYTHON_REQUIRED_LIB ${PYTHON_LIBRARY} NAME_WE)
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS ${PYTHON_REQUIRED_LIB} ) list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS ${PYTHON_REQUIRED_LIB} )
elseif( WALBERLA_USE_STD_FILESYSTEM OR WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS system )
list( REMOVE_ITEM waLBerla_OPTIONAL_BOOST_COMPONENTS system )
endif()
endif() endif()
# This variable is necessary, if the CMAKE version used is not aware of a more recent boost version (keep this up to date!) # This variable is necessary, if the CMAKE version used is not aware of a more recent boost version (keep this up to date!)
...@@ -749,11 +754,13 @@ if ( WALBERLA_BUILD_WITH_PYTHON AND NOT WALBERLA_CXX_COMPILER_IS_MSVC) ...@@ -749,11 +754,13 @@ if ( WALBERLA_BUILD_WITH_PYTHON AND NOT WALBERLA_CXX_COMPILER_IS_MSVC)
SET(_boost_MULTITHREADED "-mt") SET(_boost_MULTITHREADED "-mt")
endif() endif()
if( PYTHON_LIBRARY MATCHES "python3" ) if( PYTHON_LIBRARY MATCHES "python3" )
string(REPLACE "." ";" VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
list(GET VERSION_LIST 0 PY_VER_MAJOR)
list(GET VERSION_LIST 1 PY_VER_MINOR)
find_library( BOOST_PYTHON_LIBRARY NAMES find_library( BOOST_PYTHON_LIBRARY NAMES
boost_python37${_boost_MULTITHREADED} boost_python36${_boost_MULTITHREADED} boost_python35${_boost_MULTITHREADED} boost_python${PY_VER_MAJOR}${PY_VER_MINOR}${_boost_MULTITHREADED}
boost_python-py37${_boost_MULTITHREADED} boost_python-py36${_boost_MULTITHREADED} boost_python-py35${_boost_MULTITHREADED} boost_python-py${PY_VER_MAJOR}${PY_VER_MINOR}${_boost_MULTITHREADED}
boost_python-py34${_boost_MULTITHREADED} boost_python-py33${_boost_MULTITHREADED} boost_python${PY_VER_MAJOR}${_boost_MULTITHREADED}
boost_python3${_boost_MULTITHREADED}
boost_python${_boost_MULTITHREADED} boost_python${_boost_MULTITHREADED}
PATHS ${Boost_LIBRARY_DIRS} NO_DEFAULT_PATH ) PATHS ${Boost_LIBRARY_DIRS} NO_DEFAULT_PATH )
else() else()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment