aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2018-04-13 12:32:31 -0700
committerMartin Braun <martin.braun@ettus.com>2018-04-18 15:26:30 -0700
commite733e590c4b5aa3053af0681bef199d27e4b2d7a (patch)
treee18eef34317f31ec446f56b74e11934bd416f1d4 /mpm
parenta8c74853f9bc73a796c553fc7cebb14266775e59 (diff)
downloaduhd-e733e590c4b5aa3053af0681bef199d27e4b2d7a.tar.gz
uhd-e733e590c4b5aa3053af0681bef199d27e4b2d7a.tar.bz2
uhd-e733e590c4b5aa3053af0681bef199d27e4b2d7a.zip
mpm: Validate MPM_DEVICE in CMake
Diffstat (limited to 'mpm')
-rw-r--r--mpm/CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/mpm/CMakeLists.txt b/mpm/CMakeLists.txt
index 8129f3eff..b9afd70be 100644
--- a/mpm/CMakeLists.txt
+++ b/mpm/CMakeLists.txt
@@ -124,8 +124,15 @@ SET(PKG_MAN_DIR share/man/man1)
# Setup library configuration
########################################################################
SET(CMAKE_CXX_STANDARD 11)
+SET(MPM_ALL_DEVICES n3xx tests)
SET(MPM_DEVICE "n3xx" CACHE STRING "Choose an MPM device to build")
-SET_PROPERTY(CACHE MPM_DEVICE PROPERTY STRINGS n3xx tests)
+SET_PROPERTY(CACHE MPM_DEVICE PROPERTY STRINGS ${MPM_ALL_DEVICES})
+# Validate MPM_DEVICE
+list(FIND MPM_ALL_DEVICES ${MPM_DEVICE} mpm_device_check)
+if(mpm_device_check EQUAL -1)
+ message(FATAL_ERROR "MPM_DEVICE must be one of ${MPM_ALL_DEVICES}! \
+ Specify -DMPM_DEVICE=<device> on the command line or set MPM_DEVICE using a CMake GUI.")
+endif()
ADD_SUBDIRECTORY(include)
INCLUDE_DIRECTORIES(
@@ -177,3 +184,4 @@ IF(MPM_VERSION_DEVEL AND NOT MPM_GIT_BRANCH STREQUAL "maint")
MESSAGE(STATUS "******************************************************")
ENDIF(MPM_VERSION_DEVEL AND NOT MPM_GIT_BRANCH STREQUAL "maint")
MESSAGE(STATUS "Building version: ${MPM_VERSION}")
+MESSAGE(STATUS "Building for device: ${MPM_DEVICE}")