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/lib | |
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/lib')
33 files changed, 380 insertions, 380 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 0645a1a32..ebe518842 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -8,21 +8,21 @@ ######################################################################## # Helpful Macros ######################################################################## -MACRO(LIBUHD_APPEND_SOURCES) - LIST(APPEND libuhd_sources ${ARGV}) -ENDMACRO(LIBUHD_APPEND_SOURCES) +macro(LIBUHD_APPEND_SOURCES) + list(APPEND libuhd_sources ${ARGV}) +endmacro(LIBUHD_APPEND_SOURCES) -MACRO(LIBUHD_APPEND_LIBS) - LIST(APPEND libuhd_libs ${ARGV}) -ENDMACRO(LIBUHD_APPEND_LIBS) +macro(LIBUHD_APPEND_LIBS) + list(APPEND libuhd_libs ${ARGV}) +endmacro(LIBUHD_APPEND_LIBS) -MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile) +macro(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile) #ensure that the directory exists for outfile - GET_FILENAME_COMPONENT(outfile_dir ${outfile} PATH) - FILE(MAKE_DIRECTORY ${outfile_dir}) + get_filename_component(outfile_dir ${outfile} PATH) + file(MAKE_DIRECTORY ${outfile_dir}) #make the outfile depend on the python script - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${outfile} DEPENDS ${pyfile} ${LIBUHD_PYTHON_GEN_SOURCE_DEPS} COMMAND ${PYTHON_EXECUTABLE} -B ${pyfile} ${outfile} COMMENT "Generating ${outfile}" @@ -30,39 +30,39 @@ MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile) #make libuhd depend on the outfile LIBUHD_APPEND_SOURCES(${outfile}) -ENDMACRO(LIBUHD_PYTHON_GEN_SOURCE) +endmacro(LIBUHD_PYTHON_GEN_SOURCE) -MACRO(INCLUDE_SUBDIRECTORY subdir) +macro(INCLUDE_SUBDIRECTORY subdir) #insert the current directories on the front of the list - LIST(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR}) - LIST(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR}) + list(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR}) + list(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR}) #set the current directories to the names of the subdirs - SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) - SET(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir}) + set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) + set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir}) #include the subdirectory CMakeLists to run it - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) #reset the value of the current directories - LIST(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR) - LIST(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR) + list(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR) + list(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR) #pop the subdir names of the front of the list - LIST(REMOVE_AT _cmake_source_dirs 0) - LIST(REMOVE_AT _cmake_binary_dirs 0) -ENDMACRO(INCLUDE_SUBDIRECTORY) + list(REMOVE_AT _cmake_source_dirs 0) + list(REMOVE_AT _cmake_binary_dirs 0) +endmacro(INCLUDE_SUBDIRECTORY) ######################################################################## # Register lower level components ######################################################################## -MESSAGE(STATUS "") +message(STATUS "") # Dependencies -FIND_PACKAGE(USB1) -FIND_PACKAGE(GPSD) -FIND_PACKAGE(LIBERIO) -FIND_PACKAGE(DPDK) +find_package(USB1) +find_package(GPSD) +find_package(LIBERIO) +find_package(DPDK) LIBUHD_REGISTER_COMPONENT("LIBERIO" ENABLE_LIBERIO ON "ENABLE_LIBUHD;LIBERIO_FOUND" OFF OFF) LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF OFF) LIBUHD_REGISTER_COMPONENT("GPSD" ENABLE_GPSD OFF "ENABLE_LIBUHD;ENABLE_GPSD;LIBGPS_FOUND" OFF OFF) @@ -99,9 +99,9 @@ INCLUDE_SUBDIRECTORY(transport) ######################################################################## # Build info ######################################################################## -INCLUDE(UHDBuildInfo) +include(UHDBuildInfo) UHD_LOAD_BUILD_INFO() -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/build_info.cpp ${CMAKE_CURRENT_BINARY_DIR}/build_info.cpp @ONLY) @@ -109,7 +109,7 @@ CONFIGURE_FILE( ######################################################################## # Setup UHD_VERSION_STRING for version.cpp ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp ${CMAKE_CURRENT_BINARY_DIR}/version.cpp @ONLY) @@ -129,80 +129,80 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_BINARY_DIR}/version.cpp ) -IF(ENABLE_C_API) +if(ENABLE_C_API) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/error_c.cpp ) -ENDIF(ENABLE_C_API) +endif(ENABLE_C_API) ######################################################################## # Add DLL resource file to Windows build ######################################################################## -IF(MSVC) - MATH(EXPR RC_VERSION_MAJOR_API "${UHD_VERSION_MAJOR} * 1000 + ${UHD_VERSION_API}") - SET(RC_VERSION_PATCH ${UHD_VERSION_PATCH}) - IF(UHD_VERSION_DEVEL) - SET(RC_VERSION_PATCH "999") - ENDIF(UHD_VERSION_DEVEL) +if(MSVC) + math(EXPR RC_VERSION_MAJOR_API "${UHD_VERSION_MAJOR} * 1000 + ${UHD_VERSION_API}") + set(RC_VERSION_PATCH ${UHD_VERSION_PATCH}) + if(UHD_VERSION_DEVEL) + set(RC_VERSION_PATCH "999") + endif(UHD_VERSION_DEVEL) # Allow a custom .rc template file to be used - IF(CUSTOM_RC_FILE) - IF(IS_ABSOLUTE "${CUSTOM_RC_FILE}") - SET(UHD_RC_IN "${CUSTOM_RC_FILE}") - ELSE() - SET(UHD_RC_IN "${CMAKE_BINARY_DIR}/${CUSTOM_RC_FILE}") - ENDIF(IS_ABSOLUTE "${CUSTOM_RC_FILE}") - MESSAGE(STATUS "") - MESSAGE(STATUS "Using custom RC template: ${UHD_RC_IN}") - MESSAGE(STATUS "") - ELSE() - SET(UHD_RC_IN "${CMAKE_CURRENT_SOURCE_DIR}/uhd.rc.in") - ENDIF(CUSTOM_RC_FILE) - SET(UHD_RC_IN ${UHD_RC_IN} CACHE STRING "uhd.rc template filepath") - - CONFIGURE_FILE( + if(CUSTOM_RC_FILE) + if(IS_ABSOLUTE "${CUSTOM_RC_FILE}") + set(UHD_RC_IN "${CUSTOM_RC_FILE}") + else() + set(UHD_RC_IN "${CMAKE_BINARY_DIR}/${CUSTOM_RC_FILE}") + endif(IS_ABSOLUTE "${CUSTOM_RC_FILE}") + message(STATUS "") + message(STATUS "Using custom RC template: ${UHD_RC_IN}") + message(STATUS "") + else() + set(UHD_RC_IN "${CMAKE_CURRENT_SOURCE_DIR}/uhd.rc.in") + endif(CUSTOM_RC_FILE) + set(UHD_RC_IN ${UHD_RC_IN} CACHE STRING "uhd.rc template filepath") + + configure_file( ${UHD_RC_IN} ${CMAKE_CURRENT_BINARY_DIR}/uhd.rc @ONLY) - LIST(APPEND libuhd_sources ${CMAKE_CURRENT_BINARY_DIR}/uhd.rc) -ENDIF(MSVC) + list(APPEND libuhd_sources ${CMAKE_CURRENT_BINARY_DIR}/uhd.rc) +endif(MSVC) ######################################################################## # Setup libuhd library ######################################################################## -IF(ENABLE_MPMD) - INCLUDE_DIRECTORIES(deps/rpclib/include) - ADD_SUBDIRECTORY(deps) - LIST(APPEND libuhd_sources $<TARGET_OBJECTS:uhd_rpclib>) -ENDIF() -ADD_LIBRARY(uhd SHARED ${libuhd_sources}) -TARGET_LINK_LIBRARIES(uhd ${Boost_LIBRARIES} ${libuhd_libs}) -SET_TARGET_PROPERTIES(uhd PROPERTIES DEFINE_SYMBOL "UHD_DLL_EXPORTS") -IF(NOT LIBUHDDEV_PKG) - SET_TARGET_PROPERTIES(uhd PROPERTIES SOVERSION "${UHD_ABI_VERSION}") - SET_TARGET_PROPERTIES(uhd PROPERTIES VERSION "${UHD_ABI_VERSION}") -ENDIF(NOT LIBUHDDEV_PKG) -IF(DEFINED LIBUHD_OUTPUT_NAME) - SET_TARGET_PROPERTIES(uhd PROPERTIES OUTPUT_NAME ${LIBUHD_OUTPUT_NAME}) -ENDIF(DEFINED LIBUHD_OUTPUT_NAME) - -IF(NOT UHDHOST_PKG) #Syntax makes it unusable by UHD_INSTALL - INSTALL(TARGETS uhd +if(ENABLE_MPMD) + include_directories(deps/rpclib/include) + add_subdirectory(deps) + list(APPEND libuhd_sources $<TARGET_OBJECTS:uhd_rpclib>) +endif() +add_library(uhd SHARED ${libuhd_sources}) +target_link_libraries(uhd ${Boost_LIBRARIES} ${libuhd_libs}) +set_target_properties(uhd PROPERTIES DEFINE_SYMBOL "UHD_DLL_EXPORTS") +if(NOT LIBUHDDEV_PKG) + set_target_properties(uhd PROPERTIES SOVERSION "${UHD_ABI_VERSION}") + set_target_properties(uhd PROPERTIES VERSION "${UHD_ABI_VERSION}") +endif(NOT LIBUHDDEV_PKG) +if(DEFINED LIBUHD_OUTPUT_NAME) + set_target_properties(uhd PROPERTIES OUTPUT_NAME ${LIBUHD_OUTPUT_NAME}) +endif(DEFINED LIBUHD_OUTPUT_NAME) + +if(NOT UHDHOST_PKG) #Syntax makes it unusable by UHD_INSTALL + install(TARGETS uhd LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT libraries # .so file ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT libraries # .lib file RUNTIME DESTINATION ${RUNTIME_DIR} COMPONENT libraries # .dll file ) -ENDIF(NOT UHDHOST_PKG) +endif(NOT UHDHOST_PKG) ####################################################### # Setup libuhd library (static) ####################################################### -IF(ENABLE_STATIC_LIBS) - ADD_LIBRARY(uhd_static STATIC ${libuhd_sources}) - SET_TARGET_PROPERTIES(uhd_static PROPERTIES OUTPUT_NAME uhd) - SET_TARGET_PROPERTIES(uhd_static PROPERTIES COMPILE_DEFINITIONS UHD_STATIC_LIB) - INSTALL(TARGETS uhd_static +if(ENABLE_STATIC_LIBS) + add_library(uhd_static STATIC ${libuhd_sources}) + set_target_properties(uhd_static PROPERTIES OUTPUT_NAME uhd) + set_target_properties(uhd_static PROPERTIES COMPILE_DEFINITIONS UHD_STATIC_LIB) + install(TARGETS uhd_static ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib or .a file ) -ENDIF(ENABLE_STATIC_LIBS) +endif(ENABLE_STATIC_LIBS) diff --git a/host/lib/cal/CMakeLists.txt b/host/lib/cal/CMakeLists.txt index db15334a4..a66f16aa7 100644 --- a/host/lib/cal/CMakeLists.txt +++ b/host/lib/cal/CMakeLists.txt @@ -8,14 +8,14 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -INCLUDE(CheckIncludeFileCXX) -MESSAGE(STATUS "") +include(CheckIncludeFileCXX) +message(STATUS "") ######################################################################## # Convert types generation ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/power_container_impl.cpp diff --git a/host/lib/convert/CMakeLists.txt b/host/lib/convert/CMakeLists.txt index 82d1e51f2..5034e2850 100644 --- a/host/lib/convert/CMakeLists.txt +++ b/host/lib/convert/CMakeLists.txt @@ -8,31 +8,31 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -INCLUDE(CheckIncludeFileCXX) -MESSAGE(STATUS "") +include(CheckIncludeFileCXX) +message(STATUS "") ######################################################################## # Check for SSE2 SIMD headers ######################################################################## -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(EMMINTRIN_FLAGS -msse2) - SET(TMMINTRIN_FLAGS -mssse3) -ELSEIF(MSVC) - SET(EMMINTRIN_FLAGS /arch:SSE2) -ENDIF() +if(CMAKE_COMPILER_IS_GNUCXX) + set(EMMINTRIN_FLAGS -msse2) + set(TMMINTRIN_FLAGS -mssse3) +elseif(MSVC) + set(EMMINTRIN_FLAGS /arch:SSE2) +endif() -SET(CMAKE_REQUIRED_FLAGS ${EMMINTRIN_FLAGS}) +set(CMAKE_REQUIRED_FLAGS ${EMMINTRIN_FLAGS}) CHECK_INCLUDE_FILE_CXX(emmintrin.h HAVE_EMMINTRIN_H) -SET(CMAKE_REQUIRED_FLAGS) +set(CMAKE_REQUIRED_FLAGS) -IF(ENABLE_SSSE3) -SET(CMAKE_REQUIRED_FLAGS ${TMMINTRIN_FLAGS}) +if(ENABLE_SSSE3) +set(CMAKE_REQUIRED_FLAGS ${TMMINTRIN_FLAGS}) CHECK_INCLUDE_FILE_CXX(tmmintrin.h HAVE_TMMINTRIN_H) -SET(CMAKE_REQUIRED_FLAGS) -ENDIF(ENABLE_SSSE3) +set(CMAKE_REQUIRED_FLAGS) +endif(ENABLE_SSSE3) -IF(HAVE_EMMINTRIN_H) - SET(convert_with_sse2_sources +if(HAVE_EMMINTRIN_H) + set(convert_with_sse2_sources ${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_sc16.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_fc64.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_fc32.cpp @@ -43,50 +43,50 @@ IF(HAVE_EMMINTRIN_H) ${CMAKE_CURRENT_SOURCE_DIR}/sse2_fc64_to_sc8.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sse2_fc32_to_sc8.cpp ) - SET_SOURCE_FILES_PROPERTIES( + set_source_files_properties( ${convert_with_sse2_sources} PROPERTIES COMPILE_FLAGS "${EMMINTRIN_FLAGS}" ) LIBUHD_APPEND_SOURCES(${convert_with_sse2_sources}) -ENDIF(HAVE_EMMINTRIN_H) +endif(HAVE_EMMINTRIN_H) -IF(HAVE_TMMINTRIN_H) - SET(convert_with_ssse3_sources +if(HAVE_TMMINTRIN_H) + set(convert_with_ssse3_sources ${CMAKE_CURRENT_SOURCE_DIR}/ssse3_pack_sc12.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ssse3_unpack_sc12.cpp ) - SET_SOURCE_FILES_PROPERTIES( + set_source_files_properties( ${convert_with_ssse3_sources} PROPERTIES COMPILE_FLAGS "${TMMINTRIN_FLAGS}" ) LIBUHD_APPEND_SOURCES(${convert_with_ssse3_sources}) -ENDIF(HAVE_TMMINTRIN_H) +endif(HAVE_TMMINTRIN_H) ######################################################################## # Check for NEON SIMD headers ######################################################################## -SET(NEON_SIMD_ENABLE ON CACHE BOOL +set(NEON_SIMD_ENABLE ON CACHE BOOL "Use NEON SIMD instructions, if applicable") -MARK_AS_ADVANCED(NEON_SIMD_ENABLE) -IF(CMAKE_COMPILER_IS_GNUCXX) +mark_as_advanced(NEON_SIMD_ENABLE) +if(CMAKE_COMPILER_IS_GNUCXX) CHECK_INCLUDE_FILE_CXX(arm_neon.h HAVE_ARM_NEON_H) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_COMPILER_IS_GNUCXX) -IF(NEON_SIMD_ENABLE AND HAVE_ARM_NEON_H AND +if(NEON_SIMD_ENABLE AND HAVE_ARM_NEON_H AND (${CMAKE_SIZEOF_VOID_P} EQUAL 4)) - ENABLE_LANGUAGE(ASM) + enable_language(ASM) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/convert_with_neon.cpp ${CMAKE_CURRENT_SOURCE_DIR}/convert_neon.S ) -ENDIF() +endif() ######################################################################## # Convert types generation ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_convert_general.py diff --git a/host/lib/deps/CMakeLists.txt b/host/lib/deps/CMakeLists.txt index a3858bad8..6e171efea 100644 --- a/host/lib/deps/CMakeLists.txt +++ b/host/lib/deps/CMakeLists.txt @@ -4,6 +4,6 @@ # SPDX-License-Identifier: GPL-3.0 # -IF(ENABLE_MPMD) - ADD_SUBDIRECTORY(rpclib) -ENDIF() +if(ENABLE_MPMD) + add_subdirectory(rpclib) +endif() diff --git a/host/lib/deps/rpc_CMakeLists.txt b/host/lib/deps/rpc_CMakeLists.txt index c8cb322da..ef28dbaf1 100644 --- a/host/lib/deps/rpc_CMakeLists.txt +++ b/host/lib/deps/rpc_CMakeLists.txt @@ -1,26 +1,26 @@ -PROJECT(UHD_RPCLIB CXX) +project(UHD_RPCLIB CXX) -SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size") +set(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size") -SET(RPCLIB_VERSION_MAJOR ${rpclib_major_version}) -SET(RPCLIB_VERSION_MINOR ${rpclib_minor_version}) -SET(RPCLIB_VERSION_PATCH ${rpclib_patch_version}) +set(RPCLIB_VERSION_MAJOR ${rpclib_major_version}) +set(RPCLIB_VERSION_MINOR ${rpclib_minor_version}) +set(RPCLIB_VERSION_PATCH ${rpclib_patch_version}) -CONFIGURE_FILE( +configure_file( ${"${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/version.h.in"} ${"${CMAKE_CURRENT_BINARY_DIR}/version.h"}) -CONFIGURE_FILE( +configure_file( ${"${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/config.h.in"} ${"${CMAKE_CURRENT_BINARY_DIR}/config.h"}) -SET(RPCLIB_COMPILE_DEFINITIONS "") -IF(${"${CMAKE_CXX_COMPILER_ID}"} MATCHES "Clang") +set(RPCLIB_COMPILE_DEFINITIONS "") +if(${"${CMAKE_CXX_COMPILER_ID}"} MATCHES "Clang") -ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "GNU") +elseif(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "GNU") -ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC") - SET(RPCLIB_COMPILE_DEFINITIONS +elseif(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC") + set(RPCLIB_COMPILE_DEFINITIONS "${"${RPCLIB_COMPILE_DEFINITIONS}"}" "WIN32_LEAN_AND_MEAN" "NOMINMAX" @@ -35,11 +35,11 @@ ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC") "ASIO_HAS_STD_SHARED_PTR" "ASIO_HAS_STD_TYPE_TRAITS" ) -ENDIF() +endif() -INCLUDE_DIRECTORIES(include) -INCLUDE_DIRECTORIES(include/rpc) -ADD_LIBRARY(uhd_rpclib OBJECT +include_directories(include) +include_directories(include/rpc) +add_library(uhd_rpclib OBJECT lib/rpc/dispatcher.cc lib/rpc/server.cc lib/rpc/client.cc @@ -51,7 +51,7 @@ ADD_LIBRARY(uhd_rpclib OBJECT lib/rpc/detail/response.cc lib/rpc/detail/client_error.cc ) -SET_TARGET_PROPERTIES(uhd_rpclib +set_target_properties(uhd_rpclib PROPERTIES POSITION_INDEPENDENT_CODE ON COMPILE_DEFINITIONS "${"${RPCLIB_COMPILE_DEFINITIONS}"}" diff --git a/host/lib/deps/rpclib/CMakeLists.txt b/host/lib/deps/rpclib/CMakeLists.txt index dd53fabe8..56c4865c4 100644 --- a/host/lib/deps/rpclib/CMakeLists.txt +++ b/host/lib/deps/rpclib/CMakeLists.txt @@ -1,26 +1,26 @@ -PROJECT(UHD_RPCLIB CXX) +project(UHD_RPCLIB CXX) -SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size") +set(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size") -SET(RPCLIB_VERISION_MAJOR 1) -SET(RPCLIB_VERSION_MINOR 0) -SET(RPCLIB_VERSION_PATCH 0) +set(RPCLIB_VERISION_MAJOR 1) +set(RPCLIB_VERSION_MINOR 0) +set(RPCLIB_VERSION_PATCH 0) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -SET(RPCLIB_COMPILE_DEFINITIONS "") -IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") +set(RPCLIB_COMPILE_DEFINITIONS "") +if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") -ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") -ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") - SET(RPCLIB_COMPILE_DEFINITIONS +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + set(RPCLIB_COMPILE_DEFINITIONS "${RPCLIB_COMPILE_DEFINITIONS}" "WIN32_LEAN_AND_MEAN" "NOMINMAX" @@ -35,11 +35,11 @@ ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") "ASIO_HAS_STD_SHARED_PTR" "ASIO_HAS_STD_TYPE_TRAITS" ) -ENDIF() +endif() -INCLUDE_DIRECTORIES(include) -INCLUDE_DIRECTORIES(include/rpc) -ADD_LIBRARY(uhd_rpclib OBJECT +include_directories(include) +include_directories(include/rpc) +add_library(uhd_rpclib OBJECT lib/rpc/dispatcher.cc lib/rpc/server.cc lib/rpc/client.cc @@ -51,7 +51,7 @@ ADD_LIBRARY(uhd_rpclib OBJECT lib/rpc/detail/response.cc lib/rpc/detail/client_error.cc ) -SET_TARGET_PROPERTIES(uhd_rpclib +set_target_properties(uhd_rpclib PROPERTIES POSITION_INDEPENDENT_CODE ON COMPILE_DEFINITIONS "${RPCLIB_COMPILE_DEFINITIONS}" diff --git a/host/lib/experts/CMakeLists.txt b/host/lib/experts/CMakeLists.txt index 3101a7330..393c999f1 100644 --- a/host/lib/experts/CMakeLists.txt +++ b/host/lib/experts/CMakeLists.txt @@ -14,9 +14,9 @@ LIBUHD_APPEND_SOURCES( ) # Verbose Debug output for send/recv -SET( UHD_EXPERT_LOGGING OFF CACHE BOOL "Enable verbose logging for experts" ) -OPTION( UHD_EXPERT_LOGGING "Enable verbose logging for experts" "" ) -IF(UHD_EXPERT_LOGGING) - MESSAGE(STATUS "Enabling verbose logging for experts") - ADD_DEFINITIONS(-DUHD_EXPERT_LOGGING) -ENDIF() +set( UHD_EXPERT_LOGGING OFF CACHE BOOL "Enable verbose logging for experts" ) +option( UHD_EXPERT_LOGGING "Enable verbose logging for experts" "" ) +if(UHD_EXPERT_LOGGING) + message(STATUS "Enabling verbose logging for experts") + add_definitions(-DUHD_EXPERT_LOGGING) +endif() diff --git a/host/lib/ic_reg_maps/CMakeLists.txt b/host/lib/ic_reg_maps/CMakeLists.txt index 3f06d9419..42ac4d051 100644 --- a/host/lib/ic_reg_maps/CMakeLists.txt +++ b/host/lib/ic_reg_maps/CMakeLists.txt @@ -9,8 +9,8 @@ # This file included, use CMake directory variables ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -SET(LIBUHD_PYTHON_GEN_SOURCE_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/common.py) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +set(LIBUHD_PYTHON_GEN_SOURCE_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/common.py) LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_adf4350_regs.py @@ -142,4 +142,4 @@ LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_BINARY_DIR}/rhodium_cpld_regs.hpp ) -SET(LIBUHD_PYTHON_GEN_SOURCE_DEPS) +set(LIBUHD_PYTHON_GEN_SOURCE_DEPS) diff --git a/host/lib/include/CMakeLists.txt b/host/lib/include/CMakeLists.txt index a688f4ea9..fc1a6c4d5 100644 --- a/host/lib/include/CMakeLists.txt +++ b/host/lib/include/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: GPL-3.0+ # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/host/lib/rfnoc/nocscript/CMakeLists.txt b/host/lib/rfnoc/nocscript/CMakeLists.txt index 503bd5e03..8fb7215ad 100644 --- a/host/lib/rfnoc/nocscript/CMakeLists.txt +++ b/host/lib/rfnoc/nocscript/CMakeLists.txt @@ -5,19 +5,19 @@ # SPDX-License-Identifier: GPL-3.0 # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_basic_funcs.py ${CMAKE_CURRENT_BINARY_DIR}/basic_functions.hpp ) -IF(ENABLE_MANUAL) +if(ENABLE_MANUAL) LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_basic_funcs.py ${CMAKE_BINARY_DIR}/docs/nocscript_functions.dox ) -ENDIF(ENABLE_MANUAL) +endif(ENABLE_MANUAL) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/expression.cpp diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt index 7c79bc67c..a7f986277 100644 --- a/host/lib/transport/CMakeLists.txt +++ b/host/lib/transport/CMakeLists.txt @@ -12,17 +12,17 @@ ######################################################################## # Include subdirectories (different than add) ######################################################################## -IF(ENABLE_X300) +if(ENABLE_X300) INCLUDE_SUBDIRECTORY(nirio) -ENDIF(ENABLE_X300) +endif(ENABLE_X300) ######################################################################## # Setup libusb ######################################################################## -IF(ENABLE_USB) - MESSAGE(STATUS "") - MESSAGE(STATUS "USB support enabled via libusb.") - INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS}) +if(ENABLE_USB) + message(STATUS "") + message(STATUS "USB support enabled via libusb.") + include_directories(${LIBUSB_INCLUDE_DIRS}) LIBUHD_APPEND_LIBS(${LIBUSB_LIBRARIES}) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/libusb1_control.cpp @@ -30,23 +30,23 @@ IF(ENABLE_USB) ${CMAKE_CURRENT_SOURCE_DIR}/libusb1_base.cpp ${CMAKE_CURRENT_SOURCE_DIR}/libusb1_base.hpp ) - SET_SOURCE_FILES_PROPERTIES( + set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/libusb1_zero_copy.cpp PROPERTIES COMPILE_DEFINITIONS "${LIBUSB_DEFINITIONS}" ) -ELSE(ENABLE_USB) +else(ENABLE_USB) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/usb_dummy_impl.cpp ) -ENDIF(ENABLE_USB) +endif(ENABLE_USB) ######################################################################## # Setup defines for interface address discovery ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring interface address discovery...") -INCLUDE(CheckCXXSourceCompiles) -INCLUDE(CheckIncludeFileCXX) +message(STATUS "") +message(STATUS "Configuring interface address discovery...") +include(CheckCXXSourceCompiles) +include(CheckIncludeFileCXX) CHECK_CXX_SOURCE_COMPILES(" #include <ifaddrs.h> @@ -60,18 +60,18 @@ CHECK_CXX_SOURCE_COMPILES(" CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H) -IF(HAVE_GETIFADDRS) - MESSAGE(STATUS " Interface address discovery supported through getifaddrs.") - SET(IF_ADDRS_DEFS HAVE_GETIFADDRS) -ELSEIF(HAVE_WINSOCK2_H) - MESSAGE(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.") - SET(IF_ADDRS_DEFS HAVE_SIO_GET_INTERFACE_LIST) -ELSE() - MESSAGE(STATUS " Interface address discovery not supported.") - SET(IF_ADDRS_DEFS HAVE_IF_ADDRS_DUMMY) -ENDIF() - -SET_SOURCE_FILES_PROPERTIES( +if(HAVE_GETIFADDRS) + message(STATUS " Interface address discovery supported through getifaddrs.") + set(IF_ADDRS_DEFS HAVE_GETIFADDRS) +elseif(HAVE_WINSOCK2_H) + message(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.") + set(IF_ADDRS_DEFS HAVE_SIO_GET_INTERFACE_LIST) +else() + message(STATUS " Interface address discovery not supported.") + set(IF_ADDRS_DEFS HAVE_IF_ADDRS_DUMMY) +endif() + +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/if_addrs.cpp PROPERTIES COMPILE_DEFINITIONS "${IF_ADDRS_DEFS}" ) @@ -79,29 +79,29 @@ SET_SOURCE_FILES_PROPERTIES( ######################################################################## # Setup UDP ######################################################################## -IF(WIN32) +if(WIN32) LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/udp_wsa_zero_copy.cpp) -ELSE() +else() LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp) -ENDIF() +endif() #On windows, the boost asio implementation uses the winsock2 library. #Note: we exclude the .lib extension for cygwin and mingw platforms. -IF(WIN32) +if(WIN32) LIBUHD_APPEND_LIBS(ws2_32) -ENDIF() +endif() #atlbase.h is not included with visual studio express #conditionally check for atlbase.h and define if found -INCLUDE(CheckIncludeFileCXX) +include(CheckIncludeFileCXX) CHECK_INCLUDE_FILE_CXX(atlbase.h HAVE_ATLBASE_H) -IF(HAVE_ATLBASE_H) - SET_SOURCE_FILES_PROPERTIES( +if(HAVE_ATLBASE_H) + set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp ${CMAKE_CURRENT_SOURCE_DIR}/udp_wsa_zero_copy.cpp PROPERTIES COMPILE_DEFINITIONS "HAVE_ATLBASE_H" ) -ENDIF(HAVE_ATLBASE_H) +endif(HAVE_ATLBASE_H) ######################################################################## # Append to the list of sources for lib uhd @@ -123,29 +123,29 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/zero_copy_flow_ctrl.cpp ) -IF(ENABLE_X300) +if(ENABLE_X300) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/nirio_zero_copy.cpp ) -ENDIF(ENABLE_X300) +endif(ENABLE_X300) -IF(ENABLE_LIBERIO) - INCLUDE_DIRECTORIES(${LIBERIO_INCLUDE_DIRS}) +if(ENABLE_LIBERIO) + include_directories(${LIBERIO_INCLUDE_DIRS}) LIBUHD_APPEND_LIBS(${LIBERIO_LIBRARIES}) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/liberio_zero_copy.cpp ) -ENDIF(ENABLE_LIBERIO) +endif(ENABLE_LIBERIO) -IF(ENABLE_DPDK) +if(ENABLE_DPDK) INCLUDE_SUBDIRECTORY(uhd-dpdk) -ENDIF(ENABLE_DPDK) +endif(ENABLE_DPDK) # Verbose Debug output for send/recv -SET( UHD_TXRX_DEBUG_PRINTS OFF CACHE BOOL "Use verbose debug output for send/recv" ) -OPTION( UHD_TXRX_DEBUG_PRINTS "Use verbose debug output for send/recv" "" ) -IF(UHD_TXRX_DEBUG_PRINTS) - MESSAGE(STATUS "Using verbose debug output for send/recv") - ADD_DEFINITIONS(-DUHD_TXRX_DEBUG_PRINTS) -ENDIF() +set( UHD_TXRX_DEBUG_PRINTS OFF CACHE BOOL "Use verbose debug output for send/recv" ) +option( UHD_TXRX_DEBUG_PRINTS "Use verbose debug output for send/recv" "" ) +if(UHD_TXRX_DEBUG_PRINTS) + message(STATUS "Using verbose debug output for send/recv") + add_definitions(-DUHD_TXRX_DEBUG_PRINTS) +endif() diff --git a/host/lib/transport/nirio/CMakeLists.txt b/host/lib/transport/nirio/CMakeLists.txt index 8336d6063..af456c595 100644 --- a/host/lib/transport/nirio/CMakeLists.txt +++ b/host/lib/transport/nirio/CMakeLists.txt @@ -29,10 +29,10 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/status.cpp ) -IF(WIN32) +if(WIN32) LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_win.cpp) -ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") #Built-in variable encompasses all UNIX-like systems +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") #Built-in variable encompasses all UNIX-like systems LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_linux.cpp) -ELSE() +else() LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_unsupported.cpp) -ENDIF(WIN32) +endif(WIN32) diff --git a/host/lib/transport/nirio/lvbitx/CMakeLists.txt b/host/lib/transport/nirio/lvbitx/CMakeLists.txt index 6fbd6b469..8fb5bd079 100644 --- a/host/lib/transport/nirio/lvbitx/CMakeLists.txt +++ b/host/lib/transport/nirio/lvbitx/CMakeLists.txt @@ -5,21 +5,21 @@ # SPDX-License-Identifier: GPL-3.0 # -MACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile) - GET_FILENAME_COMPONENT(lvbitxprefix ${lvbitx} NAME_WE) +macro(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile) + get_filename_component(lvbitxprefix ${lvbitx} NAME_WE) - IF( ${binfile} STREQUAL "OFF" ) - SET( GEN_OPTIONS ) - MESSAGE( STATUS " Using ${lvbitx} for codegen" ) - ELSE( ${binfile} STREQUAL "OFF" ) - SET( GEN_OPTIONS --merge-bin=${CMAKE_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${CMAKE_SOURCE_DIR}/../binaries ) - MESSAGE( STATUS " Merging ${lvbitx} with ${binfile} for codegen" ) - ENDIF( ${binfile} STREQUAL "OFF" ) + if( ${binfile} STREQUAL "OFF" ) + set( GEN_OPTIONS ) + message( STATUS " Using ${lvbitx} for codegen" ) + else( ${binfile} STREQUAL "OFF" ) + set( GEN_OPTIONS --merge-bin=${CMAKE_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${CMAKE_SOURCE_DIR}/../binaries ) + message( STATUS " Merging ${lvbitx} with ${binfile} for codegen" ) + endif( ${binfile} STREQUAL "OFF" ) - SET(OUTPUT_PATH_OPT --output-src-path=${CMAKE_CURRENT_BINARY_DIR}) - SET(IMAGES_PATH_OPT --uhd-images-path=${UHD_IMAGES_DIR}) + set(OUTPUT_PATH_OPT --output-src-path=${CMAKE_CURRENT_BINARY_DIR}) + set(IMAGES_PATH_OPT --uhd-images-path=${UHD_IMAGES_DIR}) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.cpp OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.hpp DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/process-lvbitx.py @@ -33,16 +33,16 @@ MACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile) #make libuhd depend on the output file LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.hpp) LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.cpp) -ENDMACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM) +endmacro(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) ######################################################################## # Generation code ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Processing NI-RIO FPGA LVBITX Bitstreams...") +message(STATUS "") +message(STATUS "Processing NI-RIO FPGA LVBITX Bitstreams...") # X300 Stuff LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM(x300.lvbitx_base OFF) diff --git a/host/lib/types/CMakeLists.txt b/host/lib/types/CMakeLists.txt index 7f8c80c95..938015dca 100644 --- a/host/lib/types/CMakeLists.txt +++ b/host/lib/types/CMakeLists.txt @@ -24,7 +24,7 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/byte_vector.cpp ) -IF(ENABLE_C_API) +if(ENABLE_C_API) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/metadata_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ranges_c.cpp @@ -33,4 +33,4 @@ IF(ENABLE_C_API) ${CMAKE_CURRENT_SOURCE_DIR}/tune_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/usrp_info_c.cpp ) -ENDIF() +endif() diff --git a/host/lib/usrp/CMakeLists.txt b/host/lib/usrp/CMakeLists.txt index 9a1818599..9998c1a4a 100644 --- a/host/lib/usrp/CMakeLists.txt +++ b/host/lib/usrp/CMakeLists.txt @@ -8,7 +8,7 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/dboard_base.cpp @@ -22,21 +22,21 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/fe_connection.cpp ) -IF(ENABLE_C_API) +if(ENABLE_C_API) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/dboard_eeprom_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mboard_eeprom_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subdev_spec_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/usrp_c.cpp ) -ENDIF(ENABLE_C_API) +endif(ENABLE_C_API) -IF(ENABLE_GPSD) +if(ENABLE_GPSD) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/gpsd_iface.cpp ) LIBUHD_APPEND_LIBS(${LIBGPS_LIBRARY}) -ENDIF(ENABLE_GPSD) +endif(ENABLE_GPSD) INCLUDE_SUBDIRECTORY(cores) INCLUDE_SUBDIRECTORY(dboard) diff --git a/host/lib/usrp/b100/CMakeLists.txt b/host/lib/usrp/b100/CMakeLists.txt index 8548b961b..6f6050c34 100644 --- a/host/lib/usrp/b100/CMakeLists.txt +++ b/host/lib/usrp/b100/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the B100 support ######################################################################## -IF(ENABLE_B100) +if(ENABLE_B100) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/b100_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/clock_ctrl.cpp @@ -23,4 +23,4 @@ IF(ENABLE_B100) ${CMAKE_CURRENT_SOURCE_DIR}/usb_zero_copy_wrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fifo_ctrl_excelsior.cpp ) -ENDIF(ENABLE_B100) +endif(ENABLE_B100) diff --git a/host/lib/usrp/b200/CMakeLists.txt b/host/lib/usrp/b200/CMakeLists.txt index 2f3ea2483..78dfe884d 100644 --- a/host/lib/usrp/b200/CMakeLists.txt +++ b/host/lib/usrp/b200/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the B200 support ######################################################################## -IF(ENABLE_B200) +if(ENABLE_B200) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/b200_image_loader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/b200_impl.cpp @@ -22,4 +22,4 @@ IF(ENABLE_B200) ${CMAKE_CURRENT_SOURCE_DIR}/b200_cores.cpp ${CMAKE_CURRENT_SOURCE_DIR}/b200_mb_eeprom.cpp ) -ENDIF(ENABLE_B200) +endif(ENABLE_B200) diff --git a/host/lib/usrp/common/CMakeLists.txt b/host/lib/usrp/common/CMakeLists.txt index 6490fac08..673aa7e78 100644 --- a/host/lib/usrp/common/CMakeLists.txt +++ b/host/lib/usrp/common/CMakeLists.txt @@ -8,22 +8,22 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -IF(ENABLE_USB) +if(ENABLE_USB) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/fx2_ctrl.cpp ) -ENDIF(ENABLE_USB) +endif(ENABLE_USB) -IF(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320) - INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver") +if(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver") LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/ad9361_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ad936x_manager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver/ad9361_device.cpp ) -ENDIF(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320) +endif(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/adf4001_ctrl.cpp diff --git a/host/lib/usrp/cores/CMakeLists.txt b/host/lib/usrp/cores/CMakeLists.txt index 95102f29d..6d3d988f0 100644 --- a/host/lib/usrp/cores/CMakeLists.txt +++ b/host/lib/usrp/cores/CMakeLists.txt @@ -9,7 +9,7 @@ # This file included, use CMake directory variables ######################################################################## -IF(ENABLE_B100 OR ENABLE_USRP2) +if(ENABLE_B100 OR ENABLE_USRP2) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/gpio_core_200.cpp ${CMAKE_CURRENT_SOURCE_DIR}/i2c_core_200.cpp @@ -18,7 +18,7 @@ IF(ENABLE_B100 OR ENABLE_USRP2) ${CMAKE_CURRENT_SOURCE_DIR}/tx_dsp_core_200.cpp ${CMAKE_CURRENT_SOURCE_DIR}/user_settings_core_200.cpp ) -ENDIF(ENABLE_B100 OR ENABLE_USRP2) +endif(ENABLE_B100 OR ENABLE_USRP2) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/dma_fifo_core_3000.cpp diff --git a/host/lib/usrp/dboard/CMakeLists.txt b/host/lib/usrp/dboard/CMakeLists.txt index 25e1bd2b9..5328fcc90 100644 --- a/host/lib/usrp/dboard/CMakeLists.txt +++ b/host/lib/usrp/dboard/CMakeLists.txt @@ -8,7 +8,7 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -IF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100) +if(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/db_basic_and_lf.cpp ${CMAKE_CURRENT_SOURCE_DIR}/db_rfx.cpp @@ -29,31 +29,31 @@ IF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100) ${CMAKE_CURRENT_SOURCE_DIR}/db_dbsrx2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/db_tvrx2.cpp ) -ENDIF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100) +endif(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100) -IF(ENABLE_E300) +if(ENABLE_E300) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/db_e3x0.cpp ) -ENDIF(ENABLE_E300) +endif(ENABLE_E300) -IF(ENABLE_X300) +if(ENABLE_X300) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_experts.cpp ${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_gain_tables.cpp ${CMAKE_CURRENT_SOURCE_DIR}/db_twinrx.cpp ) -ENDIF(ENABLE_X300) +endif(ENABLE_X300) -IF(ENABLE_N300) +if(ENABLE_N300) INCLUDE_SUBDIRECTORY(magnesium) -ENDIF(ENABLE_N300) -IF(ENABLE_N320) +endif(ENABLE_N300) +if(ENABLE_N320) INCLUDE_SUBDIRECTORY(rhodium) -ENDIF(ENABLE_N320) -IF(ENABLE_MPMD AND ENABLE_EISCAT) +endif(ENABLE_N320) +if(ENABLE_MPMD AND ENABLE_EISCAT) INCLUDE_SUBDIRECTORY(eiscat) -ENDIF(ENABLE_MPMD AND ENABLE_EISCAT) +endif(ENABLE_MPMD AND ENABLE_EISCAT) INCLUDE_SUBDIRECTORY(neon) diff --git a/host/lib/usrp/dboard/eiscat/CMakeLists.txt b/host/lib/usrp/dboard/eiscat/CMakeLists.txt index 13da2d6da..650116ec1 100644 --- a/host/lib/usrp/dboard/eiscat/CMakeLists.txt +++ b/host/lib/usrp/dboard/eiscat/CMakeLists.txt @@ -7,7 +7,7 @@ # This file is conditionally included if ENABLE_MPMD and ENABLE_EISCAT are # set to true. -LIST(APPEND EISCAT_SOURCES +list(APPEND EISCAT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/eiscat_radio_ctrl_impl.cpp ) LIBUHD_APPEND_SOURCES(${EISCAT_SOURCES}) diff --git a/host/lib/usrp/dboard/magnesium/CMakeLists.txt b/host/lib/usrp/dboard/magnesium/CMakeLists.txt index 417cd4f54..9f78ce242 100644 --- a/host/lib/usrp/dboard/magnesium/CMakeLists.txt +++ b/host/lib/usrp/dboard/magnesium/CMakeLists.txt @@ -7,7 +7,7 @@ # This file is conditionally included if ENABLE_MPMD and ENABLE_N300 are # set to true. -LIST(APPEND MAGNESIUM_SOURCES +list(APPEND MAGNESIUM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_init.cpp ${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_cpld.cpp diff --git a/host/lib/usrp/dboard/neon/CMakeLists.txt b/host/lib/usrp/dboard/neon/CMakeLists.txt index e1ee0fba4..a2473bd0a 100644 --- a/host/lib/usrp/dboard/neon/CMakeLists.txt +++ b/host/lib/usrp/dboard/neon/CMakeLists.txt @@ -4,12 +4,12 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -IF(ENABLE_E320) - LIST(APPEND NEON_SOURCES +if(ENABLE_E320) + list(APPEND NEON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/neon_radio_ctrl_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/neon_radio_ctrl_init.cpp ${CMAKE_CURRENT_SOURCE_DIR}/neon_ad9361_iface.cpp ${CMAKE_CURRENT_SOURCE_DIR}/neon_bands.cpp ) LIBUHD_APPEND_SOURCES(${NEON_SOURCES}) -ENDIF(ENABLE_E320) +endif(ENABLE_E320) diff --git a/host/lib/usrp/dboard/rhodium/CMakeLists.txt b/host/lib/usrp/dboard/rhodium/CMakeLists.txt index 617e4af58..2b2e9744c 100644 --- a/host/lib/usrp/dboard/rhodium/CMakeLists.txt +++ b/host/lib/usrp/dboard/rhodium/CMakeLists.txt @@ -4,8 +4,8 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -IF(ENABLE_MPMD) - LIST(APPEND RHODIUM_SOURCES +if(ENABLE_MPMD) + list(APPEND RHODIUM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_init.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_cpld.cpp @@ -14,5 +14,5 @@ IF(ENABLE_MPMD) ${CMAKE_CURRENT_SOURCE_DIR}/rhodium_cpld_ctrl.cpp ) LIBUHD_APPEND_SOURCES(${RHODIUM_SOURCES}) -ENDIF(ENABLE_MPMD) +endif(ENABLE_MPMD) diff --git a/host/lib/usrp/e300/CMakeLists.txt b/host/lib/usrp/e300/CMakeLists.txt index 9e85a6bb4..2b4e3105d 100644 --- a/host/lib/usrp/e300/CMakeLists.txt +++ b/host/lib/usrp/e300/CMakeLists.txt @@ -14,8 +14,8 @@ ######################################################################## find_package(UDev) -IF(ENABLE_E300) - LIST(APPEND E300_SOURCES +if(ENABLE_E300) + list(APPEND E300_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/e300_io_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/e300_fifo_config.cpp @@ -31,21 +31,21 @@ IF(ENABLE_E300) ${CMAKE_CURRENT_SOURCE_DIR}/e3xx_radio_ctrl_impl.cpp ) LIBUHD_APPEND_SOURCES(${E300_SOURCES}) - IF(UDEV_FOUND AND NOT E300_FORCE_NETWORK) - INCLUDE_DIRECTORIES(${UDEV_INCLUDE_DIR}) + if(UDEV_FOUND AND NOT E300_FORCE_NETWORK) + include_directories(${UDEV_INCLUDE_DIR}) LIBUHD_APPEND_LIBS(${UDEV_LIBS}) - SET_SOURCE_FILES_PROPERTIES( + set_source_files_properties( ${E300_SOURCES} PROPERTIES COMPILE_DEFINITIONS "E300_NATIVE=1" ) - ENDIF(UDEV_FOUND AND NOT E300_FORCE_NETWORK) + endif(UDEV_FOUND AND NOT E300_FORCE_NETWORK) - IF(ENABLE_GPSD) - SET_SOURCE_FILES_PROPERTIES( + if(ENABLE_GPSD) + set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.hpp ${CMAKE_CURRENT_SOURCE_DIR}/e3xx_radio_ctrl_impl.hpp PROPERTIES COMPILE_DEFINITIONS "E300_GPSD=1" ) - ENDIF(ENABLE_GPSD) -ENDIF(ENABLE_E300) + endif(ENABLE_GPSD) +endif(ENABLE_E300) diff --git a/host/lib/usrp/mpmd/CMakeLists.txt b/host/lib/usrp/mpmd/CMakeLists.txt index 4447f2dc4..774ad6593 100644 --- a/host/lib/usrp/mpmd/CMakeLists.txt +++ b/host/lib/usrp/mpmd/CMakeLists.txt @@ -4,11 +4,11 @@ # SPDX-License-Identifier: GPL-3.0 # -IF(ENABLE_MPMD) - IF(ENABLE_LIBERIO) - MESSAGE(STATUS "Compiling MPMD with liberio support...") - ADD_DEFINITIONS(-DHAVE_LIBERIO) - ENDIF(ENABLE_LIBERIO) +if(ENABLE_MPMD) + if(ENABLE_LIBERIO) + message(STATUS "Compiling MPMD with liberio support...") + add_definitions(-DHAVE_LIBERIO) + endif(ENABLE_LIBERIO) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_find.cpp @@ -21,10 +21,10 @@ IF(ENABLE_MPMD) ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_xport_ctrl_udp.cpp ) - IF(ENABLE_LIBERIO) + if(ENABLE_LIBERIO) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_xport_ctrl_liberio.cpp ) - ENDIF(ENABLE_LIBERIO) + endif(ENABLE_LIBERIO) -ENDIF(ENABLE_MPMD) +endif(ENABLE_MPMD) diff --git a/host/lib/usrp/n230/CMakeLists.txt b/host/lib/usrp/n230/CMakeLists.txt index 9d16067a0..6acb332b8 100644 --- a/host/lib/usrp/n230/CMakeLists.txt +++ b/host/lib/usrp/n230/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the N230 support ######################################################################## -IF(ENABLE_N230) +if(ENABLE_N230) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/n230_cores.cpp ${CMAKE_CURRENT_SOURCE_DIR}/n230_impl.cpp @@ -25,4 +25,4 @@ IF(ENABLE_N230) ${CMAKE_CURRENT_SOURCE_DIR}/n230_image_loader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/n230_fw_ctrl_iface.cpp ) -ENDIF(ENABLE_N230) +endif(ENABLE_N230) diff --git a/host/lib/usrp/usrp1/CMakeLists.txt b/host/lib/usrp/usrp1/CMakeLists.txt index 0c3c94c7b..95b6abb22 100644 --- a/host/lib/usrp/usrp1/CMakeLists.txt +++ b/host/lib/usrp/usrp1/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the USRP1 support ######################################################################## -IF(ENABLE_USRP1) +if(ENABLE_USRP1) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/codec_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dboard_iface.cpp @@ -22,4 +22,4 @@ IF(ENABLE_USRP1) ${CMAKE_CURRENT_SOURCE_DIR}/usrp1_iface.cpp ${CMAKE_CURRENT_SOURCE_DIR}/usrp1_impl.cpp ) -ENDIF(ENABLE_USRP1) +endif(ENABLE_USRP1) diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt index 8e7e186bb..ab9115eca 100644 --- a/host/lib/usrp/usrp2/CMakeLists.txt +++ b/host/lib/usrp/usrp2/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the USRP2 support ######################################################################## -IF(ENABLE_USRP2) +if(ENABLE_USRP2) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/clock_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codec_ctrl.cpp @@ -24,4 +24,4 @@ IF(ENABLE_USRP2) ${CMAKE_CURRENT_SOURCE_DIR}/usrp2_fifo_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/n200_image_loader.cpp ) -ENDIF(ENABLE_USRP2) +endif(ENABLE_USRP2) diff --git a/host/lib/usrp/x300/CMakeLists.txt b/host/lib/usrp/x300/CMakeLists.txt index 08dde87d2..ba1a8678c 100644 --- a/host/lib/usrp/x300/CMakeLists.txt +++ b/host/lib/usrp/x300/CMakeLists.txt @@ -12,7 +12,7 @@ ######################################################################## # Conditionally configure the X300 support ######################################################################## -IF(ENABLE_X300) +if(ENABLE_X300) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/x300_radio_ctrl_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/x300_impl.cpp @@ -28,4 +28,4 @@ IF(ENABLE_X300) ${CMAKE_CURRENT_SOURCE_DIR}/x300_mb_eeprom.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cdecode.c ) -ENDIF(ENABLE_X300) +endif(ENABLE_X300) diff --git a/host/lib/usrp_clock/CMakeLists.txt b/host/lib/usrp_clock/CMakeLists.txt index 1812fcca5..ec6bc1ddc 100644 --- a/host/lib/usrp_clock/CMakeLists.txt +++ b/host/lib/usrp_clock/CMakeLists.txt @@ -13,10 +13,10 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/multi_usrp_clock.cpp ) -IF(ENABLE_C_API) +if(ENABLE_C_API) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/usrp_clock_c.cpp ) -ENDIF(ENABLE_C_API) +endif(ENABLE_C_API) INCLUDE_SUBDIRECTORY(octoclock) diff --git a/host/lib/usrp_clock/octoclock/CMakeLists.txt b/host/lib/usrp_clock/octoclock/CMakeLists.txt index 6a978bd2a..e42a66141 100644 --- a/host/lib/usrp_clock/octoclock/CMakeLists.txt +++ b/host/lib/usrp_clock/octoclock/CMakeLists.txt @@ -8,11 +8,11 @@ ######################################################################## # Conditionally configure the OctoClock support ######################################################################## -IF(ENABLE_OCTOCLOCK) +if(ENABLE_OCTOCLOCK) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/octoclock_eeprom.cpp ${CMAKE_CURRENT_SOURCE_DIR}/octoclock_image_loader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/octoclock_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/octoclock_uart.cpp ) -ENDIF(ENABLE_OCTOCLOCK) +endif(ENABLE_OCTOCLOCK) diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt index f81e0763f..1ecf6b9fe 100644 --- a/host/lib/utils/CMakeLists.txt +++ b/host/lib/utils/CMakeLists.txt @@ -12,9 +12,9 @@ ######################################################################## # Setup defines for process scheduling ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring priority scheduling...") -INCLUDE(CheckCXXSourceCompiles) +message(STATUS "") +message(STATUS "Configuring priority scheduling...") +include(CheckCXXSourceCompiles) CHECK_CXX_SOURCE_COMPILES(" #include <pthread.h> @@ -26,10 +26,10 @@ CHECK_CXX_SOURCE_COMPILES(" " HAVE_PTHREAD_SETSCHEDPARAM ) -IF(CYGWIN) +if(CYGWIN) #SCHED_RR non-operational on cygwin - SET(HAVE_PTHREAD_SETSCHEDPARAM False) -ENDIF(CYGWIN) + set(HAVE_PTHREAD_SETSCHEDPARAM False) +endif(CYGWIN) CHECK_CXX_SOURCE_COMPILES(" #include <windows.h> @@ -43,19 +43,19 @@ CHECK_CXX_SOURCE_COMPILES(" -IF(HAVE_PTHREAD_SETSCHEDPARAM) - MESSAGE(STATUS " Priority scheduling supported through pthread_setschedparam.") - LIST(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM) +if(HAVE_PTHREAD_SETSCHEDPARAM) + message(STATUS " Priority scheduling supported through pthread_setschedparam.") + list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM) LIBUHD_APPEND_LIBS(pthread) -ELSEIF(HAVE_WIN_SETTHREADPRIORITY) - MESSAGE(STATUS " Priority scheduling supported through windows SetThreadPriority.") - SET(THREAD_PRIO_DEFS HAVE_WIN_SETTHREADPRIORITY) -ELSE() - MESSAGE(STATUS " Priority scheduling not supported.") - SET(THREAD_PRIO_DEFS HAVE_THREAD_PRIO_DUMMY) -ENDIF() +elseif(HAVE_WIN_SETTHREADPRIORITY) + message(STATUS " Priority scheduling supported through windows SetThreadPriority.") + set(THREAD_PRIO_DEFS HAVE_WIN_SETTHREADPRIORITY) +else() + message(STATUS " Priority scheduling not supported.") + set(THREAD_PRIO_DEFS HAVE_THREAD_PRIO_DUMMY) +endif() -SET(CMAKE_REQUIRED_LIBRARIES "pthread") +set(CMAKE_REQUIRED_LIBRARIES "pthread") CHECK_CXX_SOURCE_COMPILES(" #include <pthread.h> @@ -68,22 +68,22 @@ CHECK_CXX_SOURCE_COMPILES(" " HAVE_PTHREAD_SETNAME ) -IF(CYGWIN) +if(CYGWIN) #SCHED_RR non-operational on cygwin - SET(HAVE_PTHREAD_SETNAME False) -ENDIF(CYGWIN) + set(HAVE_PTHREAD_SETNAME False) +endif(CYGWIN) -IF(HAVE_PTHREAD_SETNAME) - MESSAGE(STATUS " Setting thread names is supported through pthread_setname_np.") - LIST(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETNAME) +if(HAVE_PTHREAD_SETNAME) + message(STATUS " Setting thread names is supported through pthread_setname_np.") + list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETNAME) LIBUHD_APPEND_LIBS(pthread) -ELSE() - MESSAGE(STATUS " Setting thread names is not supported.") - LIST(APPEND THREAD_PRIO_DEFS HAVE_THREAD_SETNAME_DUMMY) -ENDIF() +else() + message(STATUS " Setting thread names is not supported.") + list(APPEND THREAD_PRIO_DEFS HAVE_THREAD_SETNAME_DUMMY) +endif() -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp PROPERTIES COMPILE_DEFINITIONS "${THREAD_PRIO_DEFS}" ) @@ -91,11 +91,11 @@ SET_SOURCE_FILES_PROPERTIES( ######################################################################## # Setup defines for high resolution timing ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring high resolution timing...") -INCLUDE(CheckCXXSourceCompiles) +message(STATUS "") +message(STATUS "Configuring high resolution timing...") +include(CheckCXXSourceCompiles) -SET(CMAKE_REQUIRED_LIBRARIES -lrt) +set(CMAKE_REQUIRED_LIBRARIES -lrt) CHECK_CXX_SOURCE_COMPILES(" #include <ctime> int main(){ @@ -104,9 +104,9 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_CLOCK_GETTIME ) -SET(CMAKE_REQUIRED_LIBRARIES) +set(CMAKE_REQUIRED_LIBRARIES) -INCLUDE(CheckCXXSourceCompiles) +include(CheckCXXSourceCompiles) CHECK_CXX_SOURCE_COMPILES(" #include <mach/mach_time.h> int main(){ @@ -130,22 +130,22 @@ CHECK_CXX_SOURCE_COMPILES(" ) -IF(HAVE_CLOCK_GETTIME) - MESSAGE(STATUS " High resolution timing supported through clock_gettime.") - SET(SYSTEM_TIME_DEFS HAVE_CLOCK_GETTIME) +if(HAVE_CLOCK_GETTIME) + message(STATUS " High resolution timing supported through clock_gettime.") + set(SYSTEM_TIME_DEFS HAVE_CLOCK_GETTIME) LIBUHD_APPEND_LIBS("-lrt") -ELSEIF(HAVE_MACH_ABSOLUTE_TIME) - MESSAGE(STATUS " High resolution timing supported through mach_absolute_time.") - SET(SYSTEM_TIME_DEFS HAVE_MACH_ABSOLUTE_TIME) -ELSEIF(HAVE_QUERY_PERFORMANCE_COUNTER) - MESSAGE(STATUS " High resolution timing supported through QueryPerformanceCounter.") - SET(SYSTEM_TIME_DEFS HAVE_QUERY_PERFORMANCE_COUNTER) -ELSE() - MESSAGE(STATUS " High resolution timing supported though microsec_clock.") - SET(SYSTEM_TIME_DEFS HAVE_MICROSEC_CLOCK) -ENDIF() - -SET_SOURCE_FILES_PROPERTIES( +elseif(HAVE_MACH_ABSOLUTE_TIME) + message(STATUS " High resolution timing supported through mach_absolute_time.") + set(SYSTEM_TIME_DEFS HAVE_MACH_ABSOLUTE_TIME) +elseif(HAVE_QUERY_PERFORMANCE_COUNTER) + message(STATUS " High resolution timing supported through QueryPerformanceCounter.") + set(SYSTEM_TIME_DEFS HAVE_QUERY_PERFORMANCE_COUNTER) +else() + message(STATUS " High resolution timing supported though microsec_clock.") + set(SYSTEM_TIME_DEFS HAVE_MICROSEC_CLOCK) +endif() + +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/system_time.cpp PROPERTIES COMPILE_DEFINITIONS "${SYSTEM_TIME_DEFS}" ) @@ -153,11 +153,11 @@ SET_SOURCE_FILES_PROPERTIES( ######################################################################## # Setup defines for module loading ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring module loading...") -INCLUDE(CheckCXXSourceCompiles) +message(STATUS "") +message(STATUS "Configuring module loading...") +include(CheckCXXSourceCompiles) -SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) CHECK_CXX_SOURCE_COMPILES(" #include <dlfcn.h> int main(){ @@ -166,7 +166,7 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_DLOPEN ) -SET(CMAKE_REQUIRED_LIBRARIES) +set(CMAKE_REQUIRED_LIBRARIES) CHECK_CXX_SOURCE_COMPILES(" #define WIN32_LEAN_AND_MEAN @@ -178,19 +178,19 @@ CHECK_CXX_SOURCE_COMPILES(" " HAVE_LOAD_LIBRARY ) -IF(HAVE_DLOPEN) - MESSAGE(STATUS " Module loading supported through dlopen.") - SET(LOAD_MODULES_DEFS HAVE_DLOPEN) +if(HAVE_DLOPEN) + message(STATUS " Module loading supported through dlopen.") + set(LOAD_MODULES_DEFS HAVE_DLOPEN) LIBUHD_APPEND_LIBS(${CMAKE_DL_LIBS}) -ELSEIF(HAVE_LOAD_LIBRARY) - MESSAGE(STATUS " Module loading supported through LoadLibrary.") - SET(LOAD_MODULES_DEFS HAVE_LOAD_LIBRARY) -ELSE() - MESSAGE(STATUS " Module loading not supported.") - SET(LOAD_MODULES_DEFS HAVE_LOAD_MODULES_DUMMY) -ENDIF() - -SET_SOURCE_FILES_PROPERTIES( +elseif(HAVE_LOAD_LIBRARY) + message(STATUS " Module loading supported through LoadLibrary.") + set(LOAD_MODULES_DEFS HAVE_LOAD_LIBRARY) +else() + message(STATUS " Module loading not supported.") + set(LOAD_MODULES_DEFS HAVE_LOAD_MODULES_DUMMY) +endif() + +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/load_modules.cpp PROPERTIES COMPILE_DEFINITIONS "${LOAD_MODULES_DEFS}" ) @@ -198,17 +198,17 @@ SET_SOURCE_FILES_PROPERTIES( ######################################################################## # Define UHD_PKG_DATA_PATH for paths.cpp ######################################################################## -FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH) -STRING(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}") +file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH) +string(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}") -STRING(REGEX MATCH ".*/.*" SLASH "${LIB_SUFFIX}") -IF(SLASH STREQUAL "") - SET(UHD_LIB_DIR "lib${LIB_SUFFIX}") -ELSE() - SET(UHD_LIB_DIR "lib") -ENDIF(SLASH STREQUAL "") +string(REGEX MATCH ".*/.*" SLASH "${LIB_SUFFIX}") +if(SLASH STREQUAL "") + set(UHD_LIB_DIR "lib${LIB_SUFFIX}") +else() + set(UHD_LIB_DIR "lib") +endif(SLASH STREQUAL "") -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp ${CMAKE_CURRENT_SOURCE_DIR}/images.cpp PROPERTIES COMPILE_DEFINITIONS @@ -237,9 +237,9 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp ) -IF(ENABLE_C_API) +if(ENABLE_C_API) LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/log_c.cpp ${CMAKE_CURRENT_SOURCE_DIR}/thread_priority_c.cpp ) -ENDIF(ENABLE_C_API) +endif(ENABLE_C_API) |