Commit 43dae2ce authored by Christian Godenschwager's avatar Christian Godenschwager
Browse files

Remove boost system library from CMake

The python library detection was broken when no compiled boost library was
added. Therefore The newest version of FindBoost was added to waLBerla which
offers a more functional boost python detection.
parent cd7d2c52
......@@ -630,12 +630,10 @@ endif()
set ( waLBerla_REQUIRED_MIN_BOOST_VERSION "1.48")
if ( NOT WALBERLA_USE_STD_FILESYSTEM AND NOT WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
list ( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS filesystem system )
else()
list ( APPEND waLBerla_OPTIONAL_BOOST_COMPONENTS system )
list ( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS filesystem )
endif()
if ( WALBERLA_BUILD_WITH_PYTHON AND WALBERLA_CXX_COMPILER_IS_MSVC )
if ( WALBERLA_BUILD_WITH_PYTHON )
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS python3 )
endif()
......@@ -660,14 +658,14 @@ if ( NOT BOOST_ROOT )
endforeach ( )
endif ( )
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} COMPONENTS ${waLBerla_REQUIRED_BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${waLBerla_OPTIONAL_BOOST_COMPONENTS} QUIET )
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} COMPONENTS ${waLBerla_REQUIRED_BOOST_COMPONENTS} QUIET )
if( NOT Boost_FOUND )
message ( WARNING
"The specified configuration of the BOOST libraries was not found on your system! Now trying some other configuration..." )
foreach ( Boost_USE_STATIC_LIBS ON OFF )
foreach ( Boost_USE_MULTITHREADED ON OFF )
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} COMPONENTS ${waLBerla_REQUIRED_BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${waLBerla_OPTIONAL_BOOST_COMPONENTS} QUIET )
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} COMPONENTS ${waLBerla_REQUIRED_BOOST_COMPONENTS} QUIET )
if ( Boost_FOUND )
set ( Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS} CACHE BOOL "Use boost static libraries" FORCE )
set ( Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED} CACHE BOOL "Use boost multithreaded libraries" FORCE )
......@@ -710,32 +708,10 @@ if ( Boost_FOUND )
else( Boost_FOUND )
# Search again, this time with the REQUIRED option. This will give a CMAKE error and a detailed error message for the user
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} REQUIRED ${waLBerla_REQUIRED_BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${waLBerla_OPTIONAL_BOOST_COMPONENTS} )
find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} REQUIRED ${waLBerla_REQUIRED_BOOST_COMPONENTS} )
endif( Boost_FOUND )
# Check if Python3 found and look for according boost python library
if ( WALBERLA_BUILD_WITH_PYTHON AND NOT WALBERLA_CXX_COMPILER_IS_MSVC)
SET(_boost_MULTITHREADED "")
if (Boost_USE_MULTITHREADED OR Boost_USE_MULTITHREADED_LIBRARY)
SET(_boost_MULTITHREADED "-mt")
endif()
if( PYTHON_LIBRARY MATCHES "python3" )
find_library( BOOST_PYTHON_LIBRARY NAMES
boost_python-py36${_boost_MULTITHREADED} boost_python-py35${_boost_MULTITHREADED}
boost_python-py34${_boost_MULTITHREADED} boost_python-py33${_boost_MULTITHREADED}
boost_python-py32${_boost_MULTITHREADED} boost_python3${_boost_MULTITHREADED}
boost_python${_boost_MULTITHREADED}
PATHS ${Boost_LIBRARY_DIRS} NO_DEFAULT_PATH )
else()
find_library( BOOST_PYTHON_LIBRARY NAMES boost_python${_boost_MULTITHREADED}
PATHS ${Boost_LIBRARY_DIRS} NO_DEFAULT_PATH )
endif()
message(STATUS "Using Boost Python Library ${BOOST_PYTHON_LIBRARY}" )
list ( APPEND SERVICE_LIBS ${BOOST_PYTHON_LIBRARY} )
endif()
############################################################################################################################
......
This diff is collapsed.
Markdown is supported
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