aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-31 18:45:01 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:58 -0800
commit34c2fa0beea10308bc9afe6f20b734fc0839b226 (patch)
tree9b7f9223ae72173d5a61faa27a160b538f4f4504
parentdbfc85e0977857382a726e24bafe8a7f2cadef17 (diff)
downloaduhd-34c2fa0beea10308bc9afe6f20b734fc0839b226.tar.gz
uhd-34c2fa0beea10308bc9afe6f20b734fc0839b226.tar.bz2
uhd-34c2fa0beea10308bc9afe6f20b734fc0839b226.zip
mpm: Cleaned up CMake, made Python version an option
-rw-r--r--mpm/CMakeLists.txt17
-rw-r--r--mpm/python/CMakeLists.txt41
2 files changed, 14 insertions, 44 deletions
diff --git a/mpm/CMakeLists.txt b/mpm/CMakeLists.txt
index 8a11464bc..25ccb8afe 100644
--- a/mpm/CMakeLists.txt
+++ b/mpm/CMakeLists.txt
@@ -30,9 +30,14 @@ ENDMACRO(USRP_PERIPHS_ADD_OBJECT)
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring Boost C++ Libraries...")
SET(BOOST_REQUIRED_COMPONENTS
- python
system
)
+IF(MPM_PYTHON_VER EQUAL 3)
+ LIST(APPEND BOOST_REQUIRED_COMPONENTS python3)
+ELSE()
+ LIST(APPEND BOOST_REQUIRED_COMPONENTS python)
+ENDIF()
+
IF(MINGW)
LIST(APPEND BOOST_REQUIRED_COMPONENTS thread_win32)
ELSE()
@@ -69,9 +74,15 @@ MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}")
# Setup Python API
########################################################################
+SET(MPM_PYTHON_VER 2 CACHE STRING "Python version (2 or 3)")
SET(PYTHON_ADDITIONAL_VERSIONS 2.7 3.4 3.5)
-FIND_PACKAGE(PythonInterp)
-FIND_PACKAGE(PythonLibs)
+FIND_PACKAGE(PythonInterp ${MPM_PYTHON_VER})
+#IF(MPM_PYTHON_VER EQUAL "2")
+ #FIND_PACKAGE(PythonInterp)
+#ELSE()
+ #FIND_PACKAGE(PythonInterp 3)
+#ENDIF()
+FIND_PACKAGE(PythonLibs ${MPM_PYTHON_VER})
########################################################################
# Install Dirs
diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt
index 4f2aeb20f..2f13d9475 100644
--- a/mpm/python/CMakeLists.txt
+++ b/mpm/python/CMakeLists.txt
@@ -19,47 +19,6 @@
# This file included, use CMake directory variables
########################################################################
-########################################################################
-# Setup Boost
-########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring Boost C++ Libraries...")
-SET(BOOST_REQUIRED_COMPONENTS
- python
- system
-)
-IF(MINGW)
- LIST(APPEND BOOST_REQUIRED_COMPONENTS thread_win32)
-ELSE()
- LIST(APPEND BOOST_REQUIRED_COMPONENTS thread)
-ENDIF()
-
-IF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
- LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
-ENDIF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
-
-IF(MSVC)
- SET(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
- IF(BOOST_ALL_DYN_LINK)
- ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
- ELSE(BOOST_ALL_DYN_LINK)
- SET(BOOST_REQUIRED_COMPONENTS) #empty components list for static link
- ENDIF(BOOST_ALL_DYN_LINK)
-ENDIF(MSVC)
-
-SET(Boost_ADDITIONAL_VERSIONS
- "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.48.0" "1.49" "1.50.0" "1.50"
- "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55"
- "1.56.0" "1.56" "1.57" "1.57" "1.58" "1.59" "1.60" "1.61"
-)
-FIND_PACKAGE(Boost 1.53 COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
-
-MESSAGE(STATUS "Boost include directories: ${Boost_INCLUDE_DIRS}")
-MESSAGE(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}")
-MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}")
-
-SET(UHD_HOST_ROOT ${CMAKE_SOURCE_DIR}/../host)
-
ADD_LIBRARY(pyusrp_periphs SHARED pyusrp_periphs.cpp)
TARGET_INCLUDE_DIRECTORIES(pyusrp_periphs PUBLIC
${PYTHON_INCLUDE_DIRS}