diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-11-13 21:53:22 -0800 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-11-14 14:10:09 -0800 |
commit | a69ab0c23a0c38e3fed3e412df36538d8959d23c (patch) | |
tree | e6669a138dad84f79c46588f43a38c69dda90246 /mpm/python | |
parent | 4247f025020d7dd1f696dfbd3cce248957d6ace7 (diff) | |
download | uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.gz uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.bz2 uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.zip |
cmake: Update coding style to use lowercase commands
Also updates our coding style file.
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code (with GNU compliant sed):
cmake --help-command-list | grep -v "cmake version" | while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed
(Make sure the backslashes don't get mangled!)
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/CMakeLists.txt | 50 | ||||
-rw-r--r-- | mpm/python/copy_python_module.cmake | 6 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/CMakeLists.txt | 20 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/chips/CMakeLists.txt | 8 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/cores/CMakeLists.txt | 8 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/CMakeLists.txt | 8 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/CMakeLists.txt | 8 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/sys_utils/CMakeLists.txt | 8 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/CMakeLists.txt | 8 |
9 files changed, 62 insertions, 62 deletions
diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt index 8218ce915..7338b5167 100644 --- a/mpm/python/CMakeLists.txt +++ b/mpm/python/CMakeLists.txt @@ -9,60 +9,60 @@ ######################################################################## if(MPM_DEVICE STREQUAL "n3xx") - ADD_LIBRARY(pyusrp_periphs SHARED pyusrp_periphs/n3xx/pyusrp_periphs.cpp) + add_library(pyusrp_periphs SHARED pyusrp_periphs/n3xx/pyusrp_periphs.cpp) elseif(MPM_DEVICE STREQUAL "e320") - ADD_LIBRARY(pyusrp_periphs SHARED pyusrp_periphs/e320/pyusrp_periphs.cpp) + add_library(pyusrp_periphs SHARED pyusrp_periphs/e320/pyusrp_periphs.cpp) endif(MPM_DEVICE STREQUAL "n3xx") -TARGET_INCLUDE_DIRECTORIES(pyusrp_periphs PUBLIC +target_include_directories(pyusrp_periphs PUBLIC ${PYTHON_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/lib/ ${UHD_HOST_ROOT}/lib/usrp/common ${UHD_HOST_ROOT}/lib/usrp/common/ad9361_driver ) -TARGET_LINK_LIBRARIES(pyusrp_periphs ${Boost_PYTHON_LIBRARY} ${Boost_LIBRARIES} usrp-periphs) -ADD_CUSTOM_COMMAND(TARGET pyusrp_periphs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libpyusrp_periphs.so ${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/libpyusrp_periphs.so) +target_link_libraries(pyusrp_periphs ${Boost_PYTHON_LIBRARY} ${Boost_LIBRARIES} usrp-periphs) +add_custom_command(TARGET pyusrp_periphs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libpyusrp_periphs.so ${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/libpyusrp_periphs.so) -SET(USRP_MPM_FILES "") -ADD_SUBDIRECTORY(usrp_mpm) +set(USRP_MPM_FILES "") +add_subdirectory(usrp_mpm) -SET(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") -SET(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") -SET(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") -SET(PERIPH_MGR_INIT_IN "${CMAKE_CURRENT_SOURCE_DIR}/usrp_mpm/periph_manager/__init__.py.in") -SET(PERIPH_MGR_INIT "${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/periph_manager/__init__.py") +set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") +set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") +set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") +set(PERIPH_MGR_INIT_IN "${CMAKE_CURRENT_SOURCE_DIR}/usrp_mpm/periph_manager/__init__.py.in") +set(PERIPH_MGR_INIT "${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/periph_manager/__init__.py") -CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY}) -CONFIGURE_FILE(${PERIPH_MGR_INIT_IN} ${PERIPH_MGR_INIT}) -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/usrp_hwd.py" "${CMAKE_CURRENT_BINARY_DIR}/usrp_hwd.py" COPYONLY) +configure_file(${SETUP_PY_IN} ${SETUP_PY}) +configure_file(${PERIPH_MGR_INIT_IN} ${PERIPH_MGR_INIT}) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/usrp_hwd.py" "${CMAKE_CURRENT_BINARY_DIR}/usrp_hwd.py" COPYONLY) -ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT} +add_custom_command(OUTPUT ${OUTPUT} COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" -DBINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" -P ${CMAKE_CURRENT_SOURCE_DIR}/copy_python_module.cmake COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} -q build COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} DEPENDS ${USRP_MPM_FILES}) -ADD_CUSTOM_TARGET(usrp_mpm ALL DEPENDS ${OUTPUT} pyusrp_periphs) +add_custom_target(usrp_mpm ALL DEPENDS ${OUTPUT} pyusrp_periphs) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix=''))" OUTPUT_VARIABLE USRP_MPM_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/lib/usrp_mpm DESTINATION ${CMAKE_INSTALL_PREFIX}/${USRP_MPM_PYTHON_DIR}) -INSTALL(PROGRAMS +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/lib/usrp_mpm DESTINATION ${CMAKE_INSTALL_PREFIX}/${USRP_MPM_PYTHON_DIR}) +install(PROGRAMS aurora_bist_test.py usrp_update_fs usrp_hwd.py DESTINATION ${RUNTIME_DIR} ) -IF (ENABLE_MYKONOS) - INSTALL(PROGRAMS +if (ENABLE_MYKONOS) + install(PROGRAMS n3xx_bist DESTINATION ${RUNTIME_DIR} ) -ELSEIF (ENABLE_E320) - INSTALL(PROGRAMS +elseif (ENABLE_E320) + install(PROGRAMS e320_bist DESTINATION ${RUNTIME_DIR} ) -ENDIF (ENABLE_MYKONOS) +endif (ENABLE_MYKONOS) diff --git a/mpm/python/copy_python_module.cmake b/mpm/python/copy_python_module.cmake index 501793419..76d546d01 100644 --- a/mpm/python/copy_python_module.cmake +++ b/mpm/python/copy_python_module.cmake @@ -1,4 +1,4 @@ -SET(BINARY_DIR "" CACHE STRING "") -SET(SOURCE_DIR "" CACHE STRING "") -FILE(COPY "${SOURCE_DIR}/usrp_mpm/" DESTINATION ${BINARY_DIR}/usrp_mpm +set(BINARY_DIR "" CACHE STRING "") +set(SOURCE_DIR "" CACHE STRING "") +file(COPY "${SOURCE_DIR}/usrp_mpm/" DESTINATION ${BINARY_DIR}/usrp_mpm FILES_MATCHING PATTERN *.py) diff --git a/mpm/python/usrp_mpm/CMakeLists.txt b/mpm/python/usrp_mpm/CMakeLists.txt index 8d2af75ce..c978107ba 100644 --- a/mpm/python/usrp_mpm/CMakeLists.txt +++ b/mpm/python/usrp_mpm/CMakeLists.txt @@ -7,8 +7,8 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_TOP_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_TOP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/aurora_control.py ${CMAKE_CURRENT_SOURCE_DIR}/bfrfs.py @@ -24,11 +24,11 @@ SET(USRP_MPM_TOP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/prefs.py ${CMAKE_CURRENT_SOURCE_DIR}/rpc_server.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_TOP_FILES}) -ADD_SUBDIRECTORY(chips) -ADD_SUBDIRECTORY(cores) -ADD_SUBDIRECTORY(dboard_manager) -ADD_SUBDIRECTORY(periph_manager) -ADD_SUBDIRECTORY(sys_utils) -ADD_SUBDIRECTORY(xports) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_TOP_FILES}) +add_subdirectory(chips) +add_subdirectory(cores) +add_subdirectory(dboard_manager) +add_subdirectory(periph_manager) +add_subdirectory(sys_utils) +add_subdirectory(xports) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/chips/CMakeLists.txt b/mpm/python/usrp_mpm/chips/CMakeLists.txt index ff4f61bdd..56c06fbeb 100644 --- a/mpm/python/usrp_mpm/chips/CMakeLists.txt +++ b/mpm/python/usrp_mpm/chips/CMakeLists.txt @@ -4,12 +4,12 @@ # SPDX-License-Identifier: GPL-3.0 # -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_CHIP_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_CHIP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/lmk04828.py ${CMAKE_CURRENT_SOURCE_DIR}/adf400x.py ${CMAKE_CURRENT_SOURCE_DIR}/ds125df410.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_CHIP_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_CHIP_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/cores/CMakeLists.txt b/mpm/python/usrp_mpm/cores/CMakeLists.txt index 39a15c0ed..e924408ba 100644 --- a/mpm/python/usrp_mpm/cores/CMakeLists.txt +++ b/mpm/python/usrp_mpm/cores/CMakeLists.txt @@ -4,14 +4,14 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_CORE_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_CORE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/tdc_sync.py ${CMAKE_CURRENT_SOURCE_DIR}/nijesdcore.py ${CMAKE_CURRENT_SOURCE_DIR}/eyescan.py ${CMAKE_CURRENT_SOURCE_DIR}/white_rabbit.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_CORE_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_CORE_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/dboard_manager/CMakeLists.txt b/mpm/python/usrp_mpm/dboard_manager/CMakeLists.txt index 0b34e4d70..650a21aab 100644 --- a/mpm/python/usrp_mpm/dboard_manager/CMakeLists.txt +++ b/mpm/python/usrp_mpm/dboard_manager/CMakeLists.txt @@ -7,8 +7,8 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_DBMGR_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_DBMGR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/base.py ${CMAKE_CURRENT_SOURCE_DIR}/rhodium.py @@ -30,5 +30,5 @@ SET(USRP_MPM_DBMGR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/test.py ${CMAKE_CURRENT_SOURCE_DIR}/unknown.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_DBMGR_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_DBMGR_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/periph_manager/CMakeLists.txt b/mpm/python/usrp_mpm/periph_manager/CMakeLists.txt index 0689cdda9..994b1d64a 100644 --- a/mpm/python/usrp_mpm/periph_manager/CMakeLists.txt +++ b/mpm/python/usrp_mpm/periph_manager/CMakeLists.txt @@ -7,8 +7,8 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_PERIPHMGR_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_PERIPHMGR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in ${CMAKE_CURRENT_SOURCE_DIR}/base.py ${CMAKE_CURRENT_SOURCE_DIR}/n3xx.py @@ -16,5 +16,5 @@ SET(USRP_MPM_PERIPHMGR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/e320.py ${CMAKE_CURRENT_SOURCE_DIR}/e320_periphs.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_PERIPHMGR_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_PERIPHMGR_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/sys_utils/CMakeLists.txt b/mpm/python/usrp_mpm/sys_utils/CMakeLists.txt index e1d830c94..84e3fcc79 100644 --- a/mpm/python/usrp_mpm/sys_utils/CMakeLists.txt +++ b/mpm/python/usrp_mpm/sys_utils/CMakeLists.txt @@ -4,8 +4,8 @@ # SPDX-License-Identifier: GPL-3.0 # -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_SYSUTILS_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_SYSUTILS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/dtoverlay.py ${CMAKE_CURRENT_SOURCE_DIR}/i2c_dev.py @@ -16,6 +16,6 @@ SET(USRP_MPM_SYSUTILS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/uio.py ${CMAKE_CURRENT_SOURCE_DIR}/watchdog.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_SYSUTILS_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_SYSUTILS_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) diff --git a/mpm/python/usrp_mpm/xports/CMakeLists.txt b/mpm/python/usrp_mpm/xports/CMakeLists.txt index 1f8ffc2b1..87e2ac66d 100644 --- a/mpm/python/usrp_mpm/xports/CMakeLists.txt +++ b/mpm/python/usrp_mpm/xports/CMakeLists.txt @@ -4,12 +4,12 @@ # SPDX-License-Identifier: GPL-3.0 # -SET(USRP_MPM_FILES ${USRP_MPM_FILES}) -SET(USRP_MPM_XPORT_FILES +set(USRP_MPM_FILES ${USRP_MPM_FILES}) +set(USRP_MPM_XPORT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/xportmgr_udp.py ${CMAKE_CURRENT_SOURCE_DIR}/xportmgr_liberio.py ) -LIST(APPEND USRP_MPM_FILES ${USRP_MPM_XPORT_FILES}) -SET(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) +list(APPEND USRP_MPM_FILES ${USRP_MPM_XPORT_FILES}) +set(USRP_MPM_FILES ${USRP_MPM_FILES} PARENT_SCOPE) |