From a69ab0c23a0c38e3fed3e412df36538d8959d23c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 13 Nov 2018 21:53:22 -0800 Subject: 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!) --- .../cmake/Modules/CMakeParseArgumentsCopy.cmake | 6 ++-- tools/gr-usrptest/cmake/Modules/FindCppUnit.cmake | 12 +++---- .../cmake/Modules/FindGnuradioRuntime.cmake | 10 +++--- tools/gr-usrptest/cmake/Modules/GrMiscUtils.cmake | 32 ++++++++--------- tools/gr-usrptest/cmake/Modules/GrPython.cmake | 2 +- tools/gr-usrptest/cmake/Modules/GrSwig.cmake | 6 ++-- tools/gr-usrptest/cmake/Modules/GrTest.cmake | 4 +-- .../gr-usrptest/cmake/Modules/usrptestConfig.cmake | 10 +++--- tools/gr-usrptest/cmake/cmake_uninstall.cmake.in | 42 +++++++++++----------- tools/gr-usrptest/lib/CMakeLists.txt | 2 +- tools/gr-usrptest/swig/CMakeLists.txt | 2 +- 11 files changed, 64 insertions(+), 64 deletions(-) (limited to 'tools/gr-usrptest') diff --git a/tools/gr-usrptest/cmake/Modules/CMakeParseArgumentsCopy.cmake b/tools/gr-usrptest/cmake/Modules/CMakeParseArgumentsCopy.cmake index 7ce4c49ae..a7e78bbdc 100644 --- a/tools/gr-usrptest/cmake/Modules/CMakeParseArgumentsCopy.cmake +++ b/tools/gr-usrptest/cmake/Modules/CMakeParseArgumentsCopy.cmake @@ -1,6 +1,6 @@ -# CMAKE_PARSE_ARGUMENTS( args...) +# cmake_parse_arguments( args...) # -# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for +# cmake_parse_arguments() is intended to be used in macros or functions for # parsing the arguments given to that macro or function. # It processes the arguments and defines a set of variables which hold the # values of the respective options. @@ -17,7 +17,7 @@ # which can be followed by more than one value, like e.g. the TARGETS or # FILES keywords of the install() command. # -# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the +# When done, cmake_parse_arguments() will have defined for each of the # keywords listed in , and # a variable composed of the given # followed by "_" and the name of the respective keyword. diff --git a/tools/gr-usrptest/cmake/Modules/FindCppUnit.cmake b/tools/gr-usrptest/cmake/Modules/FindCppUnit.cmake index f93ade341..3ed6a8521 100644 --- a/tools/gr-usrptest/cmake/Modules/FindCppUnit.cmake +++ b/tools/gr-usrptest/cmake/Modules/FindCppUnit.cmake @@ -9,10 +9,10 @@ # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. # CPPUNIT_FOUND, If false, do not try to use CppUnit. -INCLUDE(FindPkgConfig) +include(FindPkgConfig) PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") -FIND_PATH(CPPUNIT_INCLUDE_DIRS +find_path(CPPUNIT_INCLUDE_DIRS NAMES cppunit/TestCase.h HINTS ${PC_CPPUNIT_INCLUDE_DIR} ${CMAKE_INSTALL_PREFIX}/include @@ -21,7 +21,7 @@ FIND_PATH(CPPUNIT_INCLUDE_DIRS /usr/include ) -FIND_LIBRARY(CPPUNIT_LIBRARIES +find_library(CPPUNIT_LIBRARIES NAMES cppunit HINTS ${PC_CPPUNIT_LIBDIR} ${CMAKE_INSTALL_PREFIX}/lib @@ -32,8 +32,8 @@ FIND_LIBRARY(CPPUNIT_LIBRARIES /usr/lib ) -LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) +list(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) -MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) +mark_as_advanced(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) diff --git a/tools/gr-usrptest/cmake/Modules/FindGnuradioRuntime.cmake b/tools/gr-usrptest/cmake/Modules/FindGnuradioRuntime.cmake index afed684a5..6c5f38f28 100644 --- a/tools/gr-usrptest/cmake/Modules/FindGnuradioRuntime.cmake +++ b/tools/gr-usrptest/cmake/Modules/FindGnuradioRuntime.cmake @@ -1,9 +1,9 @@ -INCLUDE(FindPkgConfig) +include(FindPkgConfig) PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) if(PC_GNURADIO_RUNTIME_FOUND) # look for include files - FIND_PATH( + find_path( GNURADIO_RUNTIME_INCLUDE_DIRS NAMES gnuradio/top_block.h HINTS $ENV{GNURADIO_RUNTIME_DIR}/include @@ -14,7 +14,7 @@ if(PC_GNURADIO_RUNTIME_FOUND) ) # look for libs - FIND_LIBRARY( + find_library( GNURADIO_RUNTIME_LIBRARIES NAMES gnuradio-runtime HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib @@ -30,7 +30,7 @@ if(PC_GNURADIO_RUNTIME_FOUND) set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) endif(PC_GNURADIO_RUNTIME_FOUND) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) # do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) -MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) +mark_as_advanced(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) diff --git a/tools/gr-usrptest/cmake/Modules/GrMiscUtils.cmake b/tools/gr-usrptest/cmake/Modules/GrMiscUtils.cmake index 5bad57c51..2a4e01a8e 100644 --- a/tools/gr-usrptest/cmake/Modules/GrMiscUtils.cmake +++ b/tools/gr-usrptest/cmake/Modules/GrMiscUtils.cmake @@ -95,7 +95,7 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) CHECK_CXX_COMPILER_FLAG(${flag} ${have}) if(${have}) if(${CMAKE_VERSION} VERSION_GREATER "2.8.4") - STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup) + string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup) if(${flag_dup} EQUAL -1) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") @@ -117,7 +117,7 @@ function(GR_LIBTOOL) if(GENERATE_LIBTOOL) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN}) + cmake_parse_arguments(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN}) find_program(LIBTOOL libtool) if(LIBTOOL) @@ -137,7 +137,7 @@ endfunction(GR_LIBTOOL) function(GR_LIBRARY_FOO target) #parse the arguments for component names include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN}) + cmake_parse_arguments(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN}) #set additional target properties set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER}) @@ -188,7 +188,7 @@ endfunction(GR_LIBRARY_FOO) # Create a dummy custom command that depends on other targets. # Usage: # GR_GEN_TARGET_DEPS(unique_name target_deps ...) -# ADD_CUSTOM_COMMAND( ${target_deps}) +# add_custom_command( ${target_deps}) # # Custom command cant depend on targets, but can depend on executables, # and executables can depend on targets. So this is the process: @@ -226,7 +226,7 @@ endfunction(GR_GEN_TARGET_DEPS) function(GR_LOGGING) find_package(Log4cpp) - OPTION(ENABLE_GR_LOG "Use gr_logger" ON) + option(ENABLE_GR_LOG "Use gr_logger" ON) if(ENABLE_GR_LOG) # If gr_logger is enabled, make it usable add_definitions( -DENABLE_GR_LOG ) @@ -234,22 +234,22 @@ function(GR_LOGGING) # also test LOG4CPP; if we have it, use this version of the logger # otherwise, default to the stdout/stderr model. if(LOG4CPP_FOUND) - SET(HAVE_LOG4CPP True CACHE INTERNAL "" FORCE) + set(HAVE_LOG4CPP True CACHE INTERNAL "" FORCE) add_definitions( -DHAVE_LOG4CPP ) else(not LOG4CPP_FOUND) - SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE) - SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) - SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE) - SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) + set(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) endif(LOG4CPP_FOUND) - SET(ENABLE_GR_LOG ${ENABLE_GR_LOG} CACHE INTERNAL "" FORCE) + set(ENABLE_GR_LOG ${ENABLE_GR_LOG} CACHE INTERNAL "" FORCE) else(ENABLE_GR_LOG) - SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE) - SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) - SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE) - SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) + set(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) endif(ENABLE_GR_LOG) message(STATUS "ENABLE_GR_LOG set to ${ENABLE_GR_LOG}.") @@ -274,7 +274,7 @@ function(GRCC) set(filenames ${ARGV}) file(MAKE_DIRECTORY ${directory}) - SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/python/grcc) + set(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/python/grcc) # GRCC uses some stuff in grc and gnuradio-runtime, so we force # the known paths here diff --git a/tools/gr-usrptest/cmake/Modules/GrPython.cmake b/tools/gr-usrptest/cmake/Modules/GrPython.cmake index 06e061e21..9ac72c2d8 100644 --- a/tools/gr-usrptest/cmake/Modules/GrPython.cmake +++ b/tools/gr-usrptest/cmake/Modules/GrPython.cmake @@ -130,7 +130,7 @@ endfunction(GR_UNIQUE_TARGET) ######################################################################## function(GR_PYTHON_INSTALL) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) + cmake_parse_arguments(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) #################################################################### if(GR_PYTHON_INSTALL_FILES) diff --git a/tools/gr-usrptest/cmake/Modules/GrSwig.cmake b/tools/gr-usrptest/cmake/Modules/GrSwig.cmake index abf4dc461..36b5191dd 100644 --- a/tools/gr-usrptest/cmake/Modules/GrSwig.cmake +++ b/tools/gr-usrptest/cmake/Modules/GrSwig.cmake @@ -110,7 +110,7 @@ macro(GR_SWIG_MAKE name) # vector (on 64-bit machines). Use this to test # the size of size_t, then set SIZE_T_32 if it's a 32-bit machine # or not if it's 64-bit. The logic in gr_type.i handles the rest. - INCLUDE(CheckTypeSize) + include(CheckTypeSize) CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT) if(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT}) @@ -173,7 +173,7 @@ macro(GR_SWIG_MAKE name) SWIG_ADD_MODULE(${name} python ${ifiles}) SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES}) if(${name} STREQUAL "runtime_swig") - SET_TARGET_PROPERTIES(${SWIG_MODULE_runtime_swig_REAL_NAME} PROPERTIES DEFINE_SYMBOL "gnuradio_runtime_EXPORTS") + set_target_properties(${SWIG_MODULE_runtime_swig_REAL_NAME} PROPERTIES DEFINE_SYMBOL "gnuradio_runtime_EXPORTS") endif(${name} STREQUAL "runtime_swig") endmacro(GR_SWIG_MAKE) @@ -189,7 +189,7 @@ endmacro(GR_SWIG_MAKE) macro(GR_SWIG_INSTALL) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) + cmake_parse_arguments(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) foreach(name ${GR_SWIG_INSTALL_TARGETS}) install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} diff --git a/tools/gr-usrptest/cmake/Modules/GrTest.cmake b/tools/gr-usrptest/cmake/Modules/GrTest.cmake index 62caab4b5..9304d33a9 100644 --- a/tools/gr-usrptest/cmake/Modules/GrTest.cmake +++ b/tools/gr-usrptest/cmake/Modules/GrTest.cmake @@ -72,8 +72,8 @@ function(GR_ADD_TEST test_name) #http://www.cmake.org/pipermail/cmake/2009-May/029464.html #Replaced this add test + set environs code with the shell script generation. #Its nicer to be able to manually run the shell script to diagnose problems. - #ADD_TEST(${ARGV}) - #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}") + #add_test(${ARGV}) + #set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${environs}") if(UNIX) set(LD_PATH_VAR "LD_LIBRARY_PATH") diff --git a/tools/gr-usrptest/cmake/Modules/usrptestConfig.cmake b/tools/gr-usrptest/cmake/Modules/usrptestConfig.cmake index 5244d466e..a593b2b68 100644 --- a/tools/gr-usrptest/cmake/Modules/usrptestConfig.cmake +++ b/tools/gr-usrptest/cmake/Modules/usrptestConfig.cmake @@ -1,7 +1,7 @@ -INCLUDE(FindPkgConfig) +include(FindPkgConfig) PKG_CHECK_MODULES(PC_USRPTEST usrptest) -FIND_PATH( +find_path( USRPTEST_INCLUDE_DIRS NAMES usrptest/api.h HINTS $ENV{USRPTEST_DIR}/include @@ -11,7 +11,7 @@ FIND_PATH( /usr/include ) -FIND_LIBRARY( +find_library( USRPTEST_LIBRARIES NAMES gnuradio-usrptest HINTS $ENV{USRPTEST_DIR}/lib @@ -24,7 +24,7 @@ FIND_LIBRARY( /usr/lib64 ) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(USRPTEST DEFAULT_MSG USRPTEST_LIBRARIES USRPTEST_INCLUDE_DIRS) -MARK_AS_ADVANCED(USRPTEST_LIBRARIES USRPTEST_INCLUDE_DIRS) +mark_as_advanced(USRPTEST_LIBRARIES USRPTEST_INCLUDE_DIRS) diff --git a/tools/gr-usrptest/cmake/cmake_uninstall.cmake.in b/tools/gr-usrptest/cmake/cmake_uninstall.cmake.in index 9ae1ae4bd..ab8f77ad7 100644 --- a/tools/gr-usrptest/cmake/cmake_uninstall.cmake.in +++ b/tools/gr-usrptest/cmake/cmake_uninstall.cmake.in @@ -1,32 +1,32 @@ # http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -STRING(REGEX REPLACE "\n" ";" files "${files}") -FOREACH(file ${files}) - MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") + if(EXISTS "$ENV{DESTDIR}${file}") + exec_program( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + endif(NOT "${rm_retval}" STREQUAL 0) + elseif(IS_SYMLINK "$ENV{DESTDIR}${file}") + exec_program( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") -ENDFOREACH(file) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + endif(NOT "${rm_retval}" STREQUAL 0) + else(EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + endif(EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) diff --git a/tools/gr-usrptest/lib/CMakeLists.txt b/tools/gr-usrptest/lib/CMakeLists.txt index 10ba461e1..1d6aeafac 100644 --- a/tools/gr-usrptest/lib/CMakeLists.txt +++ b/tools/gr-usrptest/lib/CMakeLists.txt @@ -31,7 +31,7 @@ list(APPEND usrptest_sources set(usrptest_sources "${usrptest_sources}" PARENT_SCOPE) if(NOT usrptest_sources) - MESSAGE(STATUS "No C++ sources... skipping lib/") + message(STATUS "No C++ sources... skipping lib/") return() endif(NOT usrptest_sources) diff --git a/tools/gr-usrptest/swig/CMakeLists.txt b/tools/gr-usrptest/swig/CMakeLists.txt index ae42be628..d1b1fa8ee 100644 --- a/tools/gr-usrptest/swig/CMakeLists.txt +++ b/tools/gr-usrptest/swig/CMakeLists.txt @@ -21,7 +21,7 @@ # Check if there is C++ code at all ######################################################################## if(NOT usrptest_sources) - MESSAGE(STATUS "No C++ sources... skipping swig/") + message(STATUS "No C++ sources... skipping swig/") return() endif(NOT usrptest_sources) -- cgit v1.2.3