Skip to content
Snippets Groups Projects
Commit 045e33e0 authored by André Offringa's avatar André Offringa
Browse files

Improve Python version finding mechanism

parent f6dadf8b
Branches
Tags
No related merge requests found
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(AOFlagger)
......@@ -49,6 +49,15 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif()
endif()
# Python needs to be found before pybind11 to avoid finding different versions
# of python
find_package(
Python
COMPONENTS Interpreter Development
REQUIRED)
message(STATUS "Using python version ${Python_VERSION}")
include_directories(SYSTEM ${Python_INCLUDE_DIRS})
list(APPEND ExternalSubmoduleDirectories aocommon pybind11)
foreach(ExternalSubmodule IN LISTS ExternalSubmoduleDirectories)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/${ExternalSubmodule})
......@@ -96,10 +105,6 @@ endif(GSL_INCLUDE_DIR)
find_package(Threads REQUIRED)
find_package(PNG REQUIRED)
find_package(PythonLibs 3 REQUIRED)
find_package(PythonInterp REQUIRED)
message(STATUS "Using python version ${PYTHON_VERSION_STRING}")
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS})
# boost::alignment requires Boost 1.56
find_package(Boost 1.56.0 REQUIRED COMPONENTS date_time filesystem system
......@@ -333,7 +338,7 @@ set(ALL_LIBRARIES
${CASACORE_LIBRARIES}
${FFTW3_LIB}
${CFITSIO_LIBRARY}
${PYTHON_LIBRARIES}
${Python_LIBRARIES}
${PNG_LIBRARIES}
${LUA_LIBRARIES}
${Boost_LIBRARIES}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment