summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2019-08-10 01:01:56 +0200
committerMartin Braun <martin.braun@ettus.com>2020-01-04 18:48:20 -0800
commit678a7c2ad5db89e0634bfae2b0c9186f1ce63e89 (patch)
treea86eaf74a5ea951cc113f2260e539d6ab1a9e421 /cmake/Modules
parent7d3c207e66f387151c9f0771e1bce3d735fbc507 (diff)
Disable Python 2k
- Update SWIG settings - Update CMake - Remove Python2 references Note: This does not touch a lot of Python files, and many Python files will still work with Python 2 after this commit. However, we won't allow that in our CMake, and the support will be gone too.
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/GrPython.cmake9
-rw-r--r--cmake/Modules/GrSwig.cmake6
2 files changed, 3 insertions, 12 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index b7f72e666e..92af7f5a65 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -33,18 +33,13 @@ if (PYTHON_EXECUTABLE)
find_package(PythonInterp ${GR_PYTHON_MIN_VERSION} REQUIRED)
else (PYTHON_EXECUTABLE)
message(STATUS "PYTHON_EXECUTABLE not set - using default python3")
- message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python2 to build for python2.")
- find_package(PythonInterp ${GR_PYTHON3_MIN_VERSION} REQUIRED)
+ find_package(PythonInterp ${GR_PYTHON_MIN_VERSION} REQUIRED)
endif (PYTHON_EXECUTABLE)
-if (${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
- set(PYTHON3 TRUE)
-endif ()
-
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
if (CMAKE_CROSSCOMPILING)
- set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
+ set(QA_PYTHON_EXECUTABLE "/usr/bin/python3")
else (CMAKE_CROSSCOMPILING)
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
endif(CMAKE_CROSSCOMPILING)
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index 39585ac4be..6dae9246c1 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -118,12 +118,8 @@ macro(GR_SWIG_MAKE name)
list(INSERT GR_SWIG_INCLUDE_DIRS 0 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
list(INSERT GR_SWIG_INCLUDE_DIRS 0 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
- if (PYTHON3)
- set(py3 "-py3")
- endif (PYTHON3)
-
#setup the swig flags with flags and include directories
- set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -w314 -relativeimport ${py3} -module ${name} ${GR_SWIG_FLAGS})
+ set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -w314 -relativeimport -py3 -module ${name} ${GR_SWIG_FLAGS})
#set the C++ property on the swig .i file so it builds
set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON)