From 382bcab9e036418df88f35e3332aa44fdef6669e Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 29 Jan 2018 16:02:13 +0000 Subject: removed initial lib from library name (unix) --- Wrappers/Python/CMakeLists.txt | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index e4c847c..ab4f400 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -62,13 +62,22 @@ elseif(UNIX) endif() -#set (BOOST_PYTHON_LIB ${Boost_${BOOST_PYTHON}_LIBRARY}) -#set (BOOST_NUMPY_LIB ${Boost_${BOOST_NUMPY}_LIBRARY}) - -list(GET Boost_LIBRARIES 0 place ) -get_filename_component(BOOST_PYTHON_LIB ${place} NAME_WE ) -list(GET Boost_LIBRARIES 1 place ) -get_filename_component(BOOST_NUMPY_LIB ${place} NAME_WE ) +if (WIN32) + list(GET Boost_LIBRARIES 0 place ) + get_filename_component(BOOST_PYTHON_LIB ${place} NAME_WE ) + list(GET Boost_LIBRARIES 1 place ) + get_filename_component(BOOST_NUMPY_LIB ${place} NAME_WE ) +else() + # on linux the library looks like libboost_numpy3.so: + # we need to get rid of the lib at the beginning + list(GET Boost_LIBRARIES 0 place ) + get_filename_component(place2 ${place} NAME_WE ) + string(REGEX REPLACE "^lib.*" "\\1" $BOOST_PYTHON_LIB "${place2}") + + list(GET Boost_LIBRARIES 1 place ) + get_filename_component(place2 ${place} NAME_WE ) + string(REGEX REPLACE "^lib.*" "\\1" $BOOST_NUMPY_LIB "${place2}") +endif() message ("found " ${BOOST_PYTHON_LIB}) message ("found " ${BOOST_NUMPY_LIB}) -- cgit v1.2.3