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 /host/examples/init_usrp | |
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 'host/examples/init_usrp')
-rw-r--r-- | host/examples/init_usrp/CMakeLists.txt | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/host/examples/init_usrp/CMakeLists.txt b/host/examples/init_usrp/CMakeLists.txt index ccbe3a1e3..9cc835442 100644 --- a/host/examples/init_usrp/CMakeLists.txt +++ b/host/examples/init_usrp/CMakeLists.txt @@ -36,24 +36,24 @@ find_package(UHD "3.8.0" REQUIRED) #find_package(UHD 3.8.1 EXACT REQUIRED) ### Configure Compiler ######################################################## -IF(CMAKE_VERSION VERSION_LESS "3.1") - IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - SET(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}") - ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - IF("${IS_APPLE}" STREQUAL "") - SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") - ELSE() - SET(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}") - ENDIF() - ENDIF() -ELSE() - SET(CMAKE_CXX_STANDARD 11) -ENDIF() +if(CMAKE_VERSION VERSION_LESS "3.1") + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}") + elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + if("${IS_APPLE}" STREQUAL "") + set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}") + endif() + endif() +else() + set(CMAKE_CXX_STANDARD 11) +endif() -IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - SET(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}") - SET(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") -ENDIF() +if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + set(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}") + set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") +endif() include_directories( ${Boost_INCLUDE_DIRS} @@ -64,13 +64,13 @@ link_directories(${Boost_LIBRARY_DIRS}) ### Make the executable ####################################################### add_executable(init_usrp init_usrp.cpp) -SET(CMAKE_BUILD_TYPE "Release") -MESSAGE(STATUS "******************************************************************************") -MESSAGE(STATUS "* NOTE: When building your own app, you probably need all kinds of different ") -MESSAGE(STATUS "* compiler flags. This is just an example, so it's unlikely these settings ") -MESSAGE(STATUS "* exactly match what you require. Make sure to double-check compiler and ") -MESSAGE(STATUS "* linker flags to make sure your specific requirements are included. ") -MESSAGE(STATUS "******************************************************************************") +set(CMAKE_BUILD_TYPE "Release") +message(STATUS "******************************************************************************") +message(STATUS "* NOTE: When building your own app, you probably need all kinds of different ") +message(STATUS "* compiler flags. This is just an example, so it's unlikely these settings ") +message(STATUS "* exactly match what you require. Make sure to double-check compiler and ") +message(STATUS "* linker flags to make sure your specific requirements are included. ") +message(STATUS "******************************************************************************") # Shared library case: All we need to do is link against the library, and # anything else we need (in this case, some Boost libraries): |