Skip to content
Snippets Groups Projects
Commit e95b0d97 authored by Orgis, Dr. Thomas's avatar Orgis, Dr. Thomas
Browse files

LOFARBeam: upstream does Boost python now like pkgsrc, drop that part

parent 0a380076
No related branches found
No related tags found
No related merge requests found
......@@ -34,84 +34,3 @@ index 51d8339..299530f 100644
endif(${_comp} STREQUAL casa)
endforeach(_comp ${_find_components})
endif(NOT CASACORE_INCLUDE_DIR)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2867d9c..7d41a23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.5.0)
project(lofarbeam)
@@ -65,37 +65,40 @@ elseif(DOXYGEN_FOUND)
endif(DOXYGEN_FOUND)
+# ThOr: This is NOT the modern cmake-included FindPython!
find_package (Python COMPONENTS Development)
+
message("Compiling Python ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} support. If this is not the intended target use 'DPYTHON_EXECUTABLE' to control.")
# bind against boost-python for compilation of the python API
# depending on major release version of the python libraries
-if (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
- find_package (Boost REQUIRED COMPONENTS python numpy)
- find_package (Casacore REQUIRED COMPONENTS python)
- message(STATUS "Boost python library: ${Boost_PYTHON_LIBRARY}")
- message(STATUS "Boost numpy library: ${Boost_NUMPY_LIBRARY}")
- message(STATUS "Python library ${PYTHON_LIBRARIES}")
- set(BOOST_PY_FOUND TRUE)
-else (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
- find_package (Boost REQUIRED COMPONENTS python3 numpy3)
- find_package (Casacore REQUIRED COMPONENTS python3)
- message(STATUS "Boost python library: ${Boost_PYTHON3_LIBRARY}")
- message(STATUS "Boost numpy library: ${Boost_NUMPY3_LIBRARY}")
- message(STATUS "Python library ${PYTHON_LIBRARIES}")
- set(BOOST_PY_FOUND TRUE)
-endif (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
-
-
-if(BOOST_PY_FOUND)
- add_library(_stationresponse MODULE pystationresponse.cc)
- set_target_properties(_stationresponse PROPERTIES PREFIX "")
- target_include_directories(_stationresponse PRIVATE ${PYTHON_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
- if (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
- target_link_libraries(_stationresponse stationresponse ${CASA_PYTHON_LIBRARY} ${Boost_PYTHON_LIBRARY} ${Boost_NUMPY_LIBRARY} ${PYTHON_LIBRARIES})
- else (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
- target_link_libraries(_stationresponse stationresponse ${CASA_PYTHON3_LIBRARY} ${Boost_PYTHON3_LIBRARY} ${Boost_NUMPY3_LIBRARY} ${PYTHON_LIBRARIES})
- endif (${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
- install(TARGETS _stationresponse DESTINATION ${PYTHON_INSTALL_DIR}/lofar/stationresponse)
- install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/lofar/stationresponse)
-endif(BOOST_PY_FOUND)
-
+if(${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
+ set(casapy "")
+ set(oldboostpy "")
+else()
+ set(casapy "3")
+ set(oldboostpy "3")
+endif()
+set(boostpy ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
+message("trying boostpy=${boostpy}")
+find_package(Boost 1.67.0 COMPONENTS python${boostpy} numpy${boostpy})
+if(NOT Boost_FOUND)
+ message(STATUS "Falling back to old Boost search.")
+ set(boostpy ${oldboostpy})
+ find_package(Boost REQUIRED COMPONENTS python${boostpy} numpy${boostpy})
+endif()
+find_package (Casacore REQUIRED COMPONENTS python${casapy})
+if(${PYTHON_VERSION_MAJOR} VERSION_LESS "3")
+ set(casapylib ${CASA_PYTHON_LIBRARY})
+else()
+endif()
+
+message(STATUS "Boost python library: ${Boost_PYTHON_LIBRARY}")
+message(STATUS "Boost numpy library: ${Boost_NUMPY_LIBRARY}")
+message(STATUS "Python library ${Python_LIBRARIES}")
+
+add_library(_stationresponse MODULE pystationresponse.cc)
+set_target_properties(_stationresponse PROPERTIES PREFIX "")
+target_include_directories(_stationresponse PRIVATE ${PYTHON_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
+target_link_libraries(_stationresponse stationresponse ${casapylib} Boost::python${boostpy} Boost::numpy${boostpy} ${PYTHON_LIBRARIES})
+install(TARGETS _stationresponse DESTINATION ${PYTHON_INSTALL_DIR}/lofar/stationresponse)
+install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/lofar/stationresponse)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment