diff options
author | Josh Blum | 2011-10-08 17:11:12 -0700 |
---|---|---|
committer | Josh Blum | 2011-10-08 17:11:12 -0700 |
commit | 71c0f14a46f85027b95f2f5f6d3d219cc9e3783e (patch) | |
tree | 046d89555243ede65bfc7bc0a6cbfc7f870ff4cb | |
parent | 63b87bf4e6e9a2f1112c17c57796b69b3b8a2b3e (diff) | |
download | gnuradio-71c0f14a46f85027b95f2f5f6d3d219cc9e3783e.tar.gz gnuradio-71c0f14a46f85027b95f2f5f6d3d219cc9e3783e.tar.bz2 gnuradio-71c0f14a46f85027b95f2f5f6d3d219cc9e3783e.zip |
gr: the CMakeLists.txt took a chill pill
118 files changed, 1846 insertions, 1846 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ddd51f8d7..a74ff4c90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,115 +18,115 @@ # Boston, MA 02110-1301, USA. ######################################################################## -IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - MESSAGE(FATAL_ERROR "Prevented in-tree built. This is bad practice.") -ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "Prevented in-tree built. This is bad practice.") +endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) ######################################################################## # Project setup ######################################################################## -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(gnuradio CXX C) -ENABLE_TESTING() +cmake_minimum_required(VERSION 2.6) +project(gnuradio CXX C) +enable_testing() #select the release build type by default to get optimization flags -IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Release") - MESSAGE(STATUS "Build type not specified: defaulting to release.") -ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + message(STATUS "Build type not specified: defaulting to release.") +endif(NOT CMAKE_BUILD_TYPE) +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) -INCLUDE(GrVersion) #setup version info +include(GrVersion) #setup version info ######################################################################## # Import executables from a native build (for cross compiling) # http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build ######################################################################## -IF(IMPORT_EXECUTABLES) - INCLUDE(${IMPORT_EXECUTABLES}) -ENDIF(IMPORT_EXECUTABLES) +if(IMPORT_EXECUTABLES) + include(${IMPORT_EXECUTABLES}) +endif(IMPORT_EXECUTABLES) #set file that the native build will fill with exports -SET(EXPORT_FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake) -FILE(WRITE ${EXPORT_FILE}) #blank the file (subdirs will append) +set(EXPORT_FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake) +file(WRITE ${EXPORT_FILE}) #blank the file (subdirs will append) ######################################################################## # Compiler specific setup ######################################################################## -IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) #http://gcc.gnu.org/wiki/Visibility - ADD_DEFINITIONS(-fvisibility=hidden) -ENDIF() - -IF(CMAKE_COMPILER_IS_GNUCXX) - ADD_DEFINITIONS(-Wsign-compare) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -IF(MSVC) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/cmake/msvc) #missing headers - ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp - ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max - ADD_DEFINITIONS( #stop all kinds of compatibility warnings + add_definitions(-fvisibility=hidden) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX) + add_definitions(-Wsign-compare) +endif(CMAKE_COMPILER_IS_GNUCXX) + +if(MSVC) + include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc) #missing headers + add_definitions(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp + add_definitions(-DNOMINMAX) #disables stupidity and enables std::min and std::max + add_definitions( #stop all kinds of compatibility warnings -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE ) - ADD_DEFINITIONS(-DHAVE_CONFIG_H) - ADD_DEFINITIONS(/MP) #build with multiple processors -ENDIF(MSVC) + add_definitions(-DHAVE_CONFIG_H) + add_definitions(/MP) #build with multiple processors +endif(MSVC) ######################################################################## # Install directories ######################################################################## -INCLUDE(GrPlatform) #define LIB_SUFFIX -SET(GR_RUNTIME_DIR bin) -SET(GR_LIBRARY_DIR lib${LIB_SUFFIX}) -SET(GR_INCLUDE_DIR include) -SET(GR_DATA_DIR share) -SET(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) -SET(GR_DOC_DIR ${GR_DATA_DIR}/doc) -SET(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}-${LIBVER}) -SET(GR_CONF_DIR etc) -SET(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}) -SET(GR_LIBEXEC_DIR libexec) -SET(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) -SET(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) +include(GrPlatform) #define LIB_SUFFIX +set(GR_RUNTIME_DIR bin) +set(GR_LIBRARY_DIR lib${LIB_SUFFIX}) +set(GR_INCLUDE_DIR include) +set(GR_DATA_DIR share) +set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) +set(GR_DOC_DIR ${GR_DATA_DIR}/doc) +set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}-${LIBVER}) +set(GR_CONF_DIR etc) +set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}) +set(GR_LIBEXEC_DIR libexec) +set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) +set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Variables replaced when configuring the package config files ######################################################################## -FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" prefix) -FILE(TO_NATIVE_PATH "\${prefix}" exec_prefix) -FILE(TO_NATIVE_PATH "\${exec_prefix}/${GR_LIBRARY_DIR}" libdir) -FILE(TO_NATIVE_PATH "\${prefix}/${GR_INCLUDE_DIR}" includedir) +file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" prefix) +file(TO_NATIVE_PATH "\${prefix}" exec_prefix) +file(TO_NATIVE_PATH "\${exec_prefix}/${GR_LIBRARY_DIR}" libdir) +file(TO_NATIVE_PATH "\${prefix}/${GR_INCLUDE_DIR}" includedir) ######################################################################## # Create uninstall target ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -ADD_CUSTOM_TARGET(uninstall +add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake ) ######################################################################## # Enable python component ######################################################################## -FIND_PACKAGE(PythonLibs) -FIND_PACKAGE(SWIG) -INCLUDE(GrComponent) +find_package(PythonLibs) +find_package(SWIG) +include(GrComponent) GR_REGISTER_COMPONENT("python-support" ENABLE_PYTHON PYTHONLIBS_FOUND SWIG_FOUND ) -FIND_PACKAGE(CppUnit) +find_package(CppUnit) GR_REGISTER_COMPONENT("testing-support" ENABLE_TESTING CPPUNIT_FOUND ) @@ -134,38 +134,38 @@ GR_REGISTER_COMPONENT("testing-support" ENABLE_TESTING ######################################################################## # Add optional dlls specified in DLL_PATHS ######################################################################## -FOREACH(path ${DLL_PATHS}) - FILE(GLOB _dlls "${path}/*.dll") - LIST(APPEND ALL_DLL_FILES ${_dlls}) -ENDFOREACH(path) -IF(DEFINED ALL_DLL_FILES) - INCLUDE(GrPackage) +foreach(path ${DLL_PATHS}) + file(GLOB _dlls "${path}/*.dll") + list(APPEND ALL_DLL_FILES ${_dlls}) +endforeach(path) +if(DEFINED ALL_DLL_FILES) + include(GrPackage) CPACK_COMPONENT("extra_dlls" DISPLAY_NAME "Extra DLLs" DESCRIPTION "Extra DLLs for runtime dependency requirements" ) - MESSAGE(STATUS "") - MESSAGE(STATUS "Including the following dlls into the install:") - FOREACH(_dll ${ALL_DLL_FILES}) - MESSAGE(STATUS " ${_dll}") - ENDFOREACH(_dll) - INSTALL(FILES ${ALL_DLL_FILES} DESTINATION ${GR_RUNTIME_DIR} COMPONENT "extra_dlls") -ENDIF() + message(STATUS "") + message(STATUS "Including the following dlls into the install:") + foreach(_dll ${ALL_DLL_FILES}) + message(STATUS " ${_dll}") + endforeach(_dll) + install(FILES ${ALL_DLL_FILES} DESTINATION ${GR_RUNTIME_DIR} COMPONENT "extra_dlls") +endif() ######################################################################## # Setup volk as a subproject ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("volk" ENABLE_VOLK) -SET(VOLK_INCLUDE_DIRS +set(VOLK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/volk/include ${CMAKE_CURRENT_BINARY_DIR}/volk/include ) -IF(ENABLE_VOLK) +if(ENABLE_VOLK) -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_VOLK_DESCRIPTION "Vector optimized library of kernels") CPACK_COMPONENT("volk_runtime" @@ -181,37 +181,37 @@ CPACK_COMPONENT("volk_devel" ) -ADD_SUBDIRECTORY(volk) -ENDIF(ENABLE_VOLK) +add_subdirectory(volk) +endif(ENABLE_VOLK) ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(gruel) -ADD_SUBDIRECTORY(gnuradio-core) -ADD_SUBDIRECTORY(grc) -ADD_SUBDIRECTORY(docs) - -ADD_SUBDIRECTORY(gr-atsc) -ADD_SUBDIRECTORY(gr-audio) -ADD_SUBDIRECTORY(gr-comedi) -ADD_SUBDIRECTORY(gr-digital) -ADD_SUBDIRECTORY(gr-noaa) -ADD_SUBDIRECTORY(gr-pager) -ADD_SUBDIRECTORY(gr-qtgui) -ADD_SUBDIRECTORY(gr-trellis) -ADD_SUBDIRECTORY(gr-uhd) -ADD_SUBDIRECTORY(gr-video-sdl) -ADD_SUBDIRECTORY(gr-vocoder) -ADD_SUBDIRECTORY(gr-wxgui) +add_subdirectory(gruel) +add_subdirectory(gnuradio-core) +add_subdirectory(grc) +add_subdirectory(docs) + +add_subdirectory(gr-atsc) +add_subdirectory(gr-audio) +add_subdirectory(gr-comedi) +add_subdirectory(gr-digital) +add_subdirectory(gr-noaa) +add_subdirectory(gr-pager) +add_subdirectory(gr-qtgui) +add_subdirectory(gr-trellis) +add_subdirectory(gr-uhd) +add_subdirectory(gr-video-sdl) +add_subdirectory(gr-vocoder) +add_subdirectory(gr-wxgui) #finalize cpack after subdirs processed -INCLUDE(GrPackage) +include(GrPackage) CPACK_FINALIZE() ######################################################################## # Print summary ######################################################################## GR_PRINT_COMPONENT_SUMMARY() -MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") -MESSAGE(STATUS "Building for version: ${VERSION}") +message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Building for version: ${VERSION}") diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake index 4e515152d..36890014d 100644 --- a/cmake/Modules/GrBoost.cmake +++ b/cmake/Modules/GrBoost.cmake @@ -17,16 +17,16 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_BOOST_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_BOOST_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_BOOST_CMAKE) + return() +endif() +set(__INCLUDED_GR_BOOST_CMAKE TRUE) ######################################################################## # Setup Boost and handle some system specific things ######################################################################## -SET(BOOST_REQUIRED_COMPONENTS +set(BOOST_REQUIRED_COMPONENTS date_time program_options filesystem @@ -34,23 +34,23 @@ SET(BOOST_REQUIRED_COMPONENTS thread ) -IF(UNIX AND EXISTS "/usr/lib64") - LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix -ENDIF(UNIX AND EXISTS "/usr/lib64") +if(UNIX AND EXISTS "/usr/lib64") + list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix +endif(UNIX AND EXISTS "/usr/lib64") -IF(MSVC) - IF (NOT DEFINED BOOST_ALL_DYN_LINK) - SET(BOOST_ALL_DYN_LINK TRUE) - ENDIF() - SET(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") - IF(BOOST_ALL_DYN_LINK) - ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - ELSE(BOOST_ALL_DYN_LINK) - UNSET(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - ENDIF(BOOST_ALL_DYN_LINK) -ENDIF(MSVC) +if(MSVC) + if (NOT DEFINED BOOST_ALL_DYN_LINK) + set(BOOST_ALL_DYN_LINK TRUE) + endif() + set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") + if(BOOST_ALL_DYN_LINK) + add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc + else(BOOST_ALL_DYN_LINK) + unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link + endif(BOOST_ALL_DYN_LINK) +endif(MSVC) -SET(Boost_ADDITIONAL_VERSIONS +set(Boost_ADDITIONAL_VERSIONS "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49" @@ -59,4 +59,4 @@ SET(Boost_ADDITIONAL_VERSIONS "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" ) -FIND_PACKAGE(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) +find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) diff --git a/cmake/Modules/GrComponent.cmake b/cmake/Modules/GrComponent.cmake index cbae1c4ff..876ec0baa 100644 --- a/cmake/Modules/GrComponent.cmake +++ b/cmake/Modules/GrComponent.cmake @@ -17,20 +17,20 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_COMPONENT_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_COMPONENT_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_COMPONENT_CMAKE) + return() +endif() +set(__INCLUDED_GR_COMPONENT_CMAKE TRUE) -SET(_gr_enabled_components "" CACHE INTERNAL "" FORCE) -SET(_gr_disabled_components "" CACHE INTERNAL "" FORCE) +set(_gr_enabled_components "" CACHE INTERNAL "" FORCE) +set(_gr_disabled_components "" CACHE INTERNAL "" FORCE) -IF(NOT DEFINED ENABLE_DEFAULT) - SET(ENABLE_DEFAULT ON) - MESSAGE(STATUS "") - MESSAGE(STATUS "The build system will automatically enable all components.") - MESSAGE(STATUS "Use -DENABLE_DEFAULT=OFF to disable components by default.") -ENDIF() +if(NOT DEFINED ENABLE_DEFAULT) + set(ENABLE_DEFAULT ON) + message(STATUS "") + message(STATUS "The build system will automatically enable all components.") + message(STATUS "Use -DENABLE_DEFAULT=OFF to disable components by default.") +endif() ######################################################################## # Register a component into the system @@ -38,52 +38,52 @@ ENDIF() # - var: variable for enabled status # - argn: list of dependencies ######################################################################## -FUNCTION(GR_REGISTER_COMPONENT name var) - INCLUDE(CMakeDependentOption) - MESSAGE(STATUS "") - MESSAGE(STATUS "Configuring ${name} support...") - FOREACH(dep ${ARGN}) - MESSAGE(STATUS " Dependency ${dep} = ${${dep}}") - ENDFOREACH(dep) +function(GR_REGISTER_COMPONENT name var) + include(CMakeDependentOption) + message(STATUS "") + message(STATUS "Configuring ${name} support...") + foreach(dep ${ARGN}) + message(STATUS " Dependency ${dep} = ${${dep}}") + endforeach(dep) #setup the dependent option for this component CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${ENABLE_DEFAULT} "${ARGN}" OFF) - SET(${var}_ "${${var}}" CACHE INTERNAL "" FORCE) + set(${var}_ "${${var}}" CACHE INTERNAL "" FORCE) #append the component into one of the lists - IF(${var}) - MESSAGE(STATUS " Enabling ${name} support.") - LIST(APPEND _gr_enabled_components ${name}) - ELSE(${var}) - MESSAGE(STATUS " Disabling ${name} support.") - LIST(APPEND _gr_disabled_components ${name}) - ENDIF(${var}) - MESSAGE(STATUS " Override with -D${var}=ON/OFF") + if(${var}) + message(STATUS " Enabling ${name} support.") + list(APPEND _gr_enabled_components ${name}) + else(${var}) + message(STATUS " Disabling ${name} support.") + list(APPEND _gr_disabled_components ${name}) + endif(${var}) + message(STATUS " Override with -D${var}=ON/OFF") #make components lists into global variables - SET(_gr_enabled_components ${_gr_enabled_components} CACHE INTERNAL "" FORCE) - SET(_gr_disabled_components ${_gr_disabled_components} CACHE INTERNAL "" FORCE) -ENDFUNCTION(GR_REGISTER_COMPONENT) + set(_gr_enabled_components ${_gr_enabled_components} CACHE INTERNAL "" FORCE) + set(_gr_disabled_components ${_gr_disabled_components} CACHE INTERNAL "" FORCE) +endfunction(GR_REGISTER_COMPONENT) ######################################################################## # Print the registered component summary ######################################################################## -FUNCTION(GR_PRINT_COMPONENT_SUMMARY) - MESSAGE(STATUS "") - MESSAGE(STATUS "######################################################") - MESSAGE(STATUS "# Gnuradio enabled components ") - MESSAGE(STATUS "######################################################") - FOREACH(comp ${_gr_enabled_components}) - MESSAGE(STATUS " * ${comp}") - ENDFOREACH(comp) +function(GR_PRINT_COMPONENT_SUMMARY) + message(STATUS "") + message(STATUS "######################################################") + message(STATUS "# Gnuradio enabled components ") + message(STATUS "######################################################") + foreach(comp ${_gr_enabled_components}) + message(STATUS " * ${comp}") + endforeach(comp) - MESSAGE(STATUS "") - MESSAGE(STATUS "######################################################") - MESSAGE(STATUS "# Gnuradio disabled components ") - MESSAGE(STATUS "######################################################") - FOREACH(comp ${_gr_disabled_components}) - MESSAGE(STATUS " * ${comp}") - ENDFOREACH(comp) + message(STATUS "") + message(STATUS "######################################################") + message(STATUS "# Gnuradio disabled components ") + message(STATUS "######################################################") + foreach(comp ${_gr_disabled_components}) + message(STATUS " * ${comp}") + endforeach(comp) - MESSAGE(STATUS "") -ENDFUNCTION(GR_PRINT_COMPONENT_SUMMARY) + message(STATUS "") +endfunction(GR_PRINT_COMPONENT_SUMMARY) diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake index c36c509b5..871861e35 100644 --- a/cmake/Modules/GrMiscUtils.cmake +++ b/cmake/Modules/GrMiscUtils.cmake @@ -17,40 +17,40 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE) + return() +endif() +set(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE) ######################################################################## # Set global variable macro. # Used for subdirectories to export settings. # Example: include and library paths. ######################################################################## -FUNCTION(GR_SET_GLOBAL var) - SET(${var} ${ARGN} CACHE INTERNAL "" FORCE) -ENDFUNCTION(GR_SET_GLOBAL) +function(GR_SET_GLOBAL var) + set(${var} ${ARGN} CACHE INTERNAL "" FORCE) +endfunction(GR_SET_GLOBAL) ######################################################################## # Set the pre-processor definition if the condition is true. # - def the pre-processor definition to set and condition name ######################################################################## -FUNCTION(GR_ADD_COND_DEF def) - IF(${def}) - ADD_DEFINITIONS(-D${def}) - ENDIF(${def}) -ENDFUNCTION(GR_ADD_COND_DEF) +function(GR_ADD_COND_DEF def) + if(${def}) + add_definitions(-D${def}) + endif(${def}) +endfunction(GR_ADD_COND_DEF) ######################################################################## # Check for a header and conditionally set a compile define. # - hdr the relative path to the header file # - def the pre-processor definition to set ######################################################################## -FUNCTION(GR_CHECK_HDR_N_DEF hdr def) - INCLUDE(CheckIncludeFileCXX) +function(GR_CHECK_HDR_N_DEF hdr def) + include(CheckIncludeFileCXX) CHECK_INCLUDE_FILE_CXX(${hdr} ${def}) GR_ADD_COND_DEF(${def}) -ENDFUNCTION(GR_CHECK_HDR_N_DEF) +endfunction(GR_CHECK_HDR_N_DEF) ######################################################################## # Include subdirectory macro. @@ -63,24 +63,24 @@ ENDFUNCTION(GR_CHECK_HDR_N_DEF) # This provides a work-around for the lack of convenience libraries. # This way a subdirectory can append to the list of library sources. ######################################################################## -MACRO(GR_INCLUDE_SUBDIRECTORY subdir) +macro(GR_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(GR_INCLUDE_SUBDIRECTORY) + list(REMOVE_AT _cmake_source_dirs 0) + list(REMOVE_AT _cmake_binary_dirs 0) +endmacro(GR_INCLUDE_SUBDIRECTORY) diff --git a/cmake/Modules/GrPackage.cmake b/cmake/Modules/GrPackage.cmake index 2fc9fc08a..857d07c4d 100644 --- a/cmake/Modules/GrPackage.cmake +++ b/cmake/Modules/GrPackage.cmake @@ -17,49 +17,49 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_PACKAGE_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_PACKAGE_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_PACKAGE_CMAKE) + return() +endif() +set(__INCLUDED_GR_PACKAGE_CMAKE TRUE) -INCLUDE(GrVersion) #sets version information -INCLUDE(GrPlatform) #sets platform information +include(GrVersion) #sets version information +include(GrPlatform) #sets platform information #set the cpack generator based on the platform type -IF(CPACK_GENERATOR) +if(CPACK_GENERATOR) #already set by user -ELSEIF(APPLE) - SET(CPACK_GENERATOR PackageMaker) -ELSEIF(WIN32) - SET(CPACK_GENERATOR NSIS) -ELSEIF(DEBIAN) - SET(CPACK_GENERATOR DEB) -ELSEIF(REDHAT) - SET(CPACK_GENERATOR RPM) -ELSE() - SET(CPACK_GENERATOR TGZ) -ENDIF() +elseif(APPLE) + set(CPACK_GENERATOR PackageMaker) +elseif(WIN32) + set(CPACK_GENERATOR NSIS) +elseif(DEBIAN) + set(CPACK_GENERATOR DEB) +elseif(REDHAT) + set(CPACK_GENERATOR RPM) +else() + set(CPACK_GENERATOR TGZ) +endif() ######################################################################## # CPACK_SET - set a global variable and record the variable name ######################################################################## -FUNCTION(CPACK_SET var) - SET(${var} ${ARGN} CACHE INTERNAL "") - LIST(APPEND _cpack_vars ${var}) - LIST(REMOVE_DUPLICATES _cpack_vars) - SET(_cpack_vars ${_cpack_vars} CACHE INTERNAL "") -ENDFUNCTION(CPACK_SET) +function(CPACK_SET var) + set(${var} ${ARGN} CACHE INTERNAL "") + list(APPEND _cpack_vars ${var}) + list(REMOVE_DUPLICATES _cpack_vars) + set(_cpack_vars ${_cpack_vars} CACHE INTERNAL "") +endfunction(CPACK_SET) ######################################################################## # CPACK_FINALIZE - include cpack and the unset all the cpack variables ######################################################################## -FUNCTION(CPACK_FINALIZE) - INCLUDE(CPack) #finalize the cpack settings configured throughout the build system - FOREACH(var ${_cpack_vars}) - UNSET(${var} CACHE) - ENDFOREACH(var) - UNSET(_cpack_vars CACHE) -ENDFUNCTION(CPACK_FINALIZE) +function(CPACK_FINALIZE) + include(CPack) #finalize the cpack settings configured throughout the build system + foreach(var ${_cpack_vars}) + unset(${var} CACHE) + endforeach(var) + unset(_cpack_vars CACHE) +endfunction(CPACK_FINALIZE) ######################################################################## # CPACK_COMPONENT - convenience function to create a cpack component @@ -72,40 +72,40 @@ ENDFUNCTION(CPACK_FINALIZE) # [DEPENDS depends] # ) ######################################################################## -FUNCTION(CPACK_COMPONENT name) - INCLUDE(CMakeParseArgumentsCopy) - SET(_options GROUP DISPLAY_NAME DESCRIPTION DEPENDS) +function(CPACK_COMPONENT name) + include(CMakeParseArgumentsCopy) + set(_options GROUP DISPLAY_NAME DESCRIPTION DEPENDS) CMAKE_PARSE_ARGUMENTS(CPACK_COMPONENT "" "${_options}" "" ${ARGN}) - STRING(TOUPPER "${name}" name_upper) - FOREACH(_option ${_options}) - IF(CPACK_COMPONENT_${_option}) + string(TOUPPER "${name}" name_upper) + foreach(_option ${_options}) + if(CPACK_COMPONENT_${_option}) CPACK_SET(CPACK_COMPONENT_${name_upper}_${_option} "${CPACK_COMPONENT_${_option}}") - ENDIF() - ENDFOREACH(_option) + endif() + endforeach(_option) CPACK_SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL};${name}") -ENDFUNCTION(CPACK_COMPONENT) +endfunction(CPACK_COMPONENT) ######################################################################## # Setup CPack ######################################################################## -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GNU Radio") -SET(CPACK_PACKAGE_VENDOR "Free Software Foundation, Inc.") -SET(CPACK_PACKAGE_CONTACT "Discuss-gnuradio@gnu.org") -SET(CPACK_PACKAGE_VERSION ${VERSION}) -SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/README) -SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README) -SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README) -IF(${CPACK_GENERATOR} STREQUAL NSIS) - SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}") -ENDIF() +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GNU Radio") +set(CPACK_PACKAGE_VENDOR "Free Software Foundation, Inc.") +set(CPACK_PACKAGE_CONTACT "Discuss-gnuradio@gnu.org") +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/README) +set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README) +set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README) +if(${CPACK_GENERATOR} STREQUAL NSIS) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}") +endif() ######################################################################## # DEB package specific ######################################################################## -SET(CPACK_DEBIAN_PACKAGE_DEPENDS +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-all-dev" "libfftw3-3" "python" @@ -118,17 +118,17 @@ SET(CPACK_DEBIAN_PACKAGE_DEPENDS "python-lxml" "python-Cheetah" ) -STRING(REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}") -SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_SOURCE_DIR}/debian/postinst ${CMAKE_SOURCE_DIR}/debian/prerm) +string(REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}") +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_SOURCE_DIR}/debian/postinst ${CMAKE_SOURCE_DIR}/debian/prerm) ######################################################################## # RPM package specific ######################################################################## -SET(CPACK_RPM_PACKAGE_REQUIRES "boost-devel") #TODO other packages +set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel") #TODO other packages ######################################################################## # NSIS package specific ######################################################################## -SET(CPACK_NSIS_MODIFY_PATH ON) +set(CPACK_NSIS_MODIFY_PATH ON) -SET(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"") +set(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"") diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake index 85f318618..ce2e15fef 100644 --- a/cmake/Modules/GrPlatform.cmake +++ b/cmake/Modules/GrPlatform.cmake @@ -17,30 +17,30 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_PLATFORM_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) + return() +endif() +set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) ######################################################################## # Setup additional defines for OS types ######################################################################## -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - SET(LINUX TRUE) -ENDIF() +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(LINUX TRUE) +endif() -IF(LINUX AND EXISTS "/etc/debian_version") - SET(DEBIAN TRUE) -ENDIF() +if(LINUX AND EXISTS "/etc/debian_version") + set(DEBIAN TRUE) +endif() -IF(LINUX AND EXISTS "/etc/redhat-release") - SET(REDHAT TRUE) -ENDIF() +if(LINUX AND EXISTS "/etc/redhat-release") + set(REDHAT TRUE) +endif() ######################################################################## # when the library suffix should be 64 (applies to redhat linux family) ######################################################################## -IF(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") - SET(LIB_SUFFIX 64) -ENDIF() -SET(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") +if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") + set(LIB_SUFFIX 64) +endif() +set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index b33c2fe62..51cd4bfb0 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_PYTHON_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_PYTHON_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_PYTHON_CMAKE) + return() +endif() +set(__INCLUDED_GR_PYTHON_CMAKE TRUE) ######################################################################## # Setup the python interpreter: @@ -28,40 +28,40 @@ SET(__INCLUDED_GR_PYTHON_CMAKE TRUE) # or finds the interpreter via the built-in cmake module. ######################################################################## #this allows the user to override PYTHON_EXECUTABLE -IF(PYTHON_EXECUTABLE) +if(PYTHON_EXECUTABLE) - SET(PYTHONINTERP_FOUND TRUE) + set(PYTHONINTERP_FOUND TRUE) #otherwise if not set, try to automatically find it -ELSE(PYTHON_EXECUTABLE) +else(PYTHON_EXECUTABLE) #use the built-in find script - FIND_PACKAGE(PythonInterp) + find_package(PythonInterp) #and if that fails use the find program routine - IF(NOT PYTHONINTERP_FOUND) - FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python python2.7 python2.6 python2.5) - IF(PYTHON_EXECUTABLE) - SET(PYTHONINTERP_FOUND TRUE) - ENDIF(PYTHON_EXECUTABLE) - ENDIF(NOT PYTHONINTERP_FOUND) + if(NOT PYTHONINTERP_FOUND) + find_program(PYTHON_EXECUTABLE NAMES python python2.7 python2.6 python2.5) + if(PYTHON_EXECUTABLE) + set(PYTHONINTERP_FOUND TRUE) + endif(PYTHON_EXECUTABLE) + endif(NOT PYTHONINTERP_FOUND) -ENDIF(PYTHON_EXECUTABLE) +endif(PYTHON_EXECUTABLE) #make the path to the executable appear in the cmake gui -SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") +set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") #make sure we can use -B with python (introduced in 2.6) -IF(PYTHON_EXECUTABLE) - EXECUTE_PROCESS( +if(PYTHON_EXECUTABLE) + execute_process( COMMAND ${PYTHON_EXECUTABLE} -B -c "" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT ) - IF(PYTHON_HAS_DASH_B_RESULT EQUAL 0) - SET(PYTHON_DASH_B "-B") - ENDIF() -ENDIF(PYTHON_EXECUTABLE) + if(PYTHON_HAS_DASH_B_RESULT EQUAL 0) + set(PYTHON_DASH_B "-B") + endif() +endif(PYTHON_EXECUTABLE) ######################################################################## # Check for the existence of a python module: @@ -70,10 +70,10 @@ ENDIF(PYTHON_EXECUTABLE) # - cmd an additional command to run # - have the result variable to set ######################################################################## -MACRO(GR_PYTHON_CHECK_MODULE desc mod cmd have) - MESSAGE(STATUS "") - MESSAGE(STATUS "Python checking for ${desc}") - EXECUTE_PROCESS( +macro(GR_PYTHON_CHECK_MODULE desc mod cmd have) + message(STATUS "") + message(STATUS "Python checking for ${desc}") + execute_process( COMMAND ${PYTHON_EXECUTABLE} -c " ######################################### try: import ${mod} @@ -83,87 +83,87 @@ except: exit(-1) #########################################" RESULT_VARIABLE ${have} ) - IF(${have} EQUAL 0) - MESSAGE(STATUS "Python checking for ${desc} - found") - SET(${have} TRUE) - ELSE(${have} EQUAL 0) - MESSAGE(STATUS "Python checking for ${desc} - not found") - SET(${have} FALSE) - ENDIF(${have} EQUAL 0) -ENDMACRO(GR_PYTHON_CHECK_MODULE) + if(${have} EQUAL 0) + message(STATUS "Python checking for ${desc} - found") + set(${have} TRUE) + else(${have} EQUAL 0) + message(STATUS "Python checking for ${desc} - not found") + set(${have} FALSE) + endif(${have} EQUAL 0) +endmacro(GR_PYTHON_CHECK_MODULE) ######################################################################## # Sets the python installation directory GR_PYTHON_DIR ######################################################################## -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " from distutils import sysconfig print sysconfig.get_python_lib(plat_specific=True, prefix='') " OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) -FILE(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) +file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) ######################################################################## # Create an always-built target with a unique name # Usage: GR_UNIQUE_TARGET(<description> <dependencies list>) ######################################################################## -FUNCTION(GR_UNIQUE_TARGET desc) - FILE(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib +function(GR_UNIQUE_TARGET desc) + file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) - ADD_CUSTOM_TARGET(${_target} ALL DEPENDS ${ARGN}) -ENDFUNCTION(GR_UNIQUE_TARGET) + add_custom_target(${_target} ALL DEPENDS ${ARGN}) +endfunction(GR_UNIQUE_TARGET) ######################################################################## # Install python sources (also builds and installs byte-compiled python) ######################################################################## -FUNCTION(GR_PYTHON_INSTALL) - INCLUDE(CMakeParseArgumentsCopy) +function(GR_PYTHON_INSTALL) + include(CMakeParseArgumentsCopy) CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) #################################################################### - IF(GR_PYTHON_INSTALL_FILES) + if(GR_PYTHON_INSTALL_FILES) #################################################################### - INSTALL(${ARGN}) #installs regular python files + install(${ARGN}) #installs regular python files - FOREACH(pyfile ${GR_PYTHON_INSTALL_FILES}) - GET_FILENAME_COMPONENT(pyfile_name ${pyfile} NAME) - GET_FILENAME_COMPONENT(pyfile ${pyfile} ABSOLUTE) - STRING(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pycfile "${pyfile}c") - LIST(APPEND python_install_gen_targets ${pycfile}) + foreach(pyfile ${GR_PYTHON_INSTALL_FILES}) + get_filename_component(pyfile_name ${pyfile} NAME) + get_filename_component(pyfile ${pyfile} ABSOLUTE) + string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pycfile "${pyfile}c") + list(APPEND python_install_gen_targets ${pycfile}) - GET_FILENAME_COMPONENT(pycfile_path ${pycfile} PATH) - FILE(MAKE_DIRECTORY ${pycfile_path}) + get_filename_component(pycfile_path ${pycfile} PATH) + file(MAKE_DIRECTORY ${pycfile_path}) #create a command to generate the byte-compiled pyc file - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${pycfile} DEPENDS ${pyfile} COMMAND ${PYTHON_EXECUTABLE} -c \"import py_compile\; py_compile.compile(file='${pyfile}', cfile='${pycfile}', doraise=True)\" COMMENT "Byte-compiling ${pyfile_name}" ) - INSTALL(FILES ${pycfile} + install(FILES ${pycfile} DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} ) - ENDFOREACH(pyfile) + endforeach(pyfile) #################################################################### - ELSEIF(GR_PYTHON_INSTALL_PROGRAMS) + elseif(GR_PYTHON_INSTALL_PROGRAMS) #################################################################### - FILE(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) + file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) - FOREACH(pyfile ${GR_PYTHON_INSTALL_PROGRAMS}) - GET_FILENAME_COMPONENT(pyfile_name ${pyfile} NAME) - GET_FILENAME_COMPONENT(pyfile ${pyfile} ABSOLUTE) - STRING(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") - LIST(APPEND python_install_gen_targets ${pyexefile}) + foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS}) + get_filename_component(pyfile_name ${pyfile} NAME) + get_filename_component(pyfile ${pyfile} ABSOLUTE) + string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") + list(APPEND python_install_gen_targets ${pyexefile}) - GET_FILENAME_COMPONENT(pyexefile_path ${pyexefile} PATH) - FILE(MAKE_DIRECTORY ${pyexefile_path}) + get_filename_component(pyexefile_path ${pyexefile} PATH) + file(MAKE_DIRECTORY ${pyexefile_path}) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${pyexefile} DEPENDS ${pyfile} COMMAND ${PYTHON_EXECUTABLE} -c \"open('${pyexefile}', 'w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())\" @@ -171,19 +171,19 @@ FUNCTION(GR_PYTHON_INSTALL) ) #on windows, python files need an extension to execute - GET_FILENAME_COMPONENT(pyfile_ext ${pyfile} EXT) - IF(WIN32 AND NOT pyfile_ext) - SET(pyfile_name "${pyfile_name}.py") - ENDIF() + get_filename_component(pyfile_ext ${pyfile} EXT) + if(WIN32 AND NOT pyfile_ext) + set(pyfile_name "${pyfile_name}.py") + endif() - INSTALL(PROGRAMS ${pyexefile} RENAME ${pyfile_name} + install(PROGRAMS ${pyexefile} RENAME ${pyfile_name} DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} ) - ENDFOREACH(pyfile) + endforeach(pyfile) - ENDIF() + endif() GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) -ENDFUNCTION(GR_PYTHON_INSTALL) +endfunction(GR_PYTHON_INSTALL) diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index 0d4cce2b3..0fa1c7b77 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -17,12 +17,12 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_SWIG_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_SWIG_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_SWIG_CMAKE) + return() +endif() +set(__INCLUDED_GR_SWIG_CMAKE TRUE) -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Build a swig target for the common gnuradio use case. Usage: @@ -35,11 +35,11 @@ INCLUDE(GrPython) # - GR_SWIG_SOURCE_DEPS # - GR_SWIG_TARGET_DEPS ######################################################################## -MACRO(GR_SWIG_MAKE name) - SET(ifiles ${ARGN}) +macro(GR_SWIG_MAKE name) + set(ifiles ${ARGN}) #determine include dependencies for swig file - EXECUTE_PROCESS( + execute_process( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/get_swig_deps.py "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}" OUTPUT_STRIP_TRAILING_WHITESPACE @@ -48,30 +48,30 @@ MACRO(GR_SWIG_MAKE name) ) #append the specified include directories - INCLUDE_DIRECTORIES(${GR_SWIG_INCLUDE_DIRS}) - LIST(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS}) + include_directories(${GR_SWIG_INCLUDE_DIRS}) + list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS}) - FIND_PACKAGE(PythonLibs) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS}) + find_package(PythonLibs) + include_directories(${PYTHON_INCLUDE_DIRS}) #setup the swig flags with flags and include directories - SET(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) - FOREACH(dir ${GR_SWIG_INCLUDE_DIRS}) - LIST(APPEND CMAKE_SWIG_FLAGS "-I${dir}") - ENDFOREACH(dir) + set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) + foreach(dir ${GR_SWIG_INCLUDE_DIRS}) + list(APPEND CMAKE_SWIG_FLAGS "-I${dir}") + endforeach(dir) #set the C++ property on the swig .i file so it builds - SET_SOURCE_FILES_PROPERTIES(${ifiles} PROPERTIES CPLUSPLUS ON) + set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON) #setup the actual swig library target to be built - INCLUDE(UseSWIG) + include(UseSWIG) SWIG_ADD_MODULE(${name} python ${ifiles}) SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES}) - IF(GR_SWIG_TARGET_DEPS) - ADD_DEPENDENCIES(${SWIG_MODULE_${name}_REAL_NAME} ${GR_SWIG_TARGET_DEPS}) - ENDIF(GR_SWIG_TARGET_DEPS) + if(GR_SWIG_TARGET_DEPS) + add_dependencies(${SWIG_MODULE_${name}_REAL_NAME} ${GR_SWIG_TARGET_DEPS}) + endif(GR_SWIG_TARGET_DEPS) -ENDMACRO(GR_SWIG_MAKE) +endmacro(GR_SWIG_MAKE) ######################################################################## # Install swig targets generated by GR_SWIG_MAKE. Usage: @@ -81,25 +81,25 @@ ENDMACRO(GR_SWIG_MAKE) # [COMPONENT component] # ) ######################################################################## -MACRO(GR_SWIG_INSTALL) +macro(GR_SWIG_INSTALL) - INCLUDE(CMakeParseArgumentsCopy) + include(CMakeParseArgumentsCopy) CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) - FOREACH(name ${GR_SWIG_INSTALL_TARGETS}) - INSTALL(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} + foreach(name ${GR_SWIG_INSTALL_TARGETS}) + install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} DESTINATION ${GR_SWIG_INSTALL_DESTINATION} COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - INCLUDE(GrPython) + include(GrPython) GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py DESTINATION ${GR_SWIG_INSTALL_DESTINATION} COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - ENDFOREACH(name) + endforeach(name) -ENDMACRO(GR_SWIG_INSTALL) +endmacro(GR_SWIG_INSTALL) ######################################################################## # Generate a python file that can determine swig dependencies. @@ -107,7 +107,7 @@ ENDMACRO(GR_SWIG_INSTALL) # When you build C++, CMake figures out the header dependencies. # This code essentially performs that logic for swig includes. ######################################################################## -FILE(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py " +file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py " import os, sys, re diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake index 8a73de3ce..bbb525dcc 100644 --- a/cmake/Modules/GrTest.cmake +++ b/cmake/Modules/GrTest.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_TEST_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_TEST_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_TEST_CMAKE) + return() +endif() +set(__INCLUDED_GR_TEST_CMAKE TRUE) ######################################################################## # Add a unit test and setup the environment for a unit test. @@ -31,41 +31,41 @@ SET(__INCLUDED_GR_TEST_CMAKE TRUE) # GR_TEST_LIBRARY_DIRS - directories for the library path # GR_TEST_PYTHON_DIRS - directories for the python path ######################################################################## -FUNCTION(GR_ADD_TEST test_name) +function(GR_ADD_TEST test_name) #Ensure that the build exe also appears in the PATH. - LIST(APPEND GR_TEST_TARGET_DEPS ${ARGN}) + list(APPEND GR_TEST_TARGET_DEPS ${ARGN}) #In the land of windows, all libraries must be in the PATH. #Since the dependent libraries are not yet installed, #we must manually set them in the PATH to run tests. #The following appends the path of a target dependency. - FOREACH(target ${GR_TEST_TARGET_DEPS}) - GET_TARGET_PROPERTY(location ${target} LOCATION) - IF(location) - GET_FILENAME_COMPONENT(path ${location} PATH) - STRING(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) - LIST(APPEND GR_TEST_LIBRARY_DIRS ${path}) - ENDIF(location) - ENDFOREACH(target) - - IF(WIN32) + foreach(target ${GR_TEST_TARGET_DEPS}) + get_target_property(location ${target} LOCATION) + if(location) + get_filename_component(path ${location} PATH) + string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) + list(APPEND GR_TEST_LIBRARY_DIRS ${path}) + endif(location) + endforeach(target) + + if(WIN32) #SWIG generates the python library files into a subdirectory. #Therefore, we must append this subdirectory into PYTHONPATH. #Only do this for the python directories matching the following: - FOREACH(pydir ${GR_TEST_PYTHON_DIRS}) - GET_FILENAME_COMPONENT(name ${pydir} NAME) - IF(name MATCHES "^(swig|lib|src)$") - LIST(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE}) - ENDIF() - ENDFOREACH(pydir) - ENDIF(WIN32) + foreach(pydir ${GR_TEST_PYTHON_DIRS}) + get_filename_component(name ${pydir} NAME) + if(name MATCHES "^(swig|lib|src)$") + list(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE}) + endif() + endforeach(pydir) + endif(WIN32) - FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir) - FILE(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? - FILE(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? + file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir) + file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? + file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? - SET(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") + set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") #http://www.cmake.org/pipermail/cmake/2009-May/029464.html #Replaced this add test + set environs code with the shell script generation. @@ -73,65 +73,65 @@ FUNCTION(GR_ADD_TEST test_name) #ADD_TEST(${ARGV}) #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}") - IF(UNIX) - SET(LD_PATH_VAR "LD_LIBRARY_PATH") - IF(APPLE) - SET(LD_PATH_VAR "DYLD_LIBRARY_PATH") - ENDIF() + if(UNIX) + set(LD_PATH_VAR "LD_LIBRARY_PATH") + if(APPLE) + set(LD_PATH_VAR "DYLD_LIBRARY_PATH") + endif() - SET(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH") - LIST(APPEND libpath "$${LD_PATH_VAR}") - LIST(APPEND pypath "$PYTHONPATH") + set(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH") + list(APPEND libpath "$${LD_PATH_VAR}") + list(APPEND pypath "$PYTHONPATH") #replace list separator with the path separator - STRING(REPLACE ";" ":" libpath "${libpath}") - STRING(REPLACE ";" ":" pypath "${pypath}") - LIST(APPEND environs "PATH=${binpath}" "${LD_PATH_VAR}=${libpath}" "PYTHONPATH=${pypath}") + string(REPLACE ";" ":" libpath "${libpath}") + string(REPLACE ";" ":" pypath "${pypath}") + list(APPEND environs "PATH=${binpath}" "${LD_PATH_VAR}=${libpath}" "PYTHONPATH=${pypath}") #generate a bat file that sets the environment and runs the test - FIND_PROGRAM(SHELL sh) - SET(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh) - FILE(WRITE ${sh_file} "#!${SHELL}\n") + find_program(SHELL sh) + set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh) + file(WRITE ${sh_file} "#!${SHELL}\n") #each line sets an environment variable - FOREACH(environ ${environs}) - FILE(APPEND ${sh_file} "export ${environ}\n") - ENDFOREACH(environ) + foreach(environ ${environs}) + file(APPEND ${sh_file} "export ${environ}\n") + endforeach(environ) #load the command to run with its arguments - FOREACH(arg ${ARGN}) - FILE(APPEND ${sh_file} "${arg} ") - ENDFOREACH(arg) - FILE(APPEND ${sh_file} "\n") + foreach(arg ${ARGN}) + file(APPEND ${sh_file} "${arg} ") + endforeach(arg) + file(APPEND ${sh_file} "\n") #make the shell file executable - EXECUTE_PROCESS(COMMAND chmod +x ${sh_file}) + execute_process(COMMAND chmod +x ${sh_file}) - ADD_TEST(${test_name} ${SHELL} ${sh_file}) + add_test(${test_name} ${SHELL} ${sh_file}) - ENDIF(UNIX) + endif(UNIX) - IF(WIN32) - LIST(APPEND libpath ${DLL_PATHS} "%PATH%") - LIST(APPEND pypath "%PYTHONPATH%") + if(WIN32) + list(APPEND libpath ${DLL_PATHS} "%PATH%") + list(APPEND pypath "%PYTHONPATH%") #replace list separator with the path separator (escaped) - STRING(REPLACE ";" "\\;" libpath "${libpath}") - STRING(REPLACE ";" "\\;" pypath "${pypath}") - LIST(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}") + string(REPLACE ";" "\\;" libpath "${libpath}") + string(REPLACE ";" "\\;" pypath "${pypath}") + list(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}") #generate a bat file that sets the environment and runs the test - SET(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat) - FILE(WRITE ${bat_file} "@echo off\n") + set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat) + file(WRITE ${bat_file} "@echo off\n") #each line sets an environment variable - FOREACH(environ ${environs}) - FILE(APPEND ${bat_file} "SET ${environ}\n") - ENDFOREACH(environ) + foreach(environ ${environs}) + file(APPEND ${bat_file} "SET ${environ}\n") + endforeach(environ) #load the command to run with its arguments - FOREACH(arg ${ARGN}) - FILE(APPEND ${bat_file} "${arg} ") - ENDFOREACH(arg) - FILE(APPEND ${bat_file} "\n") + foreach(arg ${ARGN}) + file(APPEND ${bat_file} "${arg} ") + endforeach(arg) + file(APPEND ${bat_file} "\n") - ADD_TEST(${test_name} ${bat_file}) - ENDIF(WIN32) + add_test(${test_name} ${bat_file}) + endif(WIN32) -ENDFUNCTION(GR_ADD_TEST) +endfunction(GR_ADD_TEST) diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index ab2959c0d..842537f18 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_VERSION_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_VERSION_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_VERSION_CMAKE) + return() +endif() +set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## # Setup version variables. @@ -28,46 +28,46 @@ SET(__INCLUDED_GR_VERSION_CMAKE TRUE) # sets VERSION and LIBVER ######################################################################## -UNSET(VERSION) -UNSET(LIBVER) +unset(VERSION) +unset(LIBVER) ######################################################################## # Extract the version string from git describe. ######################################################################## -FIND_PACKAGE(Git) -IF(GIT_FOUND) - MESSAGE(STATUS "Extracting version information from git...") - EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe +find_package(Git) +if(GIT_FOUND) + message(STATUS "Extracting version information from git...") + execute_process(COMMAND ${GIT_EXECUTABLE} describe OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) - IF(NOT VERSION) - MESSAGE(WARNING "Tried to extract $VERSION from git describe but failed... using default") - ENDIF() -ENDIF(GIT_FOUND) + if(NOT VERSION) + message(WARNING "Tried to extract $VERSION from git describe but failed... using default") + endif() +endif(GIT_FOUND) ######################################################################## # Extract the library version from the version string. ######################################################################## -IF(VERSION) - INCLUDE(GrPython) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" +if(VERSION) + include(GrPython) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(NOT LIBVER) - MESSAGE(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") - ENDIF() -ENDIF() + if(NOT LIBVER) + message(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") + endif() +endif() ######################################################################## # Ensure that the version strings are set no matter what. ######################################################################## -IF(NOT VERSION) - SET(VERSION "v3.x.x-unknown") -ENDIF() +if(NOT VERSION) + set(VERSION "v3.x.x-unknown") +endif() -IF(NOT LIBVER) - SET(LIBVER "3.x.x") -ENDIF() +if(NOT LIBVER) + set(LIBVER "3.x.x") +endif() -MESSAGE(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") +message(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 097e1fc67..45f9b0102 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -20,23 +20,23 @@ ######################################################################## # Setup dependencies ######################################################################## -FIND_PACKAGE(Doxygen) +find_package(Doxygen) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("doxygen" ENABLE_DOXYGEN DOXYGEN_FOUND) ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_DOXYGEN) +if(ENABLE_DOXYGEN) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_COMPONENT("docs" DISPLAY_NAME "Documentation" DESCRIPTION "Doxygen generated documentation" @@ -45,6 +45,6 @@ CPACK_COMPONENT("docs" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(doxygen) +add_subdirectory(doxygen) -ENDIF(ENABLE_DOXYGEN) +endif(ENABLE_DOXYGEN) diff --git a/docs/doxygen/CMakeLists.txt b/docs/doxygen/CMakeLists.txt index 941479f63..e81429dc5 100644 --- a/docs/doxygen/CMakeLists.txt +++ b/docs/doxygen/CMakeLists.txt @@ -20,32 +20,32 @@ ######################################################################## # Create the doxygen configuration file ######################################################################## -FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) -FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) -FILE(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) +file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) +file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) +file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) -SET(HAVE_DOT ${DOXYGEN_DOT_FOUND}) -SET(enable_html_docs YES) -SET(enable_latex_docs NO) -SET(enable_xml_docs YES) +set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) +set(enable_html_docs YES) +set(enable_latex_docs NO) +set(enable_xml_docs YES) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) -SET(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) +set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) ######################################################################## # Make and install doxygen docs ######################################################################## -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${BUILT_DIRS} COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation with doxygen" ) -ADD_CUSTOM_TARGET(doxygen_target ALL DEPENDS ${BUILT_DIRS}) +add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS}) -INSTALL(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR} COMPONENT "docs") +install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR} COMPONENT "docs") diff --git a/gnuradio-core/CMakeLists.txt b/gnuradio-core/CMakeLists.txt index 780770bb8..99bd482b8 100644 --- a/gnuradio-core/CMakeLists.txt +++ b/gnuradio-core/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -FIND_PACKAGE(GSL) +find_package(GSL) -FIND_PACKAGE(FFTW3f) +find_package(FFTW3f) -INCLUDE(GrPython) #used for code generation +include(GrPython) #used for code generation -GET_FILENAME_COMPONENT(GR_CORE_PYTHONPATH +get_filename_component(GR_CORE_PYTHONPATH ${CMAKE_CURRENT_SOURCE_DIR}/src/python ABSOLUTE ) GR_SET_GLOBAL(GR_CORE_PYTHONPATH ${GR_CORE_PYTHONPATH}) @@ -36,7 +36,7 @@ GR_SET_GLOBAL(GR_CORE_PYTHONPATH ${GR_CORE_PYTHONPATH}) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gnuradio-core" ENABLE_GR_CORE ENABLE_GRUEL_ Boost_FOUND @@ -45,7 +45,7 @@ GR_REGISTER_COMPONENT("gnuradio-core" ENABLE_GR_CORE PYTHONINTERP_FOUND ) -INCLUDE(GrMiscUtils) +include(GrMiscUtils) GR_SET_GLOBAL(GNURADIO_CORE_INCLUDE_DIRS ${GRUEL_INCLUDE_DIRS} #headers depend on gruel ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/runtime @@ -73,12 +73,12 @@ GR_SET_GLOBAL(GNURADIO_CORE_SWIG_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_CORE) +if(ENABLE_GR_CORE) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_CORE_DESCRIPTION "GNU Radio Core Library") CPACK_COMPONENT("core_runtime" @@ -109,7 +109,7 @@ CPACK_COMPONENT("core_swig" DEPENDS "gruel_swig;core_python;core_devel" ) -INSTALL( +install( FILES gnuradio-core.conf DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "core_runtime" @@ -118,27 +118,27 @@ INSTALL( ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src/lib) -IF(ENABLE_TESTING) - ADD_SUBDIRECTORY(src/tests) -ENDIF(ENABLE_TESTING) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(src/lib/swig) - ADD_SUBDIRECTORY(src/python/gnuradio) -ENDIF(ENABLE_PYTHON) +add_subdirectory(src/lib) +if(ENABLE_TESTING) + add_subdirectory(src/tests) +endif(ENABLE_TESTING) +if(ENABLE_PYTHON) + add_subdirectory(src/lib/swig) + add_subdirectory(src/python/gnuradio) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-core.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-core.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-core.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "core_devel" ) -ENDIF(ENABLE_GR_CORE) +endif(ENABLE_GR_CORE) diff --git a/gnuradio-core/src/lib/CMakeLists.txt b/gnuradio-core/src/lib/CMakeLists.txt index c3ce5a145..2e0d95798 100644 --- a/gnuradio-core/src/lib/CMakeLists.txt +++ b/gnuradio-core/src/lib/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup compatibility checks and defines ######################################################################## -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake) ######################################################################## # Include subdirs rather to populate to the sources lists. @@ -35,28 +35,28 @@ GR_INCLUDE_SUBDIRECTORY(reed-solomon) GR_INCLUDE_SUBDIRECTORY(io) GR_INCLUDE_SUBDIRECTORY(hier) -LIST(APPEND gnuradio_core_sources bug_work_around_6.cc) -LIST(APPEND test_gnuradio_core_sources bug_work_around_6.cc) +list(APPEND gnuradio_core_sources bug_work_around_6.cc) +list(APPEND test_gnuradio_core_sources bug_work_around_6.cc) ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES(${GNURADIO_CORE_INCLUDE_DIRS}) +include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -ADD_DEFINITIONS(${GSL_DEFINITIONS}) -INCLUDE_DIRECTORIES(${GSL_INCLUDE_DIRS}) -LINK_DIRECTORIES(${GSL_LIBRARY_DIRS}) +add_definitions(${GSL_DEFINITIONS}) +include_directories(${GSL_INCLUDE_DIRS}) +link_directories(${GSL_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) -LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS}) +include_directories(${FFTW3F_INCLUDE_DIRS}) +link_directories(${FFTW3F_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gnuradio_core_libs +list(APPEND gnuradio_core_libs gruel ${Boost_LIBRARIES} ${GSL_LIBRARIES} @@ -64,18 +64,18 @@ LIST(APPEND gnuradio_core_libs ) #need to link with librt on ubuntu 11.10 for shm_* -IF(LINUX) - LIST(APPEND gnuradio_core_libs rt) -ENDIF() - -ADD_LIBRARY(gnuradio-core SHARED ${gnuradio_core_sources}) -TARGET_LINK_LIBRARIES(gnuradio-core ${gnuradio_core_libs}) -SET_TARGET_PROPERTIES(gnuradio-core PROPERTIES DEFINE_SYMBOL "gnuradio_core_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-core PROPERTIES SOVERSION ${LIBVER}) +if(LINUX) + list(APPEND gnuradio_core_libs rt) +endif() + +add_library(gnuradio-core SHARED ${gnuradio_core_sources}) +target_link_libraries(gnuradio-core ${gnuradio_core_libs}) +set_target_properties(gnuradio-core PROPERTIES DEFINE_SYMBOL "gnuradio_core_EXPORTS") +set_target_properties(gnuradio-core PROPERTIES SOVERSION ${LIBVER}) #avoid fftw and gsl link in dependent libraries: -SET_TARGET_PROPERTIES(gnuradio-core PROPERTIES LINK_INTERFACE_LIBRARIES "gruel") +set_target_properties(gnuradio-core PROPERTIES LINK_INTERFACE_LIBRARIES "gruel") -INSTALL(TARGETS gnuradio-core +install(TARGETS gnuradio-core LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "core_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "core_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "core_runtime" # .dll file @@ -84,9 +84,9 @@ INSTALL(TARGETS gnuradio-core ######################################################################## # Setup executables ######################################################################## -ADD_EXECUTABLE(gnuradio-config-info gnuradio-config-info.cc) -TARGET_LINK_LIBRARIES(gnuradio-config-info gnuradio-core ${Boost_LIBRARIES}) -INSTALL( +add_executable(gnuradio-config-info gnuradio-config-info.cc) +target_link_libraries(gnuradio-config-info gnuradio-core ${Boost_LIBRARIES}) +install( TARGETS gnuradio-config-info DESTINATION ${GR_RUNTIME_DIR} COMPONENT "core_runtime" @@ -95,12 +95,12 @@ INSTALL( ######################################################################## # Setup tests ######################################################################## -IF(ENABLE_TESTING) +if(ENABLE_TESTING) -INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS}) -LINK_DIRECTORIES(${CPPUNIT_LIBRARY_DIRS}) +include_directories(${CPPUNIT_INCLUDE_DIRS}) +link_directories(${CPPUNIT_LIBRARY_DIRS}) -ADD_LIBRARY(test-gnuradio-core SHARED ${test_gnuradio_core_sources}) -TARGET_LINK_LIBRARIES(test-gnuradio-core gnuradio-core ${CPPUNIT_LIBRARIES} ${Boost_LIBRARIES}) +add_library(test-gnuradio-core SHARED ${test_gnuradio_core_sources}) +target_link_libraries(test-gnuradio-core gnuradio-core ${CPPUNIT_LIBRARIES} ${Boost_LIBRARIES}) -ENDIF(ENABLE_TESTING) +endif(ENABLE_TESTING) diff --git a/gnuradio-core/src/lib/filter/CMakeLists.txt b/gnuradio-core/src/lib/filter/CMakeLists.txt index 4c6fcf642..da16cd60b 100644 --- a/gnuradio-core/src/lib/filter/CMakeLists.txt +++ b/gnuradio-core/src/lib/filter/CMakeLists.txt @@ -22,13 +22,13 @@ ######################################################################## #set the C language property on the assembly files so the compiler will pick them up -FILE(GLOB gr_core_filter_asms ${CMAKE_CURRENT_SOURCE_DIR}/*.S) -FOREACH(gr_core_filter_asm ${gr_core_filter_asms}) - SET_PROPERTY(SOURCE ${gr_core_filter_asm} PROPERTY LANGUAGE C) -ENDFOREACH(gr_core_filter_asm) +file(GLOB gr_core_filter_asms ${CMAKE_CURRENT_SOURCE_DIR}/*.S) +foreach(gr_core_filter_asm ${gr_core_filter_asms}) + set_property(SOURCE ${gr_core_filter_asm} PROPERTY LANGUAGE C) +endforeach(gr_core_filter_asm) #detect 32 or 64 bit compiler -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|x86_64)$") +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|x86_64)$") include(CheckTypeSize) check_type_size("void*" SIZEOF_VOID_P BUILTIN_TYPES_ONLY) if (${SIZEOF_VOID_P} EQUAL 8) @@ -36,7 +36,7 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|x86_64)$") else() set(CMAKE_SYSTEM_PROCESSOR_x86 32) endif() -ENDIF() +endif() ######################################################################## # Generate the makefile.gen, then extract its sources: @@ -49,7 +49,7 @@ ENDIF() # - Create a python script (very generic) to perform generation. # - This way the targets would depend only on their sources. ######################################################################## -EXECUTE_PROCESS( +execute_process( COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} -c " import os, sys sys.path.append('${GR_CORE_PYTHONPATH}') @@ -63,20 +63,20 @@ generate_all() " WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -MACRO(FILTER_GEN_EXTRACT outvar ext) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import os; print ';'.join( +macro(FILTER_GEN_EXTRACT outvar ext) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; print ';'.join( map(lambda x: os.path.join('${CMAKE_CURRENT_BINARY_DIR}', x.replace('\\\\', '').strip()), filter(lambda f: '${ext}' in f, open('${CMAKE_CURRENT_BINARY_DIR}/Makefile.gen').readlines() )))" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ${outvar}) - FILE(TO_CMAKE_PATH "${${outvar}}" ${outvar}) -ENDMACRO(FILTER_GEN_EXTRACT) + file(TO_CMAKE_PATH "${${outvar}}" ${outvar}) +endmacro(FILTER_GEN_EXTRACT) FILTER_GEN_EXTRACT(generated_filter_sources ".cc") FILTER_GEN_EXTRACT(generated_filter_includes ".h") FILTER_GEN_EXTRACT(generated_filter_swigs ".i") #TODO simplify this list with a triple-threat for loop -SET(generated_filter_deps +set(generated_filter_deps ${CMAKE_CURRENT_SOURCE_DIR}/generate_all.py ${CMAKE_CURRENT_SOURCE_DIR}/generate_gr_fir_XXX.py ${CMAKE_CURRENT_SOURCE_DIR}/generate_gr_fir_filter_XXX.py @@ -108,7 +108,7 @@ SET(generated_filter_deps ${CMAKE_CURRENT_SOURCE_DIR}/gri_fir_filter_with_buffer_XXX.h.t ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${generated_filter_sources} ${generated_filter_includes} @@ -121,7 +121,7 @@ ADD_CUSTOM_COMMAND( VERBATIM ) -ADD_CUSTOM_TARGET(filter_generated DEPENDS +add_custom_target(filter_generated DEPENDS ${generated_filter_sources} ${generated_filter_includes} ${generated_filter_swigs} @@ -131,16 +131,16 @@ ADD_CUSTOM_TARGET(filter_generated DEPENDS # Add target specific files # May VOLK put a rest to all the insanity below. ######################################################################## -IF(MSVC) - LIST(APPEND gnuradio_core_sources +if(MSVC) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_generic.cc ) - LIST(APPEND test_gnuradio_core_sources + list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_generic.cc ) -ELSE(MSVC) -IF(CMAKE_SYSTEM_PROCESSOR_x86) - LIST(APPEND gnuradio_core_sources +else(MSVC) +if(CMAKE_SYSTEM_PROCESSOR_x86) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_sysconfig_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_cpu_x86.cc @@ -158,16 +158,16 @@ IF(CMAKE_SYSTEM_PROCESSOR_x86) ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_ccf_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/sse_debug.c ) - LIST(APPEND test_gnuradio_core_sources + list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_float_dotprod_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_complex_dotprod_x86.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_ccomplex_dotprod_x86.cc ) -ENDIF() +endif() -IF(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 64) - LIST(APPEND gnuradio_core_sources +if(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 64) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/float_dotprod_sse64.S ${CMAKE_CURRENT_SOURCE_DIR}/float_dotprod_3dnow64.S ${CMAKE_CURRENT_SOURCE_DIR}/complex_dotprod_3dnowext64.S @@ -180,8 +180,8 @@ IF(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 64) ${CMAKE_CURRENT_SOURCE_DIR}/fcomplex_dotprod_sse64.S ${CMAKE_CURRENT_SOURCE_DIR}/short_dotprod_mmx64.S ) -ELSEIF(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 32) - LIST(APPEND gnuradio_core_sources +elseif(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 32) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/float_dotprod_sse.S ${CMAKE_CURRENT_SOURCE_DIR}/float_dotprod_3dnow.S ${CMAKE_CURRENT_SOURCE_DIR}/complex_dotprod_3dnowext.S @@ -194,8 +194,8 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR_x86 AND ${CMAKE_SYSTEM_PROCESSOR_x86} EQUAL 32) ${CMAKE_CURRENT_SOURCE_DIR}/fcomplex_dotprod_sse.S ${CMAKE_CURRENT_SOURCE_DIR}/short_dotprod_mmx.S ) -ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") - LIST(APPEND gnuradio_core_sources +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_powerpc.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_sysconfig_powerpc.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_cpu_powerpc.cc @@ -203,11 +203,11 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") ${CMAKE_CURRENT_SOURCE_DIR}/gr_altivec.c ${CMAKE_CURRENT_SOURCE_DIR}/dotprod_fff_altivec.c ) - LIST(APPEND test_gnuradio_core_sources + list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_powerpc.cc ) -ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") - LIST(APPEND gnuradio_core_sources +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_armv7_a.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_sysconfig_armv7_a.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_cpu_armv7_a.cc @@ -216,23 +216,23 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") ${CMAKE_CURRENT_SOURCE_DIR}/dotprod_ccf_armv7_a.c ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_ccf_armv7_a.cc ) - LIST(APPEND test_gnuradio_core_sources + list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_armv7_a.cc ) -ELSE() - LIST(APPEND gnuradio_core_sources +else() + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_generic.cc ) - LIST(APPEND test_gnuradio_core_sources + list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_generic.cc ) -ENDIF() -ENDIF(MSVC) +endif() +endif(MSVC) ######################################################################## # Append gnuradio-core library sources ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${generated_filter_sources} ${CMAKE_CURRENT_SOURCE_DIR}/gri_fft_filter_fff_generic.cc ${CMAKE_CURRENT_SOURCE_DIR}/gri_fft_filter_ccc_generic.cc @@ -249,7 +249,7 @@ LIST(APPEND gnuradio_core_sources ######################################################################## # Append gnuradio-core test sources ######################################################################## -LIST(APPEND test_gnuradio_core_sources +list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_filter.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_fir_ccf.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_fir_fcc.cc @@ -270,7 +270,7 @@ LIST(APPEND test_gnuradio_core_sources ######################################################################## # Install runtime headers ######################################################################## -INSTALL(FILES +install(FILES ${generated_filter_includes} ${CMAKE_CURRENT_SOURCE_DIR}/complex_dotprod_generic.h ${CMAKE_CURRENT_SOURCE_DIR}/complex_dotprod_x86.h @@ -304,20 +304,20 @@ INSTALL(FILES ######################################################################## # Install swig headers ######################################################################## -IF(ENABLE_PYTHON) -INSTALL(FILES +if(ENABLE_PYTHON) +install(FILES ${generated_filter_swigs} ${CMAKE_CURRENT_SOURCE_DIR}/filter.i ${CMAKE_CURRENT_BINARY_DIR}/filter_generated.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) ######################################################################## # Handle triple-threat files that have cc, h, and i ######################################################################## -SET(gr_core_filter_triple_threats +set(gr_core_filter_triple_threats gr_adaptive_fir_ccc gr_adaptive_fir_ccf gr_dc_blocker_cc @@ -342,10 +342,10 @@ SET(gr_core_filter_triple_threats gr_pfb_clock_sync_fff ) -FOREACH(file_tt ${gr_core_filter_triple_threats}) - LIST(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") - IF(ENABLE_PYTHON) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") - ENDIF(ENABLE_PYTHON) -ENDFOREACH(file_tt ${gr_core_filter_triple_threats}) +foreach(file_tt ${gr_core_filter_triple_threats}) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") + if(ENABLE_PYTHON) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") + endif(ENABLE_PYTHON) +endforeach(file_tt ${gr_core_filter_triple_threats}) diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index ab6201de1..0445e251e 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -24,7 +24,7 @@ ######################################################################## # Handle the generated sine table ######################################################################## -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sine_table.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_sine_table.py COMMAND ${PYTHON_EXECUTABLE} @@ -32,7 +32,7 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_BINARY_DIR}/sine_table.h ) -INCLUDE(AddFileDependencies) +include(AddFileDependencies) ADD_FILE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt.cc ${CMAKE_CURRENT_BINARY_DIR}/sine_table.h ) @@ -40,33 +40,33 @@ ADD_FILE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt.cc ######################################################################## # Handle the generated constants ######################################################################## -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import time;print time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime())" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) -MESSAGE(STATUS "Loading build date ${BUILD_DATE} into gr_constants...") +message(STATUS "Loading build date ${BUILD_DATE} into gr_constants...") -MESSAGE(STATUS "Loading version ${VERSION} into gr_constants...") +message(STATUS "Loading version ${VERSION} into gr_constants...") -FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${GR_CONF_DIR}" SYSCONFDIR) -FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${GR_PKG_CONF_DIR}" GR_PREFSDIR) +file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${GR_CONF_DIR}" SYSCONFDIR) +file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${GR_PKG_CONF_DIR}" GR_PREFSDIR) #double escape for windows backslash path separators -STRING(REPLACE "\\" "\\\\" prefix ${prefix}) -STRING(REPLACE "\\" "\\\\" SYSCONFDIR ${SYSCONFDIR}) -STRING(REPLACE "\\" "\\\\" GR_PREFSDIR ${GR_PREFSDIR}) +string(REPLACE "\\" "\\\\" prefix ${prefix}) +string(REPLACE "\\" "\\\\" SYSCONFDIR ${SYSCONFDIR}) +string(REPLACE "\\" "\\\\" GR_PREFSDIR ${GR_PREFSDIR}) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gr_constants.cc.in ${CMAKE_CURRENT_BINARY_DIR}/gr_constants.cc @ONLY) -LIST(APPEND gnuradio_core_sources ${CMAKE_CURRENT_BINARY_DIR}/gr_constants.cc) +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_BINARY_DIR}/gr_constants.cc) ######################################################################## # Append gnuradio-core library sources ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/gr_circular_file.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_count_bits.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_fast_atan2f.cc @@ -93,7 +93,7 @@ LIST(APPEND gnuradio_core_sources ######################################################################## # Append gnuradio-core test sources ######################################################################## -LIST(APPEND test_gnuradio_core_sources +list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_general.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_circular_file.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_cpm.cc @@ -108,7 +108,7 @@ LIST(APPEND test_gnuradio_core_sources ######################################################################## # Install runtime headers ######################################################################## -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_core_api.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_circular_file.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_constants.h @@ -155,8 +155,8 @@ INSTALL(FILES ######################################################################## # Install swig headers ######################################################################## -IF(ENABLE_PYTHON) -INSTALL(FILES +if(ENABLE_PYTHON) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/general.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_constants.i ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_cc.i @@ -167,12 +167,12 @@ INSTALL(FILES DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) ######################################################################## # Handle triple-threat files that have cc, h, and i ######################################################################## -SET(gr_core_general_triple_threats +set(gr_core_general_triple_threats complex_vec_test gr_additive_scrambler_bb gr_agc_cc @@ -292,10 +292,10 @@ SET(gr_core_general_triple_threats gr_correlate_access_code_tag_bb ) -FOREACH(file_tt ${gr_core_general_triple_threats}) - LIST(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") - IF(ENABLE_PYTHON) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") - ENDIF(ENABLE_PYTHON) -ENDFOREACH(file_tt ${gr_core_general_triple_threats}) +foreach(file_tt ${gr_core_general_triple_threats}) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") + if(ENABLE_PYTHON) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") + endif(ENABLE_PYTHON) +endforeach(file_tt ${gr_core_general_triple_threats}) diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index a223d291f..779ea0c47 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -24,7 +24,7 @@ ######################################################################## # generate the python helper script which calls into the build utils ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " #!${PYTHON_EXECUTABLE} import sys, os, re @@ -45,37 +45,37 @@ if __name__ == '__main__': ######################################################################## # generation helper macro to generate various files from template ######################################################################## -MACRO(expand_h_cc_i root) +macro(expand_h_cc_i root) - FOREACH(ext h cc i) + foreach(ext h cc i) #make a list of all the generated files - UNSET(expanded_files_${ext}) - FOREACH(sig ${ARGN}) - STRING(REGEX REPLACE "X+" ${sig} name ${root}) - LIST(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext}) - ENDFOREACH(sig) + unset(expanded_files_${ext}) + foreach(sig ${ARGN}) + string(REGEX REPLACE "X+" ${sig} name ${root}) + list(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext}) + endforeach(sig) #create a command to generate the files - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${expanded_files_${ext}} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.${ext}.t COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py ${root} ${root}.${ext}.t ${ARGN} ) - ENDFOREACH(ext) + endforeach(ext) #make source files depends on headers to force generation - SET_SOURCE_FILES_PROPERTIES(${expanded_files_cc} + set_source_files_properties(${expanded_files_cc} PROPERTIES OBJECT_DEPENDS "${expanded_files_h}" ) #install rules for the generated cc, h, and i files - LIST(APPEND generated_gengen_sources ${expanded_files_cc}) - LIST(APPEND generated_gengen_includes ${expanded_files_h}) - LIST(APPEND generated_gengen_swigs ${expanded_files_i}) + list(APPEND generated_gengen_sources ${expanded_files_cc}) + list(APPEND generated_gengen_includes ${expanded_files_h}) + list(APPEND generated_gengen_swigs ${expanded_files_i}) -ENDMACRO(expand_h_cc_i) +endmacro(expand_h_cc_i) ######################################################################## # Invoke macro to generate various sources @@ -110,7 +110,7 @@ expand_h_cc_i(gr_argmax_XX fs is ss) expand_h_cc_i(gr_max_XX ff ii ss) expand_h_cc_i(gr_peak_detector_XX fb ib sb) -ADD_CUSTOM_TARGET(gengen_generated DEPENDS +add_custom_target(gengen_generated DEPENDS ${generated_gengen_includes} ${generated_gengen_swigs} ) @@ -118,32 +118,32 @@ ADD_CUSTOM_TARGET(gengen_generated DEPENDS ######################################################################## # Create the master gengen swig include files ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i " +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i " // // This file is machine generated. All edits will be overwritten // ") -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{\n") -FOREACH(swig_file ${generated_gengen_swigs}) - GET_FILENAME_COMPONENT(name ${swig_file} NAME_WE) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "#include<${name}.h>\n") -ENDFOREACH(swig_file) -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%}\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{\n") +foreach(swig_file ${generated_gengen_swigs}) + get_filename_component(name ${swig_file} NAME_WE) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "#include<${name}.h>\n") +endforeach(swig_file) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%}\n") -FOREACH(swig_file ${generated_gengen_swigs}) - GET_FILENAME_COMPONENT(name ${swig_file} NAME) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}>\n") -ENDFOREACH(swig_file) +foreach(swig_file ${generated_gengen_swigs}) + get_filename_component(name ${swig_file} NAME) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}>\n") +endforeach(swig_file) ######################################################################## # Handle the generated sources + a few non-generated ones ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${generated_gengen_sources} ) -INSTALL(FILES +install(FILES ${generated_gengen_includes} ${CMAKE_CURRENT_SOURCE_DIR}/gr_endianness.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_type.h @@ -152,8 +152,8 @@ INSTALL(FILES COMPONENT "core_devel" ) -IF(ENABLE_PYTHON) - INSTALL(FILES +if(ENABLE_PYTHON) + install(FILES ${generated_gengen_swigs} ${CMAKE_CURRENT_SOURCE_DIR}/gr_endianness.i ${CMAKE_CURRENT_SOURCE_DIR}/gengen.i @@ -161,4 +161,4 @@ IF(ENABLE_PYTHON) DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gnuradio-core/src/lib/hier/CMakeLists.txt b/gnuradio-core/src/lib/hier/CMakeLists.txt index fb922f60e..192dd5939 100644 --- a/gnuradio-core/src/lib/hier/CMakeLists.txt +++ b/gnuradio-core/src/lib/hier/CMakeLists.txt @@ -20,23 +20,23 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/gr_channel_model.cc ) -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_channel_model.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" ) -IF(ENABLE_PYTHON) - INSTALL(FILES +if(ENABLE_PYTHON) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/hier.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_channel_model.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gnuradio-core/src/lib/io/CMakeLists.txt b/gnuradio-core/src/lib/io/CMakeLists.txt index 7ffe8306e..af9d7583c 100644 --- a/gnuradio-core/src/lib/io/CMakeLists.txt +++ b/gnuradio-core/src/lib/io/CMakeLists.txt @@ -24,7 +24,7 @@ ######################################################################## # Append gnuradio-core library sources ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink_f.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_guts.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_f.cc @@ -43,7 +43,7 @@ LIST(APPEND gnuradio_core_sources ######################################################################## # Install runtime headers ######################################################################## -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink_f.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_guts.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_f.h @@ -66,20 +66,20 @@ INSTALL(FILES ######################################################################## # Install swig headers ######################################################################## -IF(ENABLE_PYTHON) -INSTALL(FILES +if(ENABLE_PYTHON) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/io.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) ######################################################################## # Handle triple-threat files that have cc, h, and i ######################################################################## -SET(gr_core_io_triple_threats +set(gr_core_io_triple_threats gr_file_sink gr_file_sink_base gr_file_source @@ -99,10 +99,10 @@ SET(gr_core_io_triple_threats gr_tagged_file_sink ) -FOREACH(file_tt ${gr_core_io_triple_threats}) - LIST(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") - IF(ENABLE_PYTHON) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") - ENDIF(ENABLE_PYTHON) -ENDFOREACH(file_tt ${gr_core_io_triple_threats}) +foreach(file_tt ${gr_core_io_triple_threats}) + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") + if(ENABLE_PYTHON) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") + endif(ENABLE_PYTHON) +endforeach(file_tt ${gr_core_io_triple_threats}) diff --git a/gnuradio-core/src/lib/missing/CMakeLists.txt b/gnuradio-core/src/lib/missing/CMakeLists.txt index fb4620452..0a376645f 100644 --- a/gnuradio-core/src/lib/missing/CMakeLists.txt +++ b/gnuradio-core/src/lib/missing/CMakeLists.txt @@ -21,12 +21,12 @@ # This file included, use CMake directory variables ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/bug_work_around_8.cc ) -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") - LIST(APPEND gnuradio_core_sources +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") + list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/posix_memalign.cc ) -ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") +endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") diff --git a/gnuradio-core/src/lib/reed-solomon/CMakeLists.txt b/gnuradio-core/src/lib/reed-solomon/CMakeLists.txt index 5640b12a2..f073249f6 100644 --- a/gnuradio-core/src/lib/reed-solomon/CMakeLists.txt +++ b/gnuradio-core/src/lib/reed-solomon/CMakeLists.txt @@ -24,15 +24,15 @@ #So ifdef a max array bounds that is larger than NN and NROOTS #Its a bit of a hack, but if you look at the code, its so full of ifdefs, #and lacks optimization where it should be pre-allocating these arrays. -IF(MSVC) - SET_SOURCE_FILES_PROPERTIES( +if(MSVC) + set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/exercise.c ${CMAKE_CURRENT_SOURCE_DIR}/decode_rs.c PROPERTIES COMPILE_DEFINITIONS "MAX_ARRAY=256;" ) -ENDIF(MSVC) +endif(MSVC) -SET(gr_core_rs_sources +set(gr_core_rs_sources ${CMAKE_CURRENT_SOURCE_DIR}/encode_rs.c ${CMAKE_CURRENT_SOURCE_DIR}/decode_rs.c ${CMAKE_CURRENT_SOURCE_DIR}/init_rs.c @@ -41,9 +41,9 @@ SET(gr_core_rs_sources ######################################################################## # Setup sources and includes ######################################################################## -LIST(APPEND gnuradio_core_sources ${gr_core_rs_sources}) +list(APPEND gnuradio_core_sources ${gr_core_rs_sources}) -INSTALL( +install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/rs.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" @@ -52,11 +52,11 @@ INSTALL( ######################################################################## # Register unit tests ######################################################################## -IF(ENABLE_TESTING) -ADD_EXECUTABLE(gr_core_rstest +if(ENABLE_TESTING) +add_executable(gr_core_rstest ${gr_core_rs_sources} ${CMAKE_CURRENT_SOURCE_DIR}/rstest.c ${CMAKE_CURRENT_SOURCE_DIR}/exercise.c ) -ADD_TEST(gr-core-reed-solomon-test gr_core_rstest) -ENDIF(ENABLE_TESTING) +add_test(gr-core-reed-solomon-test gr_core_rstest) +endif(ENABLE_TESTING) diff --git a/gnuradio-core/src/lib/runtime/CMakeLists.txt b/gnuradio-core/src/lib/runtime/CMakeLists.txt index 4b1f85bbe..52cb39c40 100644 --- a/gnuradio-core/src/lib/runtime/CMakeLists.txt +++ b/gnuradio-core/src/lib/runtime/CMakeLists.txt @@ -24,7 +24,7 @@ ######################################################################## # Append gnuradio-core library sources ######################################################################## -LIST(APPEND gnuradio_core_sources +list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/gr_basic_block.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_flowgraph.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_flat_flowgraph.cc @@ -70,7 +70,7 @@ LIST(APPEND gnuradio_core_sources ######################################################################## # Append gnuradio-core test sources ######################################################################## -LIST(APPEND test_gnuradio_core_sources +list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_block.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_hier_block2.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_hier_block2_derived.cc @@ -87,7 +87,7 @@ LIST(APPEND test_gnuradio_core_sources ######################################################################## # Install runtime headers ######################################################################## -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_basic_block.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_flowgraph.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_flat_flowgraph.h @@ -136,8 +136,8 @@ INSTALL(FILES ######################################################################## # Install swig headers ######################################################################## -IF(ENABLE_PYTHON) -INSTALL(FILES +if(ENABLE_PYTHON) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_basic_block.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_block.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_block_detail.i @@ -159,4 +159,4 @@ INSTALL(FILES DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gnuradio-core/src/lib/swig/CMakeLists.txt b/gnuradio-core/src/lib/swig/CMakeLists.txt index 9c7a75b4f..ef0772944 100644 --- a/gnuradio-core/src/lib/swig/CMakeLists.txt +++ b/gnuradio-core/src/lib/swig/CMakeLists.txt @@ -18,20 +18,20 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${GRUEL_INCLUDE_DIRS} ${GNURADIO_CORE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ) -SET(GR_SWIG_LIBRARIES gnuradio-core) +set(GR_SWIG_LIBRARIES gnuradio-core) ######################################################################## # Build and install the swig targets @@ -43,7 +43,7 @@ SET(GR_SWIG_LIBRARIES gnuradio-core) # X86_64, g++'s resident set size was 650MB! # ---------------------------------------------------------------- -SET(GR_SWIG_TARGET_DEPS gengen_generated filter_generated) +set(GR_SWIG_TARGET_DEPS gengen_generated filter_generated) GR_SWIG_MAKE(gnuradio_core_runtime gnuradio_core_runtime.i) GR_SWIG_MAKE(gnuradio_core_general gnuradio_core_general.i) @@ -66,7 +66,7 @@ GR_SWIG_INSTALL(TARGETS ######################################################################## # Install various files ######################################################################## -INSTALL(FILES +install(FILES gnuradio.i gr_swig_block_magic.i gr_shared_ptr.i @@ -86,7 +86,7 @@ GR_PYTHON_INSTALL( COMPONENT "core_python" ) -INSTALL( +install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio_swig_bug_workaround.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_swig" diff --git a/gnuradio-core/src/lib/viterbi/CMakeLists.txt b/gnuradio-core/src/lib/viterbi/CMakeLists.txt index aeb8a012d..add5c77e8 100644 --- a/gnuradio-core/src/lib/viterbi/CMakeLists.txt +++ b/gnuradio-core/src/lib/viterbi/CMakeLists.txt @@ -21,7 +21,7 @@ # This file included, use CMake directory variables ######################################################################## -SET(viterbi_sources +set(viterbi_sources ${CMAKE_CURRENT_SOURCE_DIR}/metrics.c ${CMAKE_CURRENT_SOURCE_DIR}/tab.c ${CMAKE_CURRENT_SOURCE_DIR}/viterbi.c @@ -30,25 +30,25 @@ SET(viterbi_sources ######################################################################## # define missing erf function with C linkage (hack for metrics.c) ######################################################################## -IF(MSVC) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/boost_math_erf.cc " +if(MSVC) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/boost_math_erf.cc " #include <boost/math/special_functions/erf.hpp> extern \"C\" double erf(double x){ return boost::math::erf(x); } ") -LIST(APPEND viterbi_sources ${CMAKE_CURRENT_BINARY_DIR}/boost_math_erf.cc) -ENDIF(MSVC) +list(APPEND viterbi_sources ${CMAKE_CURRENT_BINARY_DIR}/boost_math_erf.cc) +endif(MSVC) ######################################################################## # Append gnuradio-core library sources ######################################################################## -LIST(APPEND gnuradio_core_sources ${viterbi_sources}) +list(APPEND gnuradio_core_sources ${viterbi_sources}) ######################################################################## # Install runtime headers ######################################################################## -INSTALL( +install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/viterbi.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" diff --git a/gnuradio-core/src/python/gnuradio/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/CMakeLists.txt index 57bc91552..fffef834e 100644 --- a/gnuradio-core/src/python/gnuradio/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/CMakeLists.txt @@ -17,13 +17,13 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) -ADD_SUBDIRECTORY(gr) -ADD_SUBDIRECTORY(gru) -ADD_SUBDIRECTORY(gruimpl) -ADD_SUBDIRECTORY(blks2) -ADD_SUBDIRECTORY(blks2impl) +add_subdirectory(gr) +add_subdirectory(gru) +add_subdirectory(gruimpl) +add_subdirectory(blks2) +add_subdirectory(blks2impl) GR_PYTHON_INSTALL(FILES __init__.py diff --git a/gnuradio-core/src/python/gnuradio/blks2/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/blks2/CMakeLists.txt index 3e210100b..83d11dd83 100644 --- a/gnuradio-core/src/python/gnuradio/blks2/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/blks2/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES __init__.py diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt index 8b0baedd9..09797b961 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL(FILES __init__.py diff --git a/gnuradio-core/src/python/gnuradio/gr/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/gr/CMakeLists.txt index bd7541a19..7b62a2f1e 100644 --- a/gnuradio-core/src/python/gnuradio/gr/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/gr/CMakeLists.txt @@ -18,7 +18,7 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL(FILES __init__.py @@ -37,16 +37,16 @@ GR_PYTHON_INSTALL(FILES ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gnuradio-core/src/python/gnuradio/gru/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/gru/CMakeLists.txt index 55971ce5b..1c50989d9 100644 --- a/gnuradio-core/src/python/gnuradio/gru/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/gru/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES __init__.py diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/gruimpl/CMakeLists.txt index aa9338764..7d48f3512 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/gruimpl/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL(FILES __init__.py diff --git a/gnuradio-core/src/tests/CMakeLists.txt b/gnuradio-core/src/tests/CMakeLists.txt index 1096ab66e..6de259116 100644 --- a/gnuradio-core/src/tests/CMakeLists.txt +++ b/gnuradio-core/src/tests/CMakeLists.txt @@ -18,25 +18,25 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrMiscUtils) #check n def +include(GrMiscUtils) #check n def GR_CHECK_HDR_N_DEF(sys/resource.h HAVE_SYS_RESOURCE_H) ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES(${GRUEL_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${GNURADIO_CORE_INCLUDE_DIRS}) +include_directories(${GRUEL_INCLUDE_DIRS}) +include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS}) -LINK_DIRECTORIES(${CPPUNIT_LIBRARY_DIRS}) +include_directories(${CPPUNIT_INCLUDE_DIRS}) +link_directories(${CPPUNIT_LIBRARY_DIRS}) ######################################################################## # Build benchmarks and non-registered tests ######################################################################## -SET(tests_not_run #single source per test +set(tests_not_run #single source per test benchmark_dotprod_fff.cc benchmark_dotprod_fsf.cc benchmark_dotprod_ccf.cc @@ -52,18 +52,18 @@ SET(tests_not_run #single source per test test_vmcircbuf.cc ) -FOREACH(test_not_run_src ${tests_not_run}) - GET_FILENAME_COMPONENT(name ${test_not_run_src} NAME_WE) - ADD_EXECUTABLE(${name} ${test_not_run_src}) - TARGET_LINK_LIBRARIES(${name} test-gnuradio-core) -ENDFOREACH(test_not_run_src) +foreach(test_not_run_src ${tests_not_run}) + get_filename_component(name ${test_not_run_src} NAME_WE) + add_executable(${name} ${test_not_run_src}) + target_link_libraries(${name} test-gnuradio-core) +endforeach(test_not_run_src) ######################################################################## # Build the test-all test to end all tests # Set the test environment so the build libs will be found under MSVC. ######################################################################## -INCLUDE(GrTest) -SET(GR_TEST_TARGET_DEPS gruel gnuradio-core test-gnuradio-core) -ADD_EXECUTABLE(gr_core_test_all test_all.cc) -TARGET_LINK_LIBRARIES(gr_core_test_all test-gnuradio-core) +include(GrTest) +set(GR_TEST_TARGET_DEPS gruel gnuradio-core test-gnuradio-core) +add_executable(gr_core_test_all test_all.cc) +target_link_libraries(gr_core_test_all test-gnuradio-core) GR_ADD_TEST(gr-core-test-all gr_core_test_all) diff --git a/gr-atsc/CMakeLists.txt b/gr-atsc/CMakeLists.txt index 86aa53991..9ed084465 100644 --- a/gr-atsc/CMakeLists.txt +++ b/gr-atsc/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-atsc" ENABLE_GR_ATSC Boost_FOUND ENABLE_GR_CORE_ @@ -38,12 +38,12 @@ GR_SET_GLOBAL(GR_ATSC_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_ATSC) +if(ENABLE_GR_ATSC) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_ATSC_DESCRIPTION "GNU Radio ATSC Blocks") CPACK_COMPONENT("atsc_runtime" @@ -84,23 +84,23 @@ CPACK_COMPONENT("atsc_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src/lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(src/python) -ENDIF(ENABLE_PYTHON) +add_subdirectory(src/lib) +if(ENABLE_PYTHON) + add_subdirectory(src/python) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-atsc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "atsc_devel" ) -ENDIF(ENABLE_GR_ATSC) +endif(ENABLE_GR_ATSC) diff --git a/gr-atsc/src/lib/CMakeLists.txt b/gr-atsc/src/lib/CMakeLists.txt index da104e465..906a86b3f 100644 --- a/gr-atsc/src/lib/CMakeLists.txt +++ b/gr-atsc/src/lib/CMakeLists.txt @@ -20,28 +20,28 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_ATSC_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Generate viterbi mux source # http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build ######################################################################## -IF(NOT CMAKE_CROSSCOMPILING) - ADD_EXECUTABLE(atsci_viterbi_gen atsci_viterbi_gen.cc) - EXPORT(TARGETS atsci_viterbi_gen APPEND FILE ${EXPORT_FILE}) -ENDIF() +if(NOT CMAKE_CROSSCOMPILING) + add_executable(atsci_viterbi_gen atsci_viterbi_gen.cc) + export(TARGETS atsci_viterbi_gen APPEND FILE ${EXPORT_FILE}) +endif() -SET(atsci_viterbi_mux_cc ${CMAKE_CURRENT_BINARY_DIR}/atsci_viterbi_mux.cc) +set(atsci_viterbi_mux_cc ${CMAKE_CURRENT_BINARY_DIR}/atsci_viterbi_mux.cc) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${atsci_viterbi_mux_cc} DEPENDS atsci_viterbi_gen COMMAND atsci_viterbi_gen -o ${atsci_viterbi_mux_cc} @@ -50,7 +50,7 @@ ADD_CUSTOM_COMMAND( ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_atsc_sources +list(APPEND gr_atsc_sources ${atsci_viterbi_mux_cc} atsc_derandomizer.cc atsc_randomizer.cc @@ -94,17 +94,17 @@ LIST(APPEND gr_atsc_sources plinfo.cc ) -LIST(APPEND atsc_libs +list(APPEND atsc_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-atsc SHARED ${gr_atsc_sources}) -TARGET_LINK_LIBRARIES(gnuradio-atsc ${atsc_libs}) -SET_TARGET_PROPERTIES(gnuradio-atsc PROPERTIES DEFINE_SYMBOL "gnuradio_atsc_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-atsc PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-atsc SHARED ${gr_atsc_sources}) +target_link_libraries(gnuradio-atsc ${atsc_libs}) +set_target_properties(gnuradio-atsc PROPERTIES DEFINE_SYMBOL "gnuradio_atsc_EXPORTS") +set_target_properties(gnuradio-atsc PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-atsc +install(TARGETS gnuradio-atsc LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "atsc_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "atsc_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "atsc_runtime" # .dll file @@ -113,12 +113,12 @@ INSTALL(TARGETS gnuradio-atsc ######################################################################## # Build and register unit test ######################################################################## -IF(ENABLE_TESTING) +if(ENABLE_TESTING) -INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS}) -LINK_DIRECTORIES(${CPPUNIT_LIBRARY_DIRS}) +include_directories(${CPPUNIT_INCLUDE_DIRS}) +link_directories(${CPPUNIT_LIBRARY_DIRS}) -LIST(APPEND test_atsci_sources +list(APPEND test_atsci_sources qa_atsci_basic_trellis_encoder.cc qa_atsci_data_interleaver.cc qa_atsci_equalizer_nop.cc @@ -135,18 +135,18 @@ LIST(APPEND test_atsci_sources qa_interleaver_fifo.cc ) -INCLUDE(GrTest) -SET(GR_TEST_TARGET_DEPS gnuradio-atsc gnuradio-core gruel) -ADD_EXECUTABLE(test_atsci ${test_atsci_sources} test_atsci.cc) -TARGET_LINK_LIBRARIES(test_atsci gnuradio-atsc gnuradio-core ${CPPUNIT_LIBRARIES}) +include(GrTest) +set(GR_TEST_TARGET_DEPS gnuradio-atsc gnuradio-core gruel) +add_executable(test_atsci ${test_atsci_sources} test_atsci.cc) +target_link_libraries(test_atsci gnuradio-atsc gnuradio-core ${CPPUNIT_LIBRARIES}) GR_ADD_TEST(atsci-test test_atsci) -ENDIF(ENABLE_TESTING) +endif(ENABLE_TESTING) ######################################################################## # Install public header files ######################################################################## -INSTALL(FILES +install(FILES atsc_api.h atsc_consts.h atsc_derandomizer.h @@ -207,16 +207,16 @@ INSTALL(FILES ######################################################################## # Setup swig generation ######################################################################## -IF(ENABLE_PYTHON) -INCLUDE(GrPython) -INCLUDE(GrSwig) +if(ENABLE_PYTHON) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_ATSC_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-atsc) +set(GR_SWIG_LIBRARIES gnuradio-atsc) GR_SWIG_MAKE(atsc atsc.i) @@ -226,10 +226,10 @@ GR_SWIG_INSTALL( COMPONENT "atsc_python" ) -INSTALL( +install( FILES atsc.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "atsc_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gr-atsc/src/python/CMakeLists.txt b/gr-atsc/src/python/CMakeLists.txt index a8394d3da..c00f51118 100644 --- a/gr-atsc/src/python/CMakeLists.txt +++ b/gr-atsc/src/python/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install python examples ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( PROGRAMS @@ -33,7 +33,7 @@ GR_PYTHON_INSTALL( COMPONENT "atsc_examples" ) -INSTALL( +install( FILES README DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc COMPONENT "atsc_examples" @@ -42,17 +42,17 @@ INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-atsc/src/lib ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-atsc) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-atsc) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-audio/CMakeLists.txt b/gr-audio/CMakeLists.txt index c78a9cc38..839f4a49e 100644 --- a/gr-audio/CMakeLists.txt +++ b/gr-audio/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-audio" ENABLE_GR_AUDIO Boost_FOUND ENABLE_GR_CORE_ @@ -36,12 +36,12 @@ GR_SET_GLOBAL(GR_AUDIO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_AUDIO) +if(ENABLE_GR_AUDIO) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_AUDIO_DESCRIPTION "GNU Radio Audio Blocks") CPACK_COMPONENT("audio_runtime" @@ -75,27 +75,27 @@ CPACK_COMPONENT("audio_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(include) -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(examples/c++) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(examples/python) -ENDIF(ENABLE_PYTHON) +add_subdirectory(include) +add_subdirectory(lib) +add_subdirectory(examples/c++) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(grc) + add_subdirectory(examples/python) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-audio.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-audio.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-audio.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "audio_devel" ) -ENDIF(ENABLE_GR_AUDIO) +endif(ENABLE_GR_AUDIO) diff --git a/gr-audio/examples/c++/CMakeLists.txt b/gr-audio/examples/c++/CMakeLists.txt index 07b5426de..38490cce8 100644 --- a/gr-audio/examples/c++/CMakeLists.txt +++ b/gr-audio/examples/c++/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE_DIRECTORIES(${GR_AUDIO_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${GNURADIO_CORE_INCLUDE_DIRS}) -ADD_EXECUTABLE(dial_tone dial_tone.cc) -TARGET_LINK_LIBRARIES(dial_tone gnuradio-audio) +include_directories(${GR_AUDIO_INCLUDE_DIRS}) +include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) +add_executable(dial_tone dial_tone.cc) +target_link_libraries(dial_tone gnuradio-audio) diff --git a/gr-audio/examples/python/CMakeLists.txt b/gr-audio/examples/python/CMakeLists.txt index c5ca2bba0..86ba86ac0 100644 --- a/gr-audio/examples/python/CMakeLists.txt +++ b/gr-audio/examples/python/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL(PROGRAMS audio_copy.py diff --git a/gr-audio/grc/CMakeLists.txt b/gr-audio/grc/CMakeLists.txt index 067761fed..a077f7fb4 100644 --- a/gr-audio/grc/CMakeLists.txt +++ b/gr-audio/grc/CMakeLists.txt @@ -18,5 +18,5 @@ # Boston, MA 02110-1301, USA. ######################################################################## -FILE(GLOB xml_files "*.xml") -INSTALL(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "audio_python") +file(GLOB xml_files "*.xml") +install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "audio_python") diff --git a/gr-audio/include/CMakeLists.txt b/gr-audio/include/CMakeLists.txt index 9b7ed46c9..6db55e92c 100644 --- a/gr-audio/include/CMakeLists.txt +++ b/gr-audio/include/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES gr_audio_api.h gr_audio_source.h gr_audio_sink.h diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt index f9f3ffec1..214f045be 100644 --- a/gr-audio/lib/CMakeLists.txt +++ b/gr-audio/lib/CMakeLists.txt @@ -20,141 +20,141 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_AUDIO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -LIST(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES}) -LIST(APPEND gr_audio_sources gr_audio_registry.cc) -LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf) +list(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES}) +list(APPEND gr_audio_sources gr_audio_registry.cc) +list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf) ######################################################################## ## ALSA Support ######################################################################## -FIND_PACKAGE(ALSA) +find_package(ALSA) -IF(ALSA_FOUND) +if(ALSA_FOUND) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/alsa ${ALSA_INCLUDE_DIRS}) - LIST(APPEND gr_audio_libs ${ALSA_LIBRARIES}) - LIST(APPEND gr_audio_sources + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/alsa ${ALSA_INCLUDE_DIRS}) + list(APPEND gr_audio_libs ${ALSA_LIBRARIES}) + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/alsa/gri_alsa.cc ${CMAKE_CURRENT_SOURCE_DIR}/alsa/audio_alsa_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/alsa/audio_alsa_sink.cc ) - LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/alsa/gr-audio-alsa.conf) + list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/alsa/gr-audio-alsa.conf) -ENDIF(ALSA_FOUND) +endif(ALSA_FOUND) ######################################################################## ## OSS Support ######################################################################## -FIND_PACKAGE(OSS) +find_package(OSS) -IF(OSS_FOUND) +if(OSS_FOUND) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/oss ${OSS_INCLUDE_DIRS}) - LIST(APPEND gr_audio_sources + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/oss ${OSS_INCLUDE_DIRS}) + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/oss/audio_oss_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/oss/audio_oss_sink.cc ) - LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/oss/gr-audio-oss.conf) + list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/oss/gr-audio-oss.conf) -ENDIF(OSS_FOUND) +endif(OSS_FOUND) ######################################################################## ## Jack Support ######################################################################## -FIND_PACKAGE(Jack) +find_package(Jack) -IF(JACK_FOUND) +if(JACK_FOUND) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/jack ${JACK_INCLUDE_DIRS}) - LIST(APPEND gr_audio_libs ${JACK_LIBRARIES}) - ADD_DEFINITIONS(${JACK_DEFINITIONS}) - LIST(APPEND gr_audio_sources + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/jack ${JACK_INCLUDE_DIRS}) + list(APPEND gr_audio_libs ${JACK_LIBRARIES}) + add_definitions(${JACK_DEFINITIONS}) + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/jack/gri_jack.cc ${CMAKE_CURRENT_SOURCE_DIR}/jack/audio_jack_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/jack/audio_jack_sink.cc ) - LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/jack/gr-audio-jack.conf) + list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/jack/gr-audio-jack.conf) -ENDIF(JACK_FOUND) +endif(JACK_FOUND) ######################################################################## ## OSX Support ######################################################################## -INCLUDE(CheckIncludeFileCXX) +include(CheckIncludeFileCXX) CHECK_INCLUDE_FILE_CXX(AudioUnit/AudioUnit.h AUDIO_UNIT_H) CHECK_INCLUDE_FILE_CXX(AudioToolbox/AudioToolbox.h AUDIO_TOOLBOX_H) -IF(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H) +if(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/osx) - LIST(APPEND gr_audio_libs + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/osx) + list(APPEND gr_audio_libs "-framework AudioUnit" "-framework CoreAudio" "-framework AudioToolbox" "-framework Carbon" ) - LIST(APPEND gr_audio_sources + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/osx/audio_osx_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/osx/audio_osx_sink.cc ) -ENDIF(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H) +endif(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H) ######################################################################## ## PortAudio Support ######################################################################## -FIND_PACKAGE(Portaudio) +find_package(Portaudio) -IF(PORTAUDIO_FOUND) +if(PORTAUDIO_FOUND) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/portaudio ${PORTAUDIO_INCLUDE_DIRS}) - LIST(APPEND gr_audio_libs ${PORTAUDIO_LIBRARIES}) - ADD_DEFINITIONS(${PORTAUDIO_DEFINITIONS}) - LIST(APPEND gr_audio_sources + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/portaudio ${PORTAUDIO_INCLUDE_DIRS}) + list(APPEND gr_audio_libs ${PORTAUDIO_LIBRARIES}) + add_definitions(${PORTAUDIO_DEFINITIONS}) + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gri_portaudio.cc ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/audio_portaudio_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/audio_portaudio_sink.cc ) - LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gr-audio-portaudio.conf) + list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gr-audio-portaudio.conf) -ENDIF(PORTAUDIO_FOUND) +endif(PORTAUDIO_FOUND) ######################################################################## ## Windows Support ######################################################################## -IF(WIN32) +if(WIN32) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/windows) - LIST(APPEND gr_audio_libs winmm.lib) - LIST(APPEND gr_audio_sources + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/windows) + list(APPEND gr_audio_libs winmm.lib) + list(APPEND gr_audio_sources ${CMAKE_CURRENT_SOURCE_DIR}/windows/audio_windows_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/windows/audio_windows_sink.cc ) -ENDIF(WIN32) +endif(WIN32) ######################################################################## # Setup library ######################################################################## -ADD_LIBRARY(gnuradio-audio SHARED ${gr_audio_sources}) -TARGET_LINK_LIBRARIES(gnuradio-audio ${gr_audio_libs}) -SET_TARGET_PROPERTIES(gnuradio-audio PROPERTIES DEFINE_SYMBOL "gnuradio_audio_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-audio PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-audio SHARED ${gr_audio_sources}) +target_link_libraries(gnuradio-audio ${gr_audio_libs}) +set_target_properties(gnuradio-audio PROPERTIES DEFINE_SYMBOL "gnuradio_audio_EXPORTS") +set_target_properties(gnuradio-audio PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-audio +install(TARGETS gnuradio-audio LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "audio_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "audio_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "audio_runtime" # .dll file ) -INSTALL(FILES ${gr_audio_confs} DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "audio_runtime") +install(FILES ${gr_audio_confs} DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "audio_runtime") diff --git a/gr-audio/swig/CMakeLists.txt b/gr-audio/swig/CMakeLists.txt index a113239e9..3e7b7f861 100644 --- a/gr-audio/swig/CMakeLists.txt +++ b/gr-audio/swig/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_AUDIO_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-audio) +set(GR_SWIG_LIBRARIES gnuradio-audio) GR_SWIG_MAKE(audio_swig audio_swig.i) @@ -38,7 +38,7 @@ GR_SWIG_INSTALL( COMPONENT "audio_python" ) -INSTALL( +install( FILES audio_swig.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "audio_swig" diff --git a/gr-comedi/CMakeLists.txt b/gr-comedi/CMakeLists.txt index 16a930b49..9f97ba90d 100644 --- a/gr-comedi/CMakeLists.txt +++ b/gr-comedi/CMakeLists.txt @@ -20,16 +20,16 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -INCLUDE(FindPkgConfig) +include(FindPkgConfig) PKG_CHECK_MODULES(COMEDI comedilib) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-comedi" ENABLE_GR_COMEDI COMEDI_FOUND LINUX #comedi uses linux specific device noces @@ -37,7 +37,7 @@ GR_REGISTER_COMPONENT("gr-comedi" ENABLE_GR_COMEDI ENABLE_GR_CORE_ ) -REMOVE_DEFINITIONS(-fvisibility=hidden) #FIXME until we do symbol visibility +remove_definitions(-fvisibility=hidden) #FIXME until we do symbol visibility GR_SET_GLOBAL(GR_COMEDI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -46,12 +46,12 @@ GR_SET_GLOBAL(GR_COMEDI_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_COMEDI) +if(ENABLE_GR_COMEDI) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_COMEDI_DESCRIPTION "GNU Radio Comedi Blocks") CPACK_COMPONENT("comedi_runtime" @@ -85,20 +85,20 @@ CPACK_COMPONENT("comedi_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src) +add_subdirectory(src) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-comedi.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-comedi.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-comedi.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "comedi_devel" ) -ENDIF(ENABLE_GR_COMEDI) +endif(ENABLE_GR_COMEDI) diff --git a/gr-comedi/src/CMakeLists.txt b/gr-comedi/src/CMakeLists.txt index af1fc372c..e963f9586 100644 --- a/gr-comedi/src/CMakeLists.txt +++ b/gr-comedi/src/CMakeLists.txt @@ -20,38 +20,38 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_COMEDI_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${COMEDI_INCLUDE_DIRS}) -LINK_DIRECTORIES(${COMEDI_LIBRARY_DIRS}) +include_directories(${COMEDI_INCLUDE_DIRS}) +link_directories(${COMEDI_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_comedi_sources +list(APPEND gr_comedi_sources comedi_sink_s.cc comedi_source_s.cc gri_comedi.cc ) -LIST(APPEND comedi_libs +list(APPEND comedi_libs gnuradio-core ${Boost_LIBRARIES} ${COMEDI_LIBRARIES} ) -ADD_LIBRARY(gnuradio-comedi SHARED ${gr_comedi_sources}) -TARGET_LINK_LIBRARIES(gnuradio-comedi ${comedi_libs}) -SET_TARGET_PROPERTIES(gnuradio-comedi PROPERTIES DEFINE_SYMBOL "gnuradio_comedi_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-comedi PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-comedi SHARED ${gr_comedi_sources}) +target_link_libraries(gnuradio-comedi ${comedi_libs}) +set_target_properties(gnuradio-comedi PROPERTIES DEFINE_SYMBOL "gnuradio_comedi_EXPORTS") +set_target_properties(gnuradio-comedi PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-comedi +install(TARGETS gnuradio-comedi LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "comedi_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "comedi_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "comedi_runtime" # .dll file @@ -60,7 +60,7 @@ INSTALL(TARGETS gnuradio-comedi ######################################################################## # Install public header files ######################################################################## -INSTALL(FILES +install(FILES comedi_sink_s.h comedi_source_s.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio @@ -70,16 +70,16 @@ INSTALL(FILES ######################################################################## # Setup swig generation ######################################################################## -IF(ENABLE_PYTHON) -INCLUDE(GrPython) -INCLUDE(GrSwig) +if(ENABLE_PYTHON) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_COMEDI_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-comedi) +set(GR_SWIG_LIBRARIES gnuradio-comedi) GR_SWIG_MAKE(comedi comedi.i) @@ -89,28 +89,28 @@ GR_SWIG_INSTALL( COMPONENT "comedi_python" ) -INSTALL( +install( FILES comedi.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "comedi_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING AND ENABLE_PYTHON) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING AND ENABLE_PYTHON) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-comedi/src ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-comedi) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-comedi) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING AND ENABLE_PYTHON) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING AND ENABLE_PYTHON) diff --git a/gr-digital/CMakeLists.txt b/gr-digital/CMakeLists.txt index 23bb48f94..babf64eee 100644 --- a/gr-digital/CMakeLists.txt +++ b/gr-digital/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-digital" ENABLE_GR_DIGITAL Boost_FOUND ENABLE_GR_CORE_ @@ -42,12 +42,12 @@ GR_SET_GLOBAL(GR_DIGITAL_SWIG_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_DIGITAL) +if(ENABLE_GR_DIGITAL) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_DIGITAL_DESCRIPTION "GNU Radio Digital Blocks") CPACK_COMPONENT("digital_runtime" @@ -81,27 +81,27 @@ CPACK_COMPONENT("digital_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(include) -ADD_SUBDIRECTORY(lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(python) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(examples) -ENDIF(ENABLE_PYTHON) +add_subdirectory(include) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) + add_subdirectory(grc) + add_subdirectory(examples) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-digital.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-digital.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-digital.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "digital_devel" ) -ENDIF(ENABLE_GR_DIGITAL) +endif(ENABLE_GR_DIGITAL) diff --git a/gr-digital/examples/CMakeLists.txt b/gr-digital/examples/CMakeLists.txt index 964596ae8..9632c1638 100644 --- a/gr-digital/examples/CMakeLists.txt +++ b/gr-digital/examples/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL(PROGRAMS transmit_path.py diff --git a/gr-digital/grc/CMakeLists.txt b/gr-digital/grc/CMakeLists.txt index 89c6db6e2..daca55253 100644 --- a/gr-digital/grc/CMakeLists.txt +++ b/gr-digital/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INSTALL(FILES +install(FILES digital_block_tree.xml digital_binary_slicer_fb.xml digital_clock_recovery_mm_xx.xml diff --git a/gr-digital/include/CMakeLists.txt b/gr-digital/include/CMakeLists.txt index 7b38e645b..f5d4d76b6 100644 --- a/gr-digital/include/CMakeLists.txt +++ b/gr-digital/include/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES digital_api.h digital_binary_slicer_fb.h digital_clock_recovery_mm_cc.h diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt index 7cd89a56f..c100453c2 100644 --- a/gr-digital/lib/CMakeLists.txt +++ b/gr-digital/lib/CMakeLists.txt @@ -20,18 +20,18 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_DIGITAL_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_digital_sources +list(APPEND gr_digital_sources digital_binary_slicer_fb.cc digital_clock_recovery_mm_cc.cc digital_clock_recovery_mm_ff.cc @@ -50,17 +50,17 @@ LIST(APPEND gr_digital_sources digital_cpmmod_bc.cc ) -LIST(APPEND digital_libs +list(APPEND digital_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-digital SHARED ${gr_digital_sources}) -TARGET_LINK_LIBRARIES(gnuradio-digital ${digital_libs}) -SET_TARGET_PROPERTIES(gnuradio-digital PROPERTIES DEFINE_SYMBOL "gnuradio_digital_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-digital PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-digital SHARED ${gr_digital_sources}) +target_link_libraries(gnuradio-digital ${digital_libs}) +set_target_properties(gnuradio-digital PROPERTIES DEFINE_SYMBOL "gnuradio_digital_EXPORTS") +set_target_properties(gnuradio-digital PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-digital +install(TARGETS gnuradio-digital LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "digital_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "digital_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "digital_runtime" # .dll file diff --git a/gr-digital/python/CMakeLists.txt b/gr-digital/python/CMakeLists.txt index db4feb9af..7f810f14d 100644 --- a/gr-digital/python/CMakeLists.txt +++ b/gr-digital/python/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup python install ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES @@ -54,18 +54,18 @@ GR_PYTHON_INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-digital/python ${CMAKE_BINARY_DIR}/gr-digital/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-digital) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-digital) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-digital/swig/CMakeLists.txt b/gr-digital/swig/CMakeLists.txt index b1e6fd4e0..3df218d6e 100644 --- a/gr-digital/swig/CMakeLists.txt +++ b/gr-digital/swig/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_DIGITAL_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-digital) +set(GR_SWIG_LIBRARIES gnuradio-digital) GR_SWIG_MAKE(digital_swig digital_swig.i) @@ -38,7 +38,7 @@ GR_SWIG_INSTALL( COMPONENT "digital_python" ) -INSTALL( +install( FILES digital_binary_slicer_fb.i digital_clock_recovery_mm_cc.i diff --git a/gr-howto-write-a-block-cmake/CMakeLists.txt b/gr-howto-write-a-block-cmake/CMakeLists.txt index 9de061414..b6d9f7bb5 100644 --- a/gr-howto-write-a-block-cmake/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/CMakeLists.txt @@ -21,34 +21,34 @@ ######################################################################## # Project setup ######################################################################## -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(gr-howto-write-a-block CXX) -ENABLE_TESTING() +cmake_minimum_required(VERSION 2.6) +project(gr-howto-write-a-block CXX) +enable_testing() #select the release build type by default to get optimization flags -IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Release") - MESSAGE(STATUS "Build type not specified: defaulting to release.") -ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + message(STATUS "Build type not specified: defaulting to release.") +endif(NOT CMAKE_BUILD_TYPE) +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) ######################################################################## # Compiler specific setup ######################################################################## -IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) #http://gcc.gnu.org/wiki/Visibility - ADD_DEFINITIONS(-fvisibility=hidden) -ENDIF() + add_definitions(-fvisibility=hidden) +endif() ######################################################################## # Find boost ######################################################################## -IF(UNIX AND EXISTS "/usr/lib64") - LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix -ENDIF(UNIX AND EXISTS "/usr/lib64") -SET(Boost_ADDITIONAL_VERSIONS +if(UNIX AND EXISTS "/usr/lib64") + list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix +endif(UNIX AND EXISTS "/usr/lib64") +set(Boost_ADDITIONAL_VERSIONS "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49" @@ -57,37 +57,37 @@ SET(Boost_ADDITIONAL_VERSIONS "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" ) -FIND_PACKAGE(Boost "1.35") +find_package(Boost "1.35") -IF(NOT Boost_FOUND) - MESSAGE(FATAL_ERROR "Boost required to compile howto") -ENDIF() +if(NOT Boost_FOUND) + message(FATAL_ERROR "Boost required to compile howto") +endif() ######################################################################## # Find gnuradio build dependencies ######################################################################## -FIND_PACKAGE(Gruel) -FIND_PACKAGE(GnuradioCore) +find_package(Gruel) +find_package(GnuradioCore) -IF(NOT GRUEL_FOUND) - MESSAGE(FATAL_ERROR "Gruel required to compile howto") -ENDIF() +if(NOT GRUEL_FOUND) + message(FATAL_ERROR "Gruel required to compile howto") +endif() -IF(NOT GNURADIO_CORE_FOUND) - MESSAGE(FATAL_ERROR "GnuRadio Core required to compile howto") -ENDIF() +if(NOT GNURADIO_CORE_FOUND) + message(FATAL_ERROR "GnuRadio Core required to compile howto") +endif() ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_SOURCE_DIR}/lib ${Boost_INCLUDE_DIRS} ${GRUEL_INCLUDE_DIRS} ${GNURADIO_CORE_INCLUDE_DIRS} ) -LINK_DIRECTORIES( +link_directories( ${Boost_LIBRARY_DIRS} ${GRUEL_LIBRARY_DIRS} ${GNURADIO_CORE_LIBRARY_DIRS} @@ -96,8 +96,8 @@ LINK_DIRECTORIES( ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(swig) -ADD_SUBDIRECTORY(python) -ADD_SUBDIRECTORY(grc) -ADD_SUBDIRECTORY(apps) +add_subdirectory(lib) +add_subdirectory(swig) +add_subdirectory(python) +add_subdirectory(grc) +add_subdirectory(apps) diff --git a/gr-howto-write-a-block-cmake/apps/CMakeLists.txt b/gr-howto-write-a-block-cmake/apps/CMakeLists.txt index e89cae26b..a736fb2d0 100644 --- a/gr-howto-write-a-block-cmake/apps/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/apps/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( PROGRAMS diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrPlatform.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrPlatform.cmake index 85f318618..ce2e15fef 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrPlatform.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrPlatform.cmake @@ -17,30 +17,30 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_PLATFORM_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) + return() +endif() +set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) ######################################################################## # Setup additional defines for OS types ######################################################################## -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - SET(LINUX TRUE) -ENDIF() +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(LINUX TRUE) +endif() -IF(LINUX AND EXISTS "/etc/debian_version") - SET(DEBIAN TRUE) -ENDIF() +if(LINUX AND EXISTS "/etc/debian_version") + set(DEBIAN TRUE) +endif() -IF(LINUX AND EXISTS "/etc/redhat-release") - SET(REDHAT TRUE) -ENDIF() +if(LINUX AND EXISTS "/etc/redhat-release") + set(REDHAT TRUE) +endif() ######################################################################## # when the library suffix should be 64 (applies to redhat linux family) ######################################################################## -IF(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") - SET(LIB_SUFFIX 64) -ENDIF() -SET(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") +if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") + set(LIB_SUFFIX 64) +endif() +set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrPython.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrPython.cmake index f54dbc9ba..da0590d42 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrPython.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrPython.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_PYTHON_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_PYTHON_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_PYTHON_CMAKE) + return() +endif() +set(__INCLUDED_GR_PYTHON_CMAKE TRUE) ######################################################################## # Setup the python interpreter: @@ -28,28 +28,28 @@ SET(__INCLUDED_GR_PYTHON_CMAKE TRUE) # or finds the interpreter via the built-in cmake module. ######################################################################## #this allows the user to override PYTHON_EXECUTABLE -IF(PYTHON_EXECUTABLE) +if(PYTHON_EXECUTABLE) - SET(PYTHONINTERP_FOUND TRUE) + set(PYTHONINTERP_FOUND TRUE) #otherwise if not set, try to automatically find it -ELSE(PYTHON_EXECUTABLE) +else(PYTHON_EXECUTABLE) #use the built-in find script - FIND_PACKAGE(PythonInterp) + find_package(PythonInterp) #and if that fails use the find program routine - IF(NOT PYTHONINTERP_FOUND) - FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python python2.7 python2.6 python2.5) - IF(PYTHON_EXECUTABLE) - SET(PYTHONINTERP_FOUND TRUE) - ENDIF(PYTHON_EXECUTABLE) - ENDIF(NOT PYTHONINTERP_FOUND) + if(NOT PYTHONINTERP_FOUND) + find_program(PYTHON_EXECUTABLE NAMES python python2.7 python2.6 python2.5) + if(PYTHON_EXECUTABLE) + set(PYTHONINTERP_FOUND TRUE) + endif(PYTHON_EXECUTABLE) + endif(NOT PYTHONINTERP_FOUND) -ENDIF(PYTHON_EXECUTABLE) +endif(PYTHON_EXECUTABLE) #make the path to the executable appear in the cmake gui -SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") +set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") ######################################################################## # Check for the existence of a python module: @@ -58,10 +58,10 @@ SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") # - cmd an additional command to run # - have the result variable to set ######################################################################## -MACRO(GR_PYTHON_CHECK_MODULE desc mod cmd have) - MESSAGE(STATUS "") - MESSAGE(STATUS "Python checking for ${desc}") - EXECUTE_PROCESS( +macro(GR_PYTHON_CHECK_MODULE desc mod cmd have) + message(STATUS "") + message(STATUS "Python checking for ${desc}") + execute_process( COMMAND ${PYTHON_EXECUTABLE} -c " ######################################### try: import ${mod} @@ -71,87 +71,87 @@ except: exit(-1) #########################################" RESULT_VARIABLE ${have} ) - IF(${have} EQUAL 0) - MESSAGE(STATUS "Python checking for ${desc} - found") - SET(${have} TRUE) - ELSE(${have} EQUAL 0) - MESSAGE(STATUS "Python checking for ${desc} - not found") - SET(${have} FALSE) - ENDIF(${have} EQUAL 0) -ENDMACRO(GR_PYTHON_CHECK_MODULE) + if(${have} EQUAL 0) + message(STATUS "Python checking for ${desc} - found") + set(${have} TRUE) + else(${have} EQUAL 0) + message(STATUS "Python checking for ${desc} - not found") + set(${have} FALSE) + endif(${have} EQUAL 0) +endmacro(GR_PYTHON_CHECK_MODULE) ######################################################################## # Sets the python installation directory GR_PYTHON_DIR ######################################################################## -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " from distutils import sysconfig print sysconfig.get_python_lib(plat_specific=True, prefix='') " OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) -FILE(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) +file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) ######################################################################## # Create an always-built target with a unique name # Usage: GR_UNIQUE_TARGET(<description> <dependencies list>) ######################################################################## -FUNCTION(GR_UNIQUE_TARGET desc) - FILE(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib +function(GR_UNIQUE_TARGET desc) + file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) - ADD_CUSTOM_TARGET(${_target} ALL DEPENDS ${ARGN}) -ENDFUNCTION(GR_UNIQUE_TARGET) + add_custom_target(${_target} ALL DEPENDS ${ARGN}) +endfunction(GR_UNIQUE_TARGET) ######################################################################## # Install python sources (also builds and installs byte-compiled python) ######################################################################## -FUNCTION(GR_PYTHON_INSTALL) - INCLUDE(CMakeParseArgumentsCopy) +function(GR_PYTHON_INSTALL) + include(CMakeParseArgumentsCopy) CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) #################################################################### - IF(GR_PYTHON_INSTALL_FILES) + if(GR_PYTHON_INSTALL_FILES) #################################################################### - INSTALL(${ARGN}) #installs regular python files + install(${ARGN}) #installs regular python files - FOREACH(pyfile ${GR_PYTHON_INSTALL_FILES}) - GET_FILENAME_COMPONENT(pyfile_name ${pyfile} NAME) - GET_FILENAME_COMPONENT(pyfile ${pyfile} ABSOLUTE) - STRING(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pycfile "${pyfile}c") - LIST(APPEND python_install_gen_targets ${pycfile}) + foreach(pyfile ${GR_PYTHON_INSTALL_FILES}) + get_filename_component(pyfile_name ${pyfile} NAME) + get_filename_component(pyfile ${pyfile} ABSOLUTE) + string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pycfile "${pyfile}c") + list(APPEND python_install_gen_targets ${pycfile}) - GET_FILENAME_COMPONENT(pycfile_path ${pycfile} PATH) - FILE(MAKE_DIRECTORY ${pycfile_path}) + get_filename_component(pycfile_path ${pycfile} PATH) + file(MAKE_DIRECTORY ${pycfile_path}) #create a command to generate the byte-compiled pyc file - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${pycfile} DEPENDS ${pyfile} COMMAND ${PYTHON_EXECUTABLE} -c \"import py_compile\; py_compile.compile(file='${pyfile}', cfile='${pycfile}', doraise=True)\" COMMENT "Byte-compiling ${pyfile_name}" ) - INSTALL(FILES ${pycfile} + install(FILES ${pycfile} DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} ) - ENDFOREACH(pyfile) + endforeach(pyfile) #################################################################### - ELSEIF(GR_PYTHON_INSTALL_PROGRAMS) + elseif(GR_PYTHON_INSTALL_PROGRAMS) #################################################################### - FILE(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) + file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) - FOREACH(pyfile ${GR_PYTHON_INSTALL_PROGRAMS}) - GET_FILENAME_COMPONENT(pyfile_name ${pyfile} NAME) - GET_FILENAME_COMPONENT(pyfile ${pyfile} ABSOLUTE) - STRING(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") - LIST(APPEND python_install_gen_targets ${pyexefile}) + foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS}) + get_filename_component(pyfile_name ${pyfile} NAME) + get_filename_component(pyfile ${pyfile} ABSOLUTE) + string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") + list(APPEND python_install_gen_targets ${pyexefile}) - GET_FILENAME_COMPONENT(pyexefile_path ${pyexefile} PATH) - FILE(MAKE_DIRECTORY ${pyexefile_path}) + get_filename_component(pyexefile_path ${pyexefile} PATH) + file(MAKE_DIRECTORY ${pyexefile_path}) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${pyexefile} DEPENDS ${pyfile} COMMAND ${PYTHON_EXECUTABLE} -c \"open('${pyexefile}', 'w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())\" @@ -159,19 +159,19 @@ FUNCTION(GR_PYTHON_INSTALL) ) #on windows, python files need an extension to execute - GET_FILENAME_COMPONENT(pyfile_ext ${pyfile} EXT) - IF(WIN32 AND NOT pyfile_ext) - SET(pyfile_name "${pyfile_name}.py") - ENDIF() + get_filename_component(pyfile_ext ${pyfile} EXT) + if(WIN32 AND NOT pyfile_ext) + set(pyfile_name "${pyfile_name}.py") + endif() - INSTALL(PROGRAMS ${pyexefile} RENAME ${pyfile_name} + install(PROGRAMS ${pyexefile} RENAME ${pyfile_name} DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} ) - ENDFOREACH(pyfile) + endforeach(pyfile) - ENDIF() + endif() GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) -ENDFUNCTION(GR_PYTHON_INSTALL) +endfunction(GR_PYTHON_INSTALL) diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake index 0d4cce2b3..0fa1c7b77 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake @@ -17,12 +17,12 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_SWIG_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_SWIG_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_SWIG_CMAKE) + return() +endif() +set(__INCLUDED_GR_SWIG_CMAKE TRUE) -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Build a swig target for the common gnuradio use case. Usage: @@ -35,11 +35,11 @@ INCLUDE(GrPython) # - GR_SWIG_SOURCE_DEPS # - GR_SWIG_TARGET_DEPS ######################################################################## -MACRO(GR_SWIG_MAKE name) - SET(ifiles ${ARGN}) +macro(GR_SWIG_MAKE name) + set(ifiles ${ARGN}) #determine include dependencies for swig file - EXECUTE_PROCESS( + execute_process( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/get_swig_deps.py "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}" OUTPUT_STRIP_TRAILING_WHITESPACE @@ -48,30 +48,30 @@ MACRO(GR_SWIG_MAKE name) ) #append the specified include directories - INCLUDE_DIRECTORIES(${GR_SWIG_INCLUDE_DIRS}) - LIST(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS}) + include_directories(${GR_SWIG_INCLUDE_DIRS}) + list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS}) - FIND_PACKAGE(PythonLibs) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS}) + find_package(PythonLibs) + include_directories(${PYTHON_INCLUDE_DIRS}) #setup the swig flags with flags and include directories - SET(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) - FOREACH(dir ${GR_SWIG_INCLUDE_DIRS}) - LIST(APPEND CMAKE_SWIG_FLAGS "-I${dir}") - ENDFOREACH(dir) + set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) + foreach(dir ${GR_SWIG_INCLUDE_DIRS}) + list(APPEND CMAKE_SWIG_FLAGS "-I${dir}") + endforeach(dir) #set the C++ property on the swig .i file so it builds - SET_SOURCE_FILES_PROPERTIES(${ifiles} PROPERTIES CPLUSPLUS ON) + set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON) #setup the actual swig library target to be built - INCLUDE(UseSWIG) + include(UseSWIG) SWIG_ADD_MODULE(${name} python ${ifiles}) SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES}) - IF(GR_SWIG_TARGET_DEPS) - ADD_DEPENDENCIES(${SWIG_MODULE_${name}_REAL_NAME} ${GR_SWIG_TARGET_DEPS}) - ENDIF(GR_SWIG_TARGET_DEPS) + if(GR_SWIG_TARGET_DEPS) + add_dependencies(${SWIG_MODULE_${name}_REAL_NAME} ${GR_SWIG_TARGET_DEPS}) + endif(GR_SWIG_TARGET_DEPS) -ENDMACRO(GR_SWIG_MAKE) +endmacro(GR_SWIG_MAKE) ######################################################################## # Install swig targets generated by GR_SWIG_MAKE. Usage: @@ -81,25 +81,25 @@ ENDMACRO(GR_SWIG_MAKE) # [COMPONENT component] # ) ######################################################################## -MACRO(GR_SWIG_INSTALL) +macro(GR_SWIG_INSTALL) - INCLUDE(CMakeParseArgumentsCopy) + include(CMakeParseArgumentsCopy) CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) - FOREACH(name ${GR_SWIG_INSTALL_TARGETS}) - INSTALL(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} + foreach(name ${GR_SWIG_INSTALL_TARGETS}) + install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} DESTINATION ${GR_SWIG_INSTALL_DESTINATION} COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - INCLUDE(GrPython) + include(GrPython) GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py DESTINATION ${GR_SWIG_INSTALL_DESTINATION} COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - ENDFOREACH(name) + endforeach(name) -ENDMACRO(GR_SWIG_INSTALL) +endmacro(GR_SWIG_INSTALL) ######################################################################## # Generate a python file that can determine swig dependencies. @@ -107,7 +107,7 @@ ENDMACRO(GR_SWIG_INSTALL) # When you build C++, CMake figures out the header dependencies. # This code essentially performs that logic for swig includes. ######################################################################## -FILE(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py " +file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py " import os, sys, re diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrTest.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrTest.cmake index e9e2a0c2e..9ec3141f9 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrTest.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrTest.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_TEST_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_TEST_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_TEST_CMAKE) + return() +endif() +set(__INCLUDED_GR_TEST_CMAKE TRUE) ######################################################################## # Add a unit test and setup the environment for a unit test. @@ -31,41 +31,41 @@ SET(__INCLUDED_GR_TEST_CMAKE TRUE) # GR_TEST_LIBRARY_DIRS - directories for the library path # GR_TEST_PYTHON_DIRS - directories for the python path ######################################################################## -FUNCTION(GR_ADD_TEST test_name) +function(GR_ADD_TEST test_name) - IF(WIN32) + if(WIN32) #Ensure that the build exe also appears in the PATH. - LIST(APPEND GR_TEST_TARGET_DEPS ${ARGN}) + list(APPEND GR_TEST_TARGET_DEPS ${ARGN}) #In the land of windows, all libraries must be in the PATH. #Since the dependent libraries are not yet installed, #we must manually set them in the PATH to run tests. #The following appends the path of a target dependency. - FOREACH(target ${GR_TEST_TARGET_DEPS}) - GET_TARGET_PROPERTY(location ${target} LOCATION) - IF(location) - GET_FILENAME_COMPONENT(path ${location} PATH) - STRING(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) - LIST(APPEND GR_TEST_LIBRARY_DIRS ${path}) - ENDIF(location) - ENDFOREACH(target) + foreach(target ${GR_TEST_TARGET_DEPS}) + get_target_property(location ${target} LOCATION) + if(location) + get_filename_component(path ${location} PATH) + string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) + list(APPEND GR_TEST_LIBRARY_DIRS ${path}) + endif(location) + endforeach(target) #SWIG generates the python library files into a subdirectory. #Therefore, we must append this subdirectory into PYTHONPATH. #Only do this for the python directories matching the following: - FOREACH(pydir ${GR_TEST_PYTHON_DIRS}) - GET_FILENAME_COMPONENT(name ${pydir} NAME) - IF(name MATCHES "^(swig|lib|src)$") - LIST(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE}) - ENDIF() - ENDFOREACH(pydir) - ENDIF(WIN32) + foreach(pydir ${GR_TEST_PYTHON_DIRS}) + get_filename_component(name ${pydir} NAME) + if(name MATCHES "^(swig|lib|src)$") + list(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE}) + endif() + endforeach(pydir) + endif(WIN32) - FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir) - FILE(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? - FILE(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? + file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir) + file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? + file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? - SET(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") + set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") #http://www.cmake.org/pipermail/cmake/2009-May/029464.html #Replaced this add test + set environs code with the shell script generation. @@ -73,61 +73,61 @@ FUNCTION(GR_ADD_TEST test_name) #ADD_TEST(${ARGV}) #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}") - IF(UNIX) - SET(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH") + if(UNIX) + set(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH") #set both LD and DYLD paths to cover multiple UNIX OS library paths - LIST(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_PATH") - LIST(APPEND pypath "$PYTHONPATH") + list(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_PATH") + list(APPEND pypath "$PYTHONPATH") #replace list separator with the path separator - STRING(REPLACE ";" ":" libpath "${libpath}") - STRING(REPLACE ";" ":" pypath "${pypath}") - LIST(APPEND environs "PATH=${binpath}" "LD_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${pypath}") + string(REPLACE ";" ":" libpath "${libpath}") + string(REPLACE ";" ":" pypath "${pypath}") + list(APPEND environs "PATH=${binpath}" "LD_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${pypath}") #generate a bat file that sets the environment and runs the test - FIND_PROGRAM(SHELL sh) - SET(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh) - FILE(WRITE ${sh_file} "#!${SHELL}\n") + find_program(SHELL sh) + set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh) + file(WRITE ${sh_file} "#!${SHELL}\n") #each line sets an environment variable - FOREACH(environ ${environs}) - FILE(APPEND ${sh_file} "export ${environ}\n") - ENDFOREACH(environ) + foreach(environ ${environs}) + file(APPEND ${sh_file} "export ${environ}\n") + endforeach(environ) #load the command to run with its arguments - FOREACH(arg ${ARGN}) - FILE(APPEND ${sh_file} "${arg} ") - ENDFOREACH(arg) - FILE(APPEND ${sh_file} "\n") + foreach(arg ${ARGN}) + file(APPEND ${sh_file} "${arg} ") + endforeach(arg) + file(APPEND ${sh_file} "\n") #make the shell file executable - EXECUTE_PROCESS(COMMAND chmod +x ${sh_file}) + execute_process(COMMAND chmod +x ${sh_file}) - ADD_TEST(${test_name} ${SHELL} ${sh_file}) + add_test(${test_name} ${SHELL} ${sh_file}) - ENDIF(UNIX) + endif(UNIX) - IF(WIN32) - LIST(APPEND libpath ${DLL_PATHS} "%PATH%") - LIST(APPEND pypath "%PYTHONPATH%") + if(WIN32) + list(APPEND libpath ${DLL_PATHS} "%PATH%") + list(APPEND pypath "%PYTHONPATH%") #replace list separator with the path separator (escaped) - STRING(REPLACE ";" "\\;" libpath "${libpath}") - STRING(REPLACE ";" "\\;" pypath "${pypath}") - LIST(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}") + string(REPLACE ";" "\\;" libpath "${libpath}") + string(REPLACE ";" "\\;" pypath "${pypath}") + list(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}") #generate a bat file that sets the environment and runs the test - SET(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat) - FILE(WRITE ${bat_file} "@echo off\n") + set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat) + file(WRITE ${bat_file} "@echo off\n") #each line sets an environment variable - FOREACH(environ ${environs}) - FILE(APPEND ${bat_file} "SET ${environ}\n") - ENDFOREACH(environ) + foreach(environ ${environs}) + file(APPEND ${bat_file} "SET ${environ}\n") + endforeach(environ) #load the command to run with its arguments - FOREACH(arg ${ARGN}) - FILE(APPEND ${bat_file} "${arg} ") - ENDFOREACH(arg) - FILE(APPEND ${bat_file} "\n") + foreach(arg ${ARGN}) + file(APPEND ${bat_file} "${arg} ") + endforeach(arg) + file(APPEND ${bat_file} "\n") - ADD_TEST(${test_name} ${bat_file}) - ENDIF(WIN32) + add_test(${test_name} ${bat_file}) + endif(WIN32) -ENDFUNCTION(GR_ADD_TEST) +endfunction(GR_ADD_TEST) diff --git a/gr-howto-write-a-block-cmake/grc/CMakeLists.txt b/gr-howto-write-a-block-cmake/grc/CMakeLists.txt index 257113079..cc43db7ba 100644 --- a/gr-howto-write-a-block-cmake/grc/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INSTALL(FILES +install(FILES howto_square_ff.xml howto_square2_ff.xml DESTINATION share/gnuradio/grc/blocks diff --git a/gr-howto-write-a-block-cmake/lib/CMakeLists.txt b/gr-howto-write-a-block-cmake/lib/CMakeLists.txt index a2b6da950..21eb280da 100644 --- a/gr-howto-write-a-block-cmake/lib/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/lib/CMakeLists.txt @@ -20,16 +20,16 @@ ######################################################################## # Setup library ######################################################################## -INCLUDE(GrPlatform) #define LIB_SUFFIX +include(GrPlatform) #define LIB_SUFFIX -ADD_LIBRARY(gnuradio-howto SHARED howto_square_ff.cc howto_square2_ff.cc) -TARGET_LINK_LIBRARIES(gnuradio-howto ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES}) -SET_TARGET_PROPERTIES(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS") +add_library(gnuradio-howto SHARED howto_square_ff.cc howto_square2_ff.cc) +target_link_libraries(gnuradio-howto ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES}) +set_target_properties(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS") ######################################################################## # Install built library files ######################################################################## -INSTALL(TARGETS gnuradio-howto +install(TARGETS gnuradio-howto LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file RUNTIME DESTINATION bin # .dll file @@ -38,7 +38,7 @@ INSTALL(TARGETS gnuradio-howto ######################################################################## # Install public header files ######################################################################## -INSTALL(FILES +install(FILES howto_api.h howto_square_ff.h howto_square2_ff.h @@ -48,17 +48,17 @@ INSTALL(FILES ######################################################################## # Build and register unit test ######################################################################## -FIND_PACKAGE(Boost COMPONENTS unit_test_framework) +find_package(Boost COMPONENTS unit_test_framework) -INCLUDE(GrTest) -SET(GR_TEST_TARGET_DEPS gnuradio-howto) +include(GrTest) +set(GR_TEST_TARGET_DEPS gnuradio-howto) #turn each test cpp file into an executable with an int main() function -ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) +add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) -ADD_EXECUTABLE(qa_howto_square_ff qa_howto_square_ff.cc) -TARGET_LINK_LIBRARIES(qa_howto_square_ff gnuradio-howto ${Boost_LIBRARIES}) +add_executable(qa_howto_square_ff qa_howto_square_ff.cc) +target_link_libraries(qa_howto_square_ff gnuradio-howto ${Boost_LIBRARIES}) GR_ADD_TEST(qa_howto_square_ff qa_howto_square_ff) -ADD_EXECUTABLE(qa_howto_square2_ff qa_howto_square2_ff.cc) -TARGET_LINK_LIBRARIES(qa_howto_square2_ff gnuradio-howto ${Boost_LIBRARIES}) +add_executable(qa_howto_square2_ff qa_howto_square2_ff.cc) +target_link_libraries(qa_howto_square2_ff gnuradio-howto ${Boost_LIBRARIES}) GR_ADD_TEST(qa_howto_square2_ff qa_howto_square2_ff) diff --git a/gr-howto-write-a-block-cmake/python/CMakeLists.txt b/gr-howto-write-a-block-cmake/python/CMakeLists.txt index 6208f8a87..5da80ef15 100644 --- a/gr-howto-write-a-block-cmake/python/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/python/CMakeLists.txt @@ -20,10 +20,10 @@ ######################################################################## # Include python install macros ######################################################################## -INCLUDE(GrPython) -IF(NOT PYTHONINTERP_FOUND) - RETURN() -ENDIF() +include(GrPython) +if(NOT PYTHONINTERP_FOUND) + return() +endif() ######################################################################## # Install python sources @@ -37,8 +37,8 @@ GR_PYTHON_INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -INCLUDE(GrTest) +include(GrTest) -SET(GR_TEST_TARGET_DEPS gnuradio-howto) -SET(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) +set(GR_TEST_TARGET_DEPS gnuradio-howto) +set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) GR_ADD_TEST(qa_howto ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_howto.py) diff --git a/gr-howto-write-a-block-cmake/swig/CMakeLists.txt b/gr-howto-write-a-block-cmake/swig/CMakeLists.txt index fdf8d8c48..cd3253666 100644 --- a/gr-howto-write-a-block-cmake/swig/CMakeLists.txt +++ b/gr-howto-write-a-block-cmake/swig/CMakeLists.txt @@ -20,22 +20,22 @@ ######################################################################## # Include swig generation macros ######################################################################## -FIND_PACKAGE(SWIG) -FIND_PACKAGE(PythonLibs) -IF(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) - RETURN() -ENDIF() -INCLUDE(GrSwig) -INCLUDE(GrPython) +find_package(SWIG) +find_package(PythonLibs) +if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) + return() +endif() +include(GrSwig) +include(GrPython) ######################################################################## # Setup swig generation ######################################################################## -FOREACH(incdir ${GNURADIO_CORE_INCLUDE_DIRS}) - LIST(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig) -ENDFOREACH(incdir) +foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS}) + list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig) +endforeach(incdir) -SET(GR_SWIG_LIBRARIES gnuradio-howto) +set(GR_SWIG_LIBRARIES gnuradio-howto) GR_SWIG_MAKE(howto_swig howto_swig.i) @@ -47,7 +47,7 @@ GR_SWIG_INSTALL(TARGETS howto_swig DESTINATION ${GR_PYTHON_DIR}/howto) ######################################################################## # Install swig .i files for development ######################################################################## -INSTALL( +install( FILES howto_swig.i howto_square_ff.i diff --git a/gr-noaa/CMakeLists.txt b/gr-noaa/CMakeLists.txt index b854a5e18..eecb3d602 100644 --- a/gr-noaa/CMakeLists.txt +++ b/gr-noaa/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-noaa" ENABLE_GR_NOAA Boost_FOUND ENABLE_GR_CORE_ @@ -38,12 +38,12 @@ GR_SET_GLOBAL(GR_NOAA_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_NOAA) +if(ENABLE_GR_NOAA) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_NOAA_DESCRIPTION "GNU Radio NOAA Blocks") CPACK_COMPONENT("noaa_runtime" @@ -77,11 +77,11 @@ CPACK_COMPONENT("noaa_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(apps) -ENDIF(ENABLE_PYTHON) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(grc) + add_subdirectory(apps) +endif(ENABLE_PYTHON) -ENDIF(ENABLE_GR_NOAA) +endif(ENABLE_GR_NOAA) diff --git a/gr-noaa/apps/CMakeLists.txt b/gr-noaa/apps/CMakeLists.txt index 8ec45eb7d..e692648b5 100644 --- a/gr-noaa/apps/CMakeLists.txt +++ b/gr-noaa/apps/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( PROGRAMS diff --git a/gr-noaa/grc/CMakeLists.txt b/gr-noaa/grc/CMakeLists.txt index 99f8bc837..92d707477 100644 --- a/gr-noaa/grc/CMakeLists.txt +++ b/gr-noaa/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INSTALL(FILES +install(FILES noaa_hrpt_decoder.xml noaa_hrpt_deframer.xml noaa_hrpt_pll_cf.xml diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt index 2388a450e..a3509df84 100644 --- a/gr-noaa/lib/CMakeLists.txt +++ b/gr-noaa/lib/CMakeLists.txt @@ -20,34 +20,34 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_NOAA_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_noaa_sources +list(APPEND gr_noaa_sources noaa_hrpt_decoder.cc noaa_hrpt_deframer.cc noaa_hrpt_pll_cf.cc ) -LIST(APPEND noaa_libs +list(APPEND noaa_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-noaa SHARED ${gr_noaa_sources}) -TARGET_LINK_LIBRARIES(gnuradio-noaa ${noaa_libs}) -SET_TARGET_PROPERTIES(gnuradio-noaa PROPERTIES DEFINE_SYMBOL "gnuradio_noaa_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-noaa PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-noaa SHARED ${gr_noaa_sources}) +target_link_libraries(gnuradio-noaa ${noaa_libs}) +set_target_properties(gnuradio-noaa PROPERTIES DEFINE_SYMBOL "gnuradio_noaa_EXPORTS") +set_target_properties(gnuradio-noaa PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-noaa +install(TARGETS gnuradio-noaa LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "noaa_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "noaa_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "noaa_runtime" # .dll file @@ -56,7 +56,7 @@ INSTALL(TARGETS gnuradio-noaa ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES noaa_api.h noaa_hrpt_decoder.h noaa_hrpt_deframer.h diff --git a/gr-noaa/swig/CMakeLists.txt b/gr-noaa/swig/CMakeLists.txt index 8b8afcb6f..1d754aabb 100644 --- a/gr-noaa/swig/CMakeLists.txt +++ b/gr-noaa/swig/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_NOAA_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-noaa) +set(GR_SWIG_LIBRARIES gnuradio-noaa) GR_SWIG_MAKE(noaa_swig noaa_swig.i) @@ -38,7 +38,7 @@ GR_SWIG_INSTALL( COMPONENT "noaa_python" ) -INSTALL( +install( FILES noaa_swig.i noaa_hrpt_decoder.i diff --git a/gr-pager/CMakeLists.txt b/gr-pager/CMakeLists.txt index ac02a28c9..9d23e617d 100644 --- a/gr-pager/CMakeLists.txt +++ b/gr-pager/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-pager" ENABLE_GR_PAGER Boost_FOUND ENABLE_GR_CORE_ @@ -38,12 +38,12 @@ GR_SET_GLOBAL(GR_PAGER_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_PAGER) +if(ENABLE_GR_PAGER) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_PAGER_DESCRIPTION "GNU Radio Pager Blocks") CPACK_COMPONENT("pager_runtime" @@ -77,26 +77,26 @@ CPACK_COMPONENT("pager_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(python) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(apps) -ENDIF(ENABLE_PYTHON) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(python) + add_subdirectory(swig) + add_subdirectory(grc) + add_subdirectory(apps) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-pager.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pager.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pager.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "pager_devel" ) -ENDIF(ENABLE_GR_PAGER) +endif(ENABLE_GR_PAGER) diff --git a/gr-pager/grc/CMakeLists.txt b/gr-pager/grc/CMakeLists.txt index a9c39c4c4..2b01a1e0b 100644 --- a/gr-pager/grc/CMakeLists.txt +++ b/gr-pager/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INSTALL(FILES +install(FILES pager_slicer_fb.xml pager_flex_sync.xml pager_flex_deinterleave.xml diff --git a/gr-pager/lib/CMakeLists.txt b/gr-pager/lib/CMakeLists.txt index c797f733b..c6899ab20 100644 --- a/gr-pager/lib/CMakeLists.txt +++ b/gr-pager/lib/CMakeLists.txt @@ -20,18 +20,18 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_PAGER_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_pager_sources +list(APPEND gr_pager_sources pager_flex_frame.cc pager_slicer_fb.cc pager_flex_sync.cc @@ -42,17 +42,17 @@ LIST(APPEND gr_pager_sources pageri_util.cc ) -LIST(APPEND pager_libs +list(APPEND pager_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-pager SHARED ${gr_pager_sources}) -TARGET_LINK_LIBRARIES(gnuradio-pager ${pager_libs}) -SET_TARGET_PROPERTIES(gnuradio-pager PROPERTIES DEFINE_SYMBOL "gnuradio_pager_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-pager PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-pager SHARED ${gr_pager_sources}) +target_link_libraries(gnuradio-pager ${pager_libs}) +set_target_properties(gnuradio-pager PROPERTIES DEFINE_SYMBOL "gnuradio_pager_EXPORTS") +set_target_properties(gnuradio-pager PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-pager +install(TARGETS gnuradio-pager LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "pager_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "pager_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "pager_runtime" # .dll file @@ -61,7 +61,7 @@ INSTALL(TARGETS gnuradio-pager ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES pager_api.h pager_slicer_fb.h pager_flex_sync.h diff --git a/gr-pager/python/CMakeLists.txt b/gr-pager/python/CMakeLists.txt index 26fbf6f09..bbbf35a71 100644 --- a/gr-pager/python/CMakeLists.txt +++ b/gr-pager/python/CMakeLists.txt @@ -18,7 +18,7 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES @@ -32,18 +32,18 @@ GR_PYTHON_INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-pager/python ${CMAKE_BINARY_DIR}/gr-pager/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-pager) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-pager) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-pager/swig/CMakeLists.txt b/gr-pager/swig/CMakeLists.txt index 24cab0c9a..bfb34c929 100644 --- a/gr-pager/swig/CMakeLists.txt +++ b/gr-pager/swig/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_PAGER_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-pager) +set(GR_SWIG_LIBRARIES gnuradio-pager) GR_SWIG_MAKE(pager_swig pager_swig.i) @@ -38,7 +38,7 @@ GR_SWIG_INSTALL( COMPONENT "pager_python" ) -INSTALL( +install( FILES pager_swig.i pager_flex_deinterleave.i diff --git a/gr-qtgui/CMakeLists.txt b/gr-qtgui/CMakeLists.txt index 280d856af..3b522fb59 100644 --- a/gr-qtgui/CMakeLists.txt +++ b/gr-qtgui/CMakeLists.txt @@ -20,22 +20,22 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -FIND_PACKAGE(Qt4 4.2.0 COMPONENTS QtCore QtGui) -INCLUDE(${QT_USE_FILE}) #sets up the environment +find_package(Qt4 4.2.0 COMPONENTS QtCore QtGui) +include(${QT_USE_FILE}) #sets up the environment -FIND_PACKAGE(Qwt) +find_package(Qwt) -FIND_PACKAGE(PythonLibs) +find_package(PythonLibs) -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_CHECK_MODULE("PyQt4" PyQt4 True PYQT4_FOUND) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-qtgui" ENABLE_GR_QTGUI Boost_FOUND QT4_FOUND @@ -53,12 +53,12 @@ GR_SET_GLOBAL(GR_QTGUI_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_QTGUI) +if(ENABLE_GR_QTGUI) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_QTGUI_DESCRIPTION "GNU Radio QtGUI Blocks") CPACK_COMPONENT("qtgui_runtime" @@ -92,25 +92,25 @@ CPACK_COMPONENT("qtgui_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(python) -ENDIF(ENABLE_PYTHON) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(grc) + add_subdirectory(swig) + add_subdirectory(python) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-qtgui.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-qtgui.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-qtgui.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "qtgui_devel" ) -ENDIF(ENABLE_GR_QTGUI) +endif(ENABLE_GR_QTGUI) diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt index 023c38b01..370a71725 100644 --- a/gr-qtgui/grc/CMakeLists.txt +++ b/gr-qtgui/grc/CMakeLists.txt @@ -18,5 +18,5 @@ # Boston, MA 02110-1301, USA. ######################################################################## -FILE(GLOB xml_files "*.xml") -INSTALL(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "qtgui_python") +file(GLOB xml_files "*.xml") +install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "qtgui_python") diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index 5bc67573e..6cd9e200a 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup the QT file generations stuff ######################################################################## -SET(qtgui_moc_hdrs +set(qtgui_moc_hdrs spectrumdisplayform.h timedisplayform.h FrequencyDisplayPlot.h @@ -33,12 +33,12 @@ QT4_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) #FIXME the sources expect <foo>.ui.h, but the macros generate ui_foo.h #avoid changing the sources by generating the header with the include -SET(spectrum_ui_hdr ${CMAKE_CURRENT_BINARY_DIR}/spectrumdisplayform.ui.h) -IF(NOT EXISTS ${spectrum_ui_hdr}) - FILE(WRITE ${spectrum_ui_hdr} "#include <ui_spectrumdisplayform.h>\n") -ENDIF(NOT EXISTS ${spectrum_ui_hdr}) +set(spectrum_ui_hdr ${CMAKE_CURRENT_BINARY_DIR}/spectrumdisplayform.ui.h) +if(NOT EXISTS ${spectrum_ui_hdr}) + file(WRITE ${spectrum_ui_hdr} "#include <ui_spectrumdisplayform.h>\n") +endif(NOT EXISTS ${spectrum_ui_hdr}) -SET(qtgui_srcs +set(qtgui_srcs ${qtgui_moc_srcs} ${qtgui_ui_hdrs} FrequencyDisplayPlot.cc @@ -61,37 +61,37 @@ SET(qtgui_srcs ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIRS}) -LINK_DIRECTORIES(${QWT_LIBRARY_DIRS}) +include_directories(${QWT_INCLUDE_DIRS}) +link_directories(${QWT_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS}) +include_directories(${PYTHON_INCLUDE_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND qtgui_libs +list(APPEND qtgui_libs gnuradio-core ${QT_LIBRARIES} ${QWT_LIBRARIES} ${PYTHON_LIBRARIES} ) -ADD_DEFINITIONS(-DQWT_DLL) #setup QWT library linkage -ADD_LIBRARY(gnuradio-qtgui SHARED ${qtgui_srcs}) -TARGET_LINK_LIBRARIES(gnuradio-qtgui ${qtgui_libs}) -SET_TARGET_PROPERTIES(gnuradio-qtgui PROPERTIES DEFINE_SYMBOL "libgnuradio_qtgui_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-qtgui PROPERTIES SOVERSION ${LIBVER}) +add_definitions(-DQWT_DLL) #setup QWT library linkage +add_library(gnuradio-qtgui SHARED ${qtgui_srcs}) +target_link_libraries(gnuradio-qtgui ${qtgui_libs}) +set_target_properties(gnuradio-qtgui PROPERTIES DEFINE_SYMBOL "libgnuradio_qtgui_EXPORTS") +set_target_properties(gnuradio-qtgui PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-qtgui +install(TARGETS gnuradio-qtgui LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "qtgui_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "qtgui_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "qtgui_runtime" # .dll file @@ -100,7 +100,7 @@ INSTALL(TARGETS gnuradio-qtgui ######################################################################## # Install the header files ######################################################################## -INSTALL(FILES +install(FILES FrequencyDisplayPlot.h TimeDomainDisplayPlot.h WaterfallDisplayPlot.h diff --git a/gr-qtgui/python/CMakeLists.txt b/gr-qtgui/python/CMakeLists.txt index e80fa6b75..e61b54f08 100644 --- a/gr-qtgui/python/CMakeLists.txt +++ b/gr-qtgui/python/CMakeLists.txt @@ -18,7 +18,7 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES __init__.py @@ -29,18 +29,18 @@ GR_PYTHON_INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-qtgui/python ${CMAKE_BINARY_DIR}/gr-qtgui/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-qtgui) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-qtgui) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-qtgui/swig/CMakeLists.txt b/gr-qtgui/swig/CMakeLists.txt index 047229944..234af5a68 100644 --- a/gr-qtgui/swig/CMakeLists.txt +++ b/gr-qtgui/swig/CMakeLists.txt @@ -20,16 +20,16 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ${GR_QTGUI_INCLUDE_DIRS} ${QWT_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-qtgui) +set(GR_SWIG_LIBRARIES gnuradio-qtgui) GR_SWIG_MAKE(qtgui_swig qtgui_swig.i) @@ -39,7 +39,7 @@ GR_SWIG_INSTALL( COMPONENT "qtgui_python" ) -INSTALL(FILES +install(FILES qtgui_sink_c.i qtgui_sink_f.i qtgui_time_sink_c.i diff --git a/gr-trellis/CMakeLists.txt b/gr-trellis/CMakeLists.txt index a0ae29f8d..226ea7e4d 100644 --- a/gr-trellis/CMakeLists.txt +++ b/gr-trellis/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-trellis" ENABLE_GR_TRELLIS Boost_FOUND ENABLE_GR_CORE_ @@ -40,12 +40,12 @@ GR_SET_GLOBAL(GR_TRELLIS_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_TRELLIS) +if(ENABLE_GR_TRELLIS) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_TRELLIS_DESCRIPTION "GNU Radio Trellis Blocks") CPACK_COMPONENT("trellis_docs" @@ -92,26 +92,26 @@ CPACK_COMPONENT("trellis_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src/lib) -ADD_SUBDIRECTORY(doc) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(src/python) - ADD_SUBDIRECTORY(src/examples) -ENDIF(ENABLE_PYTHON) +add_subdirectory(src/lib) +add_subdirectory(doc) +if(ENABLE_PYTHON) + add_subdirectory(grc) + add_subdirectory(src/python) + add_subdirectory(src/examples) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-trellis.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-trellis.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-trellis.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "trellis_devel" ) -ENDIF(ENABLE_GR_TRELLIS) +endif(ENABLE_GR_TRELLIS) diff --git a/gr-trellis/doc/CMakeLists.txt b/gr-trellis/doc/CMakeLists.txt index 41ccf7f8e..a45202861 100644 --- a/gr-trellis/doc/CMakeLists.txt +++ b/gr-trellis/doc/CMakeLists.txt @@ -17,33 +17,33 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Generate HTML doc with xmlto ######################################################################## -FIND_PROGRAM(XMLTO_EXECUTABLE xmlto) +find_program(XMLTO_EXECUTABLE xmlto) -IF(XMLTO_EXECUTABLE) -ADD_CUSTOM_COMMAND( +if(XMLTO_EXECUTABLE) +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gr-trellis.html DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gr-trellis.xml COMMAND ${XMLTO_EXECUTABLE} html-nochunks ${CMAKE_CURRENT_SOURCE_DIR}/gr-trellis.xml ) -ADD_CUSTOM_TARGET(gr_trellis_html ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gr-trellis.html) -INSTALL( +add_custom_target(gr_trellis_html ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gr-trellis.html) +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gr-trellis.html DESTINATION ${GR_PKG_DOC_DIR}/html COMPONENT "trellis_docs" ) -ENDIF(XMLTO_EXECUTABLE) +endif(XMLTO_EXECUTABLE) ######################################################################## # Generate xml doc ######################################################################## -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_tcm.py.xml DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test_tcm.py DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/make_numbered_listing.py @@ -52,7 +52,7 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_SOURCE_DIR}/test_tcm.py ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_viterbi_equalization1.py.xml DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test_viterbi_equalization1.py DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/make_numbered_listing.py @@ -61,11 +61,11 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_SOURCE_DIR}/test_viterbi_equalization1.py ) -ADD_CUSTOM_TARGET(gr_trellis_xml ALL DEPENDS +add_custom_target(gr_trellis_xml ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_tcm.py.xml ${CMAKE_CURRENT_BINARY_DIR}/test_viterbi_equalization1.py.xml ) -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/test_tcm.py.xml ${CMAKE_CURRENT_BINARY_DIR}/test_viterbi_equalization1.py.xml DESTINATION ${GR_PKG_DOC_DIR}/xml diff --git a/gr-trellis/grc/CMakeLists.txt b/gr-trellis/grc/CMakeLists.txt index 13188343d..d60d64872 100644 --- a/gr-trellis/grc/CMakeLists.txt +++ b/gr-trellis/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INSTALL(FILES +install(FILES trellis_encoder_xx.xml trellis_siso_combined_f.xml trellis_viterbi_x.xml diff --git a/gr-trellis/src/examples/CMakeLists.txt b/gr-trellis/src/examples/CMakeLists.txt index 2a98c9c67..0d9589908 100644 --- a/gr-trellis/src/examples/CMakeLists.txt +++ b/gr-trellis/src/examples/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( PROGRAMS @@ -37,13 +37,13 @@ GR_PYTHON_INSTALL( COMPONENT "trellis_examples" ) -INSTALL( +install( FILES README DESTINATION ${GR_PKG_DATA_DIR}/examples/trellis COMPONENT "trellis_examples" ) -INSTALL( +install( FILES fsm_files/awgn1o2_128.fsm fsm_files/awgn1o2_16.fsm diff --git a/gr-trellis/src/lib/CMakeLists.txt b/gr-trellis/src/lib/CMakeLists.txt index 3e449bcf8..da41f1469 100644 --- a/gr-trellis/src/lib/CMakeLists.txt +++ b/gr-trellis/src/lib/CMakeLists.txt @@ -20,19 +20,19 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_TRELLIS_INCLUDE_DIRS} ${GR_DIGITAL_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # generate the python helper script which calls into the build utils ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " #!${PYTHON_EXECUTABLE} import sys, os, re @@ -54,37 +54,37 @@ if __name__ == '__main__': ######################################################################## # generation helper macro to generate various files from template ######################################################################## -MACRO(expand_h_cc_i root) +macro(expand_h_cc_i root) - FOREACH(ext h cc i) + foreach(ext h cc i) #make a list of all the generated files - UNSET(expanded_files_${ext}) - FOREACH(sig ${ARGN}) - STRING(REGEX REPLACE "X+" ${sig} name ${root}) - LIST(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext}) - ENDFOREACH(sig) + unset(expanded_files_${ext}) + foreach(sig ${ARGN}) + string(REGEX REPLACE "X+" ${sig} name ${root}) + list(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext}) + endforeach(sig) #create a command to generate the files - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${expanded_files_${ext}} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.${ext}.t COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py ${root} ${root}.${ext}.t ${ARGN} ) - ENDFOREACH(ext) + endforeach(ext) #make source files depends on headers to force generation - SET_SOURCE_FILES_PROPERTIES(${expanded_files_cc} + set_source_files_properties(${expanded_files_cc} PROPERTIES OBJECT_DEPENDS "${expanded_files_h}" ) #install rules for the generated cc, h, and i files - LIST(APPEND generated_trellis_sources ${expanded_files_cc}) - LIST(APPEND generated_trellis_includes ${expanded_files_h}) - LIST(APPEND generated_trellis_swigs ${expanded_files_i}) + list(APPEND generated_trellis_sources ${expanded_files_cc}) + list(APPEND generated_trellis_includes ${expanded_files_h}) + list(APPEND generated_trellis_swigs ${expanded_files_i}) -ENDMACRO(expand_h_cc_i) +endmacro(expand_h_cc_i) ######################################################################## # Invoke macro to generate various sources @@ -100,7 +100,7 @@ expand_h_cc_i(trellis_sccc_decoder_combined_XX fb fs fi cb cs ci) expand_h_cc_i(trellis_pccc_decoder_X b s i) expand_h_cc_i(trellis_pccc_decoder_combined_XX fb fs fi cb cs ci) -ADD_CUSTOM_TARGET(trellis_generated DEPENDS +add_custom_target(trellis_generated DEPENDS ${generated_trellis_includes} ${generated_trellis_swigs} ) @@ -108,28 +108,28 @@ ADD_CUSTOM_TARGET(trellis_generated DEPENDS ######################################################################## # Create the master trellis swig include files ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i " +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i " // // This file is machine generated. All edits will be overwritten // ") -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%{\n") -FOREACH(swig_file ${generated_trellis_swigs}) - GET_FILENAME_COMPONENT(name ${swig_file} NAME_WE) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "#include<${name}.h>\n") -ENDFOREACH(swig_file) -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%}\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%{\n") +foreach(swig_file ${generated_trellis_swigs}) + get_filename_component(name ${swig_file} NAME_WE) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "#include<${name}.h>\n") +endforeach(swig_file) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%}\n") -FOREACH(swig_file ${generated_trellis_swigs}) - GET_FILENAME_COMPONENT(name ${swig_file} NAME) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%include<${name}>\n") -ENDFOREACH(swig_file) +foreach(swig_file ${generated_trellis_swigs}) + get_filename_component(name ${swig_file} NAME) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/trellis_generated.i "%include<${name}>\n") +endforeach(swig_file) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_trellis_sources +list(APPEND gr_trellis_sources fsm.cc quicksort_index.cc base.cc @@ -143,17 +143,17 @@ LIST(APPEND gr_trellis_sources ${generated_trellis_sources} ) -LIST(APPEND trellis_libs +list(APPEND trellis_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-trellis SHARED ${gr_trellis_sources}) -TARGET_LINK_LIBRARIES(gnuradio-trellis ${trellis_libs}) -SET_TARGET_PROPERTIES(gnuradio-trellis PROPERTIES DEFINE_SYMBOL "gnuradio_trellis_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-trellis PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-trellis SHARED ${gr_trellis_sources}) +target_link_libraries(gnuradio-trellis ${trellis_libs}) +set_target_properties(gnuradio-trellis PROPERTIES DEFINE_SYMBOL "gnuradio_trellis_EXPORTS") +set_target_properties(gnuradio-trellis PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-trellis +install(TARGETS gnuradio-trellis LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "trellis_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "trellis_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "trellis_runtime" # .dll file @@ -162,7 +162,7 @@ INSTALL(TARGETS gnuradio-trellis ######################################################################## # Handle the generated sources + a few non-generated ones ######################################################################## -INSTALL(FILES +install(FILES ${generated_trellis_includes} trellis_api.h fsm.h @@ -180,8 +180,8 @@ INSTALL(FILES COMPONENT "trellis_devel" ) -IF(ENABLE_PYTHON) - INSTALL(FILES +if(ENABLE_PYTHON) + install(FILES ${generated_trellis_swigs} fsm.i interleaver.i @@ -197,16 +197,16 @@ IF(ENABLE_PYTHON) ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_TARGET_DEPS gengen_generated trellis_generated) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_TARGET_DEPS gengen_generated trellis_generated) +set(GR_SWIG_INCLUDE_DIRS ${GR_TRELLIS_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ${GR_DIGITAL_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-trellis) +set(GR_SWIG_LIBRARIES gnuradio-trellis) GR_SWIG_MAKE(trellis trellis.i) GR_SWIG_INSTALL( @@ -215,10 +215,10 @@ GR_SWIG_INSTALL( COMPONENT "trellis_python" ) -INSTALL( +install( FILES trellis.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "trellis_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gr-trellis/src/python/CMakeLists.txt b/gr-trellis/src/python/CMakeLists.txt index 9cd645fe4..9a9cc6aed 100644 --- a/gr-trellis/src/python/CMakeLists.txt +++ b/gr-trellis/src/python/CMakeLists.txt @@ -20,18 +20,18 @@ ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-digital/swig ${CMAKE_BINARY_DIR}/gr-trellis/src/lib ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-digital gnuradio-trellis) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-digital gnuradio-trellis) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt index 102320884..d660cfd36 100644 --- a/gr-uhd/CMakeLists.txt +++ b/gr-uhd/CMakeLists.txt @@ -20,14 +20,14 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -FIND_PACKAGE(UHD) +find_package(UHD) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD Boost_FOUND UHD_FOUND @@ -42,12 +42,12 @@ GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_UHD) +if(ENABLE_GR_UHD) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_UHD_DESCRIPTION "GNU Radio UHD Blocks") CPACK_COMPONENT("uhd_runtime" @@ -81,27 +81,27 @@ CPACK_COMPONENT("uhd_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(include) -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(examples) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(grc) - ADD_SUBDIRECTORY(apps) -ENDIF(ENABLE_PYTHON) +add_subdirectory(include) +add_subdirectory(lib) +add_subdirectory(examples) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(grc) + add_subdirectory(apps) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-uhd.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-uhd.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-uhd.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "uhd_devel" ) -ENDIF(ENABLE_GR_UHD) +endif(ENABLE_GR_UHD) diff --git a/gr-uhd/apps/CMakeLists.txt b/gr-uhd/apps/CMakeLists.txt index e17be1d9b..36bee13e0 100644 --- a/gr-uhd/apps/CMakeLists.txt +++ b/gr-uhd/apps/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Install some uhd apps @@ -36,7 +36,7 @@ GR_PYTHON_INSTALL( ######################################################################## # Install hf radio apps ######################################################################## -INSTALL( +install( FILES hf_radio/hfir.sci hf_radio/radio.xml @@ -68,7 +68,7 @@ GR_PYTHON_INSTALL( ######################################################################## # Install hf explorer ######################################################################## -INSTALL( +install( FILES hf_explorer/README hf_explorer/hfx_help diff --git a/gr-uhd/examples/CMakeLists.txt b/gr-uhd/examples/CMakeLists.txt index f5890a484..9e92b89d7 100644 --- a/gr-uhd/examples/CMakeLists.txt +++ b/gr-uhd/examples/CMakeLists.txt @@ -20,28 +20,28 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_UHD_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ) -INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) -LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) +include_directories(${UHD_INCLUDE_DIRS}) +link_directories(${UHD_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Build executable ######################################################################## -ADD_EXECUTABLE(tags_demo tags_demo.cc) -TARGET_LINK_LIBRARIES(tags_demo gnuradio-uhd) +add_executable(tags_demo tags_demo.cc) +target_link_libraries(tags_demo gnuradio-uhd) ######################################################################## # Python examples ######################################################################## -IF(ENABLE_PYTHON) +if(ENABLE_PYTHON) GR_PYTHON_INSTALL( PROGRAMS fm_tx4.py @@ -72,4 +72,4 @@ GR_PYTHON_INSTALL( DESTINATION ${GR_PKG_DATA_DIR}/examples/multi-antenna COMPONENT "uhd_python" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) diff --git a/gr-uhd/grc/CMakeLists.txt b/gr-uhd/grc/CMakeLists.txt index d89b8d77e..3297db8d7 100644 --- a/gr-uhd/grc/CMakeLists.txt +++ b/gr-uhd/grc/CMakeLists.txt @@ -20,24 +20,24 @@ ######################################################################## # Rules for generating the source and sink xml wrappers ######################################################################## -INCLUDE(GrPython) +include(GrPython) -MACRO(GEN_BLOCK_XML _generator _xml_block) - SET(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator}) - SET(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}) - LIST(APPEND xml_blocks ${xml_block}) - ADD_CUSTOM_COMMAND( +macro(GEN_BLOCK_XML _generator _xml_block) + set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator}) + set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}) + list(APPEND xml_blocks ${xml_block}) + add_custom_command( DEPENDS ${generator} OUTPUT ${xml_block} COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block} ) -ENDMACRO(GEN_BLOCK_XML) +endmacro(GEN_BLOCK_XML) GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_source.xml) GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_sink.xml) -ADD_CUSTOM_TARGET(uhd_grc_xml_blocks ALL DEPENDS ${xml_blocks}) +add_custom_target(uhd_grc_xml_blocks ALL DEPENDS ${xml_blocks}) -INSTALL(FILES +install(FILES ${xml_blocks} uhd_amsg_source.xml uhd_block_tree.xml diff --git a/gr-uhd/include/CMakeLists.txt b/gr-uhd/include/CMakeLists.txt index 20d152859..fdd384d58 100644 --- a/gr-uhd/include/CMakeLists.txt +++ b/gr-uhd/include/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES gr_uhd_api.h gr_uhd_usrp_source.h gr_uhd_usrp_sink.h diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt index 8afb48942..fbdca0566 100644 --- a/gr-uhd/lib/CMakeLists.txt +++ b/gr-uhd/lib/CMakeLists.txt @@ -20,38 +20,38 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_UHD_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) -LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) +include_directories(${UHD_INCLUDE_DIRS}) +link_directories(${UHD_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_uhd_sources +list(APPEND gr_uhd_sources gr_uhd_usrp_source.cc gr_uhd_usrp_sink.cc gr_uhd_amsg_source.cc ) -LIST(APPEND uhd_libs +list(APPEND uhd_libs gnuradio-core ${Boost_LIBRARIES} ${UHD_LIBRARIES} ) -ADD_LIBRARY(gnuradio-uhd SHARED ${gr_uhd_sources}) -TARGET_LINK_LIBRARIES(gnuradio-uhd ${uhd_libs}) -SET_TARGET_PROPERTIES(gnuradio-uhd PROPERTIES DEFINE_SYMBOL "gnuradio_uhd_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-uhd PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-uhd SHARED ${gr_uhd_sources}) +target_link_libraries(gnuradio-uhd ${uhd_libs}) +set_target_properties(gnuradio-uhd PROPERTIES DEFINE_SYMBOL "gnuradio_uhd_EXPORTS") +set_target_properties(gnuradio-uhd PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-uhd +install(TARGETS gnuradio-uhd LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "uhd_runtime" # .dll file diff --git a/gr-uhd/swig/CMakeLists.txt b/gr-uhd/swig/CMakeLists.txt index fec3cba6f..4c778b05c 100644 --- a/gr-uhd/swig/CMakeLists.txt +++ b/gr-uhd/swig/CMakeLists.txt @@ -20,17 +20,17 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_FLAGS -DGR_HAVE_UHD) #needed to parse uhd_swig.i +set(GR_SWIG_FLAGS -DGR_HAVE_UHD) #needed to parse uhd_swig.i -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_UHD_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) -SET(GR_SWIG_LIBRARIES gnuradio-uhd ${UHD_LIBRARIES}) +link_directories(${UHD_LIBRARY_DIRS}) +set(GR_SWIG_LIBRARIES gnuradio-uhd ${UHD_LIBRARIES}) GR_SWIG_MAKE(uhd_swig uhd_swig.i) @@ -40,7 +40,7 @@ GR_SWIG_INSTALL( COMPONENT "uhd_python" ) -INSTALL( +install( FILES uhd_swig.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "uhd_swig" diff --git a/gr-video-sdl/CMakeLists.txt b/gr-video-sdl/CMakeLists.txt index 4dc9874ba..43d11dce8 100644 --- a/gr-video-sdl/CMakeLists.txt +++ b/gr-video-sdl/CMakeLists.txt @@ -20,14 +20,14 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -FIND_PACKAGE(SDL) +find_package(SDL) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-video-sdl" ENABLE_GR_VIDEO_SDL SDL_FOUND Boost_FOUND @@ -41,12 +41,12 @@ GR_SET_GLOBAL(GR_VIDEO_SDL_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_VIDEO_SDL) +if(ENABLE_GR_VIDEO_SDL) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_VIDEO_SDL_DESCRIPTION "GNU Radio Video SDL Blocks") CPACK_COMPONENT("video_sdl_runtime" @@ -80,20 +80,20 @@ CPACK_COMPONENT("video_sdl_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src) +add_subdirectory(src) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-video-sdl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-video-sdl.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-video-sdl.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "video_sdl_devel" ) -ENDIF(ENABLE_GR_VIDEO_SDL) +endif(ENABLE_GR_VIDEO_SDL) diff --git a/gr-video-sdl/src/CMakeLists.txt b/gr-video-sdl/src/CMakeLists.txt index 38181075a..9ad5fcbb1 100644 --- a/gr-video-sdl/src/CMakeLists.txt +++ b/gr-video-sdl/src/CMakeLists.txt @@ -20,36 +20,36 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_VIDEO_SDL_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) +include_directories(${SDL_INCLUDE_DIR}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_video_sdl_sources +list(APPEND gr_video_sdl_sources video_sdl_sink_uc.cc video_sdl_sink_s.cc ) -LIST(APPEND video_sdl_libs +list(APPEND video_sdl_libs gnuradio-core ${Boost_LIBRARIES} ${SDL_LIBRARY} ) -ADD_LIBRARY(gnuradio-video-sdl SHARED ${gr_video_sdl_sources}) -TARGET_LINK_LIBRARIES(gnuradio-video-sdl ${video_sdl_libs}) -SET_TARGET_PROPERTIES(gnuradio-video-sdl PROPERTIES DEFINE_SYMBOL "gnuradio_video_sdl_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-video-sdl PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-video-sdl SHARED ${gr_video_sdl_sources}) +target_link_libraries(gnuradio-video-sdl ${video_sdl_libs}) +set_target_properties(gnuradio-video-sdl PROPERTIES DEFINE_SYMBOL "gnuradio_video_sdl_EXPORTS") +set_target_properties(gnuradio-video-sdl PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-video-sdl +install(TARGETS gnuradio-video-sdl LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "video_sdl_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "video_sdl_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "video_sdl_runtime" # .dll file @@ -58,7 +58,7 @@ INSTALL(TARGETS gnuradio-video-sdl ######################################################################## # Install public header files ######################################################################## -INSTALL(FILES +install(FILES video_sdl_api.h video_sdl_sink_uc.h video_sdl_sink_s.h @@ -69,16 +69,16 @@ INSTALL(FILES ######################################################################## # Setup swig generation ######################################################################## -IF(ENABLE_PYTHON) -INCLUDE(GrPython) -INCLUDE(GrSwig) +if(ENABLE_PYTHON) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_COMEDI_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-video-sdl) +set(GR_SWIG_LIBRARIES gnuradio-video-sdl) GR_SWIG_MAKE(video_sdl video_sdl.i) @@ -88,28 +88,28 @@ GR_SWIG_INSTALL( COMPONENT "video_sdl_python" ) -INSTALL( +install( FILES video_sdl.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "video_sdl_swig" ) -ENDIF(ENABLE_PYTHON) +endif(ENABLE_PYTHON) ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING AND ENABLE_PYTHON) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING AND ENABLE_PYTHON) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-video-sdl/src ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-video-sdl) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-video-sdl) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING AND ENABLE_PYTHON) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING AND ENABLE_PYTHON) diff --git a/gr-vocoder/CMakeLists.txt b/gr-vocoder/CMakeLists.txt index 16ee6bbf0..d14366400 100644 --- a/gr-vocoder/CMakeLists.txt +++ b/gr-vocoder/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-vocoder" ENABLE_GR_VOCODER Boost_FOUND ENABLE_GR_CORE_ @@ -38,12 +38,12 @@ GR_SET_GLOBAL(GR_VOCODER_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GR_VOCODER) +if(ENABLE_GR_VOCODER) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_VOCODER_DESCRIPTION "GNU Radio Vocoder Blocks") CPACK_COMPONENT("vocoder_runtime" @@ -84,26 +84,26 @@ CPACK_COMPONENT("vocoder_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(include) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(swig) - ADD_SUBDIRECTORY(python) - ADD_SUBDIRECTORY(examples) -ENDIF(ENABLE_PYTHON) +add_subdirectory(lib) +add_subdirectory(include) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) + add_subdirectory(examples) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-vocoder.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-vocoder.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-vocoder.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "vocoder_devel" ) -ENDIF(ENABLE_GR_VOCODER) +endif(ENABLE_GR_VOCODER) diff --git a/gr-vocoder/examples/CMakeLists.txt b/gr-vocoder/examples/CMakeLists.txt index 9f8172a75..76a757826 100644 --- a/gr-vocoder/examples/CMakeLists.txt +++ b/gr-vocoder/examples/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install Examples ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( PROGRAMS diff --git a/gr-vocoder/include/CMakeLists.txt b/gr-vocoder/include/CMakeLists.txt index 390a0afb5..23099f59e 100644 --- a/gr-vocoder/include/CMakeLists.txt +++ b/gr-vocoder/include/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Install header files ######################################################################## -INSTALL(FILES +install(FILES vocoder_api.h vocoder_alaw_decode_bs.h vocoder_alaw_encode_sb.h diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt index 74138b050..abcae3b56 100644 --- a/gr-vocoder/lib/CMakeLists.txt +++ b/gr-vocoder/lib/CMakeLists.txt @@ -20,18 +20,18 @@ ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES( +include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_VOCODER_INCLUDE_DIRS} ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gr_vocoder_sources +list(APPEND gr_vocoder_sources vocoder_alaw_decode_bs.cc vocoder_alaw_encode_sb.cc vocoder_codec2_decode_ps.cc @@ -57,17 +57,17 @@ GR_INCLUDE_SUBDIRECTORY(codec2) GR_INCLUDE_SUBDIRECTORY(g7xx) GR_INCLUDE_SUBDIRECTORY(gsm) -LIST(APPEND vocoder_libs +list(APPEND vocoder_libs gnuradio-core ${Boost_LIBRARIES} ) -ADD_LIBRARY(gnuradio-vocoder SHARED ${gr_vocoder_sources}) -TARGET_LINK_LIBRARIES(gnuradio-vocoder ${vocoder_libs}) -SET_TARGET_PROPERTIES(gnuradio-vocoder PROPERTIES DEFINE_SYMBOL "gnuradio_vocoder_EXPORTS") -SET_TARGET_PROPERTIES(gnuradio-vocoder PROPERTIES SOVERSION ${LIBVER}) +add_library(gnuradio-vocoder SHARED ${gr_vocoder_sources}) +target_link_libraries(gnuradio-vocoder ${vocoder_libs}) +set_target_properties(gnuradio-vocoder PROPERTIES DEFINE_SYMBOL "gnuradio_vocoder_EXPORTS") +set_target_properties(gnuradio-vocoder PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gnuradio-vocoder +install(TARGETS gnuradio-vocoder LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "vocoder_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "vocoder_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "vocoder_runtime" # .dll file diff --git a/gr-vocoder/lib/codec2/CMakeLists.txt b/gr-vocoder/lib/codec2/CMakeLists.txt index 3a666fb59..c9839bd96 100644 --- a/gr-vocoder/lib/codec2/CMakeLists.txt +++ b/gr-vocoder/lib/codec2/CMakeLists.txt @@ -21,17 +21,17 @@ # Create executable to generate other sources # http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build ######################################################################## -IF(NOT CMAKE_CROSSCOMPILING) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) - ADD_EXECUTABLE(generate_codebook ${CMAKE_CURRENT_SOURCE_DIR}/generate_codebook.c) - TARGET_LINK_LIBRARIES(generate_codebook -lm) - EXPORT(TARGETS generate_codebook APPEND FILE ${EXPORT_FILE}) -ENDIF() +if(NOT CMAKE_CROSSCOMPILING) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + add_executable(generate_codebook ${CMAKE_CURRENT_SOURCE_DIR}/generate_codebook.c) + target_link_libraries(generate_codebook -lm) + export(TARGETS generate_codebook APPEND FILE ${EXPORT_FILE}) +endif() ######################################################################## # Create codebook ######################################################################## -SET(CODEBOOKS +set(CODEBOOKS ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp1.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp2.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp3.txt @@ -44,7 +44,7 @@ SET(CODEBOOKS ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp10.txt ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebook.c DEPENDS generate_codebook ${CODEBOOKS} COMMAND generate_codebook lsp_cb ${CODEBOOKS} > ${CMAKE_CURRENT_BINARY_DIR}/codebook.c @@ -53,7 +53,7 @@ ADD_CUSTOM_COMMAND( ######################################################################## # Create codebookd ######################################################################## -SET(CODEBOOKSD +set(CODEBOOKSD ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp1.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp2.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp3.txt @@ -66,7 +66,7 @@ SET(CODEBOOKSD ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp10.txt ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c DEPENDS generate_codebook ${CODEBOOKSD} COMMAND generate_codebook lsp_cbd ${CODEBOOKSD} > ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c @@ -75,7 +75,7 @@ ADD_CUSTOM_COMMAND( ######################################################################## # Create codebookdvq ######################################################################## -SET(CODEBOOKSDVQ +set(CODEBOOKSDVQ ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp1.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp2.txt ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp3.txt @@ -83,7 +83,7 @@ SET(CODEBOOKSDVQ ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp5.txt ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c DEPENDS generate_codebook ${CODEBOOKSDVQ} COMMAND generate_codebook lsp_cbdvq ${CODEBOOKSDVQ} > ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c @@ -92,7 +92,7 @@ ADD_CUSTOM_COMMAND( ######################################################################## # Append all sources in this dir ######################################################################## -LIST(APPEND gr_vocoder_sources +list(APPEND gr_vocoder_sources ${CMAKE_CURRENT_BINARY_DIR}/codebook.c ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c diff --git a/gr-vocoder/lib/g7xx/CMakeLists.txt b/gr-vocoder/lib/g7xx/CMakeLists.txt index 4c67109e1..bde7538d2 100644 --- a/gr-vocoder/lib/g7xx/CMakeLists.txt +++ b/gr-vocoder/lib/g7xx/CMakeLists.txt @@ -20,8 +20,8 @@ ######################################################################## # Append all sources in this dir ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -LIST(APPEND gr_vocoder_sources +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +list(APPEND gr_vocoder_sources ${CMAKE_CURRENT_SOURCE_DIR}/g711.c ${CMAKE_CURRENT_SOURCE_DIR}/g72x.c ${CMAKE_CURRENT_SOURCE_DIR}/g721.c diff --git a/gr-vocoder/lib/gsm/CMakeLists.txt b/gr-vocoder/lib/gsm/CMakeLists.txt index 128f87231..8a4813a4f 100644 --- a/gr-vocoder/lib/gsm/CMakeLists.txt +++ b/gr-vocoder/lib/gsm/CMakeLists.txt @@ -20,9 +20,9 @@ ######################################################################## # Append all sources in this dir ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -SET(gsm_sources +set(gsm_sources ${CMAKE_CURRENT_SOURCE_DIR}/add.c ${CMAKE_CURRENT_SOURCE_DIR}/code.c ${CMAKE_CURRENT_SOURCE_DIR}/debug.c @@ -43,7 +43,7 @@ SET(gsm_sources ${CMAKE_CURRENT_SOURCE_DIR}/table.c ) -SET_SOURCE_FILES_PROPERTIES(${gsm_sources} +set_source_files_properties(${gsm_sources} PROPERTIES COMPILE_DEFINITION "NeedFunctionPrototypes=1" ) -LIST(APPEND gr_vocoder_sources ${gsm_sources}) +list(APPEND gr_vocoder_sources ${gsm_sources}) diff --git a/gr-vocoder/python/CMakeLists.txt b/gr-vocoder/python/CMakeLists.txt index c3702ad70..c2d9a6c24 100644 --- a/gr-vocoder/python/CMakeLists.txt +++ b/gr-vocoder/python/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup python install ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES @@ -33,18 +33,18 @@ GR_PYTHON_INSTALL( ######################################################################## # Handle the unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-vocoder/python ${CMAKE_BINARY_DIR}/gr-vocoder/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-vocoder) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-vocoder) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-vocoder/swig/CMakeLists.txt b/gr-vocoder/swig/CMakeLists.txt index 61d123a74..3a8e16ebf 100644 --- a/gr-vocoder/swig/CMakeLists.txt +++ b/gr-vocoder/swig/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS +set(GR_SWIG_INCLUDE_DIRS ${GR_VOCODER_INCLUDE_DIRS} ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ) -SET(GR_SWIG_LIBRARIES gnuradio-vocoder) +set(GR_SWIG_LIBRARIES gnuradio-vocoder) GR_SWIG_MAKE(vocoder_swig vocoder_swig.i) @@ -38,7 +38,7 @@ GR_SWIG_INSTALL( COMPONENT "vocoder_python" ) -INSTALL( +install( FILES vocoder_alaw_decode_bs.i vocoder_alaw_encode_sb.i diff --git a/gr-wxgui/CMakeLists.txt b/gr-wxgui/CMakeLists.txt index 7002ce91b..5bb9c3824 100644 --- a/gr-wxgui/CMakeLists.txt +++ b/gr-wxgui/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_CHECK_MODULE("wx >= 2.8" wx "wx.version().split()[0] >= '2.8'" WX_FOUND) GR_PYTHON_CHECK_MODULE("numpy" numpy True NUMPY_FOUND) @@ -28,7 +28,7 @@ GR_PYTHON_CHECK_MODULE("numpy" numpy True ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_WXGUI ENABLE_GR_CORE_ ENABLE_PYTHON_ @@ -39,12 +39,12 @@ GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_WXGUI ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_WXGUI) +if(ENABLE_WXGUI) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_COMPONENT("wxgui" DISPLAY_NAME "WxGUI" DESCRIPTION "Wx GUI plotter widgets and grc wrappers" @@ -54,12 +54,12 @@ CPACK_COMPONENT("wxgui" ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gr-wxgui.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gr-wxgui.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gr-wxgui.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "wxgui" @@ -68,7 +68,7 @@ INSTALL( ######################################################################## # Install the conf file ######################################################################## -INSTALL( +install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr-wxgui.conf DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "wxgui" @@ -77,7 +77,7 @@ INSTALL( ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(grc) -ADD_SUBDIRECTORY(src/python) +add_subdirectory(grc) +add_subdirectory(src/python) -ENDIF(ENABLE_WXGUI) +endif(ENABLE_WXGUI) diff --git a/gr-wxgui/grc/CMakeLists.txt b/gr-wxgui/grc/CMakeLists.txt index c39b5cfbe..49e3da3b1 100644 --- a/gr-wxgui/grc/CMakeLists.txt +++ b/gr-wxgui/grc/CMakeLists.txt @@ -18,13 +18,13 @@ # Boston, MA 02110-1301, USA. ######################################################################## -FILE(GLOB xml_files "*.xml") -INSTALL(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "wxgui") +file(GLOB xml_files "*.xml") +install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "wxgui") ######################################################################## #The wxgui module contains a top_block + wxgui frame. ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_INSTALL( FILES diff --git a/gr-wxgui/src/python/CMakeLists.txt b/gr-wxgui/src/python/CMakeLists.txt index da86d4a81..24e06acd5 100644 --- a/gr-wxgui/src/python/CMakeLists.txt +++ b/gr-wxgui/src/python/CMakeLists.txt @@ -18,7 +18,7 @@ # Boston, MA 02110-1301, USA. ######################################################################## -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Install python files into wxgui module diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index eec35d27c..cc7696210 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrPython) +include(GrPython) GR_PYTHON_CHECK_MODULE("python >= 2.5" sys "sys.version.split()[0] >= '2.5'" PYTHON_MIN_VER_FOUND) GR_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0" Cheetah "Cheetah.Version >= '2.0.0'" CHEETAH_FOUND) @@ -31,15 +31,15 @@ GR_PYTHON_CHECK_MODULE("numpy" numpy True ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) -IF(NOT CMAKE_CROSSCOMPILING) - SET(grc_python_deps +include(GrComponent) +if(NOT CMAKE_CROSSCOMPILING) + set(grc_python_deps CHEETAH_FOUND LXML_FOUND PYGTK_FOUND NUMPY_FOUND ) -ENDIF(NOT CMAKE_CROSSCOMPILING) +endif(NOT CMAKE_CROSSCOMPILING) GR_REGISTER_COMPONENT("gnuradio-companion" ENABLE_GRC ENABLE_GR_CORE_ @@ -51,12 +51,12 @@ GR_REGISTER_COMPONENT("gnuradio-companion" ENABLE_GRC ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GRC) +if(ENABLE_GRC) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_COMPONENT("grc" DISPLAY_NAME "GNU Radio Companion" DESCRIPTION "Graphical flow graph designer" @@ -66,15 +66,15 @@ CPACK_COMPONENT("grc" ######################################################################## # Create and install the grc conf file ######################################################################## -FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GR_PKG_DOC_DIR} docdir) -FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GRC_BLOCKS_DIR} blocksdir) +file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GR_PKG_DOC_DIR} docdir) +file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GRC_BLOCKS_DIR} blocksdir) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/grc.conf.in ${CMAKE_CURRENT_BINARY_DIR}/grc.conf @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grc.conf DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "grc" @@ -89,14 +89,14 @@ GR_PYTHON_INSTALL( ######################################################################## # Appens NSIS commands to set environment variables ######################################################################## -FILE(TO_NATIVE_PATH ${GR_PKG_DOC_DIR} GR_DOC_DIR) -STRING(REPLACE "\\" "\\\\" GR_DOC_DIR ${GR_DOC_DIR}) +file(TO_NATIVE_PATH ${GR_PKG_DOC_DIR} GR_DOC_DIR) +string(REPLACE "\\" "\\\\" GR_DOC_DIR ${GR_DOC_DIR}) -FILE(TO_NATIVE_PATH ${GRC_BLOCKS_DIR} GRC_BLOCKS_PATH) -STRING(REPLACE "\\" "\\\\" GRC_BLOCKS_PATH ${GRC_BLOCKS_PATH}) +file(TO_NATIVE_PATH ${GRC_BLOCKS_DIR} GRC_BLOCKS_PATH) +string(REPLACE "\\" "\\\\" GRC_BLOCKS_PATH ${GRC_BLOCKS_PATH}) -FILE(TO_NATIVE_PATH ${GR_PYTHON_DIR} GR_PYTHON_POSTFIX) -STRING(REPLACE "\\" "\\\\" GR_PYTHON_POSTFIX ${GR_PYTHON_POSTFIX}) +file(TO_NATIVE_PATH ${GR_PYTHON_DIR} GR_PYTHON_POSTFIX) +string(REPLACE "\\" "\\\\" GR_PYTHON_POSTFIX ${GR_PYTHON_POSTFIX}) CPACK_SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} WriteRegStr HKLM ${HLKM_ENV} \\\"GR_DOC_DIR\\\" \\\"$INSTDIR\\\\${GR_DOC_DIR}\\\" @@ -113,12 +113,12 @@ CPACK_SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMM ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(base) -ADD_SUBDIRECTORY(blocks) -ADD_SUBDIRECTORY(freedesktop) -ADD_SUBDIRECTORY(grc_gnuradio) -ADD_SUBDIRECTORY(gui) -ADD_SUBDIRECTORY(python) -ADD_SUBDIRECTORY(scripts) - -ENDIF(ENABLE_GRC) +add_subdirectory(base) +add_subdirectory(blocks) +add_subdirectory(freedesktop) +add_subdirectory(grc_gnuradio) +add_subdirectory(gui) +add_subdirectory(python) +add_subdirectory(scripts) + +endif(ENABLE_GRC) diff --git a/grc/base/CMakeLists.txt b/grc/base/CMakeLists.txt index 81d39e69c..c6d6a09eb 100644 --- a/grc/base/CMakeLists.txt +++ b/grc/base/CMakeLists.txt @@ -34,7 +34,7 @@ GR_PYTHON_INSTALL(FILES COMPONENT "grc" ) -INSTALL(FILES +install(FILES block_tree.dtd flow_graph.dtd DESTINATION ${GR_PYTHON_DIR}/gnuradio/grc/base diff --git a/grc/blocks/CMakeLists.txt b/grc/blocks/CMakeLists.txt index 393a91b27..ad31b0975 100644 --- a/grc/blocks/CMakeLists.txt +++ b/grc/blocks/CMakeLists.txt @@ -18,5 +18,5 @@ # Boston, MA 02110-1301, USA. ######################################################################## -FILE(GLOB xml_files "*.xml") -INSTALL(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "grc") +file(GLOB xml_files "*.xml") +install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "grc") diff --git a/grc/freedesktop/CMakeLists.txt b/grc/freedesktop/CMakeLists.txt index 2e74dd3be..8c0f53d9f 100644 --- a/grc/freedesktop/CMakeLists.txt +++ b/grc/freedesktop/CMakeLists.txt @@ -18,9 +18,9 @@ # Boston, MA 02110-1301, USA. ######################################################################## -SET(grc_freedesktop_path ${GR_PKG_DATA_DIR}/grc/freedesktop) +set(grc_freedesktop_path ${GR_PKG_DATA_DIR}/grc/freedesktop) -INSTALL(FILES +install(FILES grc-icon-256.png grc-icon-128.png grc-icon-64.png @@ -32,16 +32,16 @@ INSTALL(FILES COMPONENT "grc" ) -FIND_PROGRAM(HAVE_XDG_UTILS xdg-desktop-menu) +find_program(HAVE_XDG_UTILS xdg-desktop-menu) -IF(UNIX AND HAVE_XDG_UTILS) - SET(SRCDIR ${CMAKE_INSTALL_PREFIX}/${grc_freedesktop_path}) - CONFIGURE_FILE( +if(UNIX AND HAVE_XDG_UTILS) + set(SRCDIR ${CMAKE_INSTALL_PREFIX}/${grc_freedesktop_path}) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/grc_setup_freedesktop.in ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop @ONLY) - INSTALL( + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop DESTINATION ${GR_PKG_LIBEXEC_DIR} COMPONENT "grc" ) -ENDIF(UNIX AND HAVE_XDG_UTILS) +endif(UNIX AND HAVE_XDG_UTILS) diff --git a/grc/python/CMakeLists.txt b/grc/python/CMakeLists.txt index 50ec6d0ba..2075d126d 100644 --- a/grc/python/CMakeLists.txt +++ b/grc/python/CMakeLists.txt @@ -36,7 +36,7 @@ GR_PYTHON_INSTALL(FILES COMPONENT "grc" ) -INSTALL(FILES +install(FILES block.dtd default_flow_graph.grc flow_graph.tmpl diff --git a/gruel/CMakeLists.txt b/gruel/CMakeLists.txt index 933e74b2f..b33217c14 100644 --- a/gruel/CMakeLists.txt +++ b/gruel/CMakeLists.txt @@ -20,20 +20,20 @@ ######################################################################## # Setup dependencies ######################################################################## -INCLUDE(GrBoost) +include(GrBoost) -INCLUDE(GrPython) #used for code generation +include(GrPython) #used for code generation ######################################################################## # Register component ######################################################################## -INCLUDE(GrComponent) +include(GrComponent) GR_REGISTER_COMPONENT("gruel" ENABLE_GRUEL Boost_FOUND PYTHONINTERP_FOUND ) -INCLUDE(GrMiscUtils) +include(GrMiscUtils) GR_SET_GLOBAL(GRUEL_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src/include @@ -43,12 +43,12 @@ GR_SET_GLOBAL(GRUEL_INCLUDE_DIRS ######################################################################## # Begin conditional configuration ######################################################################## -IF(ENABLE_GRUEL) +if(ENABLE_GRUEL) ######################################################################## # Setup CPack components ######################################################################## -INCLUDE(GrPackage) +include(GrPackage) CPACK_SET(CPACK_COMPONENT_GROUP_GRUEL_DESCRIPTION "GNU Radio Utility Etcetera Library") CPACK_COMPONENT("gruel_runtime" @@ -80,26 +80,26 @@ CPACK_COMPONENT("gruel_swig" ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(src/include/gruel) -ADD_SUBDIRECTORY(src/scheme/gnuradio) -ADD_SUBDIRECTORY(src/lib) -IF(ENABLE_PYTHON) - ADD_SUBDIRECTORY(src/swig) - ADD_SUBDIRECTORY(src/python) -ENDIF(ENABLE_PYTHON) +add_subdirectory(src/include/gruel) +add_subdirectory(src/scheme/gnuradio) +add_subdirectory(src/lib) +if(ENABLE_PYTHON) + add_subdirectory(src/swig) + add_subdirectory(src/python) +endif(ENABLE_PYTHON) ######################################################################## # Create Pkg Config File ######################################################################## -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gruel.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gruel.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gruel.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig COMPONENT "gruel_devel" ) -ENDIF(ENABLE_GRUEL) +endif(ENABLE_GRUEL) diff --git a/gruel/src/include/gruel/CMakeLists.txt b/gruel/src/include/gruel/CMakeLists.txt index 2f80043a4..811856b98 100644 --- a/gruel/src/include/gruel/CMakeLists.txt +++ b/gruel/src/include/gruel/CMakeLists.txt @@ -20,15 +20,15 @@ ######################################################################## # Generate inet.h header file ######################################################################## -INCLUDE(TestBigEndian) -ENABLE_LANGUAGE(C) +include(TestBigEndian) +enable_language(C) TEST_BIG_ENDIAN(GR_ARCH_BIGENDIAN) -INCLUDE(CheckIncludeFileCXX) +include(CheckIncludeFileCXX) CHECK_INCLUDE_FILE_CXX(byteswap.h GR_HAVE_BYTESWAP) CHECK_INCLUDE_FILE_CXX(arpa/inet.h GR_HAVE_ARPA_INET) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/inet.h.in ${CMAKE_CURRENT_BINARY_DIR}/inet.h @ONLY) @@ -36,7 +36,7 @@ CONFIGURE_FILE( ######################################################################## # Install the headers ######################################################################## -INSTALL(FILES +install(FILES api.h attributes.h high_res_timer.h diff --git a/gruel/src/lib/CMakeLists.txt b/gruel/src/lib/CMakeLists.txt index d078e52f9..b54e644bc 100644 --- a/gruel/src/lib/CMakeLists.txt +++ b/gruel/src/lib/CMakeLists.txt @@ -20,13 +20,13 @@ ######################################################################## # Include subdirs rather to populate to the sources lists. ######################################################################## -INCLUDE(GrMiscUtils) -INCLUDE(CheckCXXSourceCompiles) +include(GrMiscUtils) +include(CheckCXXSourceCompiles) GR_CHECK_HDR_N_DEF(signal.h HAVE_SIGNAL_H) GR_CHECK_HDR_N_DEF(sched.h HAVE_SCHED_H) -SET(CMAKE_REQUIRED_LIBRARIES -lpthread) +set(CMAKE_REQUIRED_LIBRARIES -lpthread) CHECK_CXX_SOURCE_COMPILES(" #include <signal.h> int main(){pthread_sigmask(0, 0, 0); return 0;} @@ -34,7 +34,7 @@ CHECK_CXX_SOURCE_COMPILES(" ) GR_ADD_COND_DEF(HAVE_PTHREAD_SIGMASK) -SET(CMAKE_REQUIRED_LIBRARIES -lpthread) +set(CMAKE_REQUIRED_LIBRARIES -lpthread) CHECK_CXX_SOURCE_COMPILES(" #include <pthread.h> int main(){ @@ -64,28 +64,28 @@ GR_INCLUDE_SUBDIRECTORY(pmt) ######################################################################## # Setup the include and linker paths ######################################################################## -INCLUDE_DIRECTORIES(${GRUEL_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${GRUEL_INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) ######################################################################## # Setup library ######################################################################## -LIST(APPEND gruel_sources +list(APPEND gruel_sources realtime.cc sys_pri.cc thread_body_wrapper.cc thread_group.cc ) -ADD_LIBRARY(gruel SHARED ${gruel_sources}) -TARGET_LINK_LIBRARIES(gruel ${Boost_LIBRARIES}) -SET_TARGET_PROPERTIES(gruel PROPERTIES DEFINE_SYMBOL "gruel_EXPORTS") -SET_TARGET_PROPERTIES(gruel PROPERTIES SOVERSION ${LIBVER}) +add_library(gruel SHARED ${gruel_sources}) +target_link_libraries(gruel ${Boost_LIBRARIES}) +set_target_properties(gruel PROPERTIES DEFINE_SYMBOL "gruel_EXPORTS") +set_target_properties(gruel PROPERTIES SOVERSION ${LIBVER}) -INSTALL(TARGETS gruel +install(TARGETS gruel LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "gruel_runtime" # .so/.dylib file ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "gruel_devel" # .lib file RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "gruel_runtime" # .dll file @@ -95,16 +95,16 @@ INSTALL(TARGETS gruel # Setup tests # Set the test environment so the build libs will be found under MSVC. ######################################################################## -IF(ENABLE_TESTING) +if(ENABLE_TESTING) -INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS}) -LINK_DIRECTORIES(${CPPUNIT_LIBRARY_DIRS}) +include_directories(${CPPUNIT_INCLUDE_DIRS}) +link_directories(${CPPUNIT_LIBRARY_DIRS}) -INCLUDE(GrTest) -SET(GR_TEST_TARGET_DEPS gruel) -LIST(APPEND test_gruel_sources test_gruel.cc) -ADD_EXECUTABLE(test_gruel ${test_gruel_sources}) -TARGET_LINK_LIBRARIES(test_gruel gruel ${CPPUNIT_LIBRARIES}) +include(GrTest) +set(GR_TEST_TARGET_DEPS gruel) +list(APPEND test_gruel_sources test_gruel.cc) +add_executable(test_gruel ${test_gruel_sources}) +target_link_libraries(test_gruel gruel ${CPPUNIT_LIBRARIES}) GR_ADD_TEST(gruel-test test_gruel) -ENDIF(ENABLE_TESTING) +endif(ENABLE_TESTING) diff --git a/gruel/src/lib/msg/CMakeLists.txt b/gruel/src/lib/msg/CMakeLists.txt index 877cc2909..116d2c67f 100644 --- a/gruel/src/lib/msg/CMakeLists.txt +++ b/gruel/src/lib/msg/CMakeLists.txt @@ -21,7 +21,7 @@ # This file included, use CMake directory variables ######################################################################## -LIST(APPEND gruel_sources +list(APPEND gruel_sources ${CMAKE_CURRENT_SOURCE_DIR}/msg_accepter.cc ${CMAKE_CURRENT_SOURCE_DIR}/msg_accepter_msgq.cc ${CMAKE_CURRENT_SOURCE_DIR}/msg_queue.cc diff --git a/gruel/src/lib/pmt/CMakeLists.txt b/gruel/src/lib/pmt/CMakeLists.txt index 797db475a..a708fa7ad 100644 --- a/gruel/src/lib/pmt/CMakeLists.txt +++ b/gruel/src/lib/pmt/CMakeLists.txt @@ -20,21 +20,21 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) ######################################################################## # Generate serial tags header file ######################################################################## -GET_FILENAME_COMPONENT(SCHEME_DIR +get_filename_component(SCHEME_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../scheme/gnuradio ABSOLUTE ) -GET_FILENAME_COMPONENT(PMT_SERIAL_TAGS_H +get_filename_component(PMT_SERIAL_TAGS_H ${CMAKE_CURRENT_BINARY_DIR}/../../include/gruel/pmt_serial_tags.h ABSOLUTE ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${PMT_SERIAL_TAGS_H} DEPENDS ${SCHEME_DIR}/gen-serial-tags.py DEPENDS ${SCHEME_DIR}/pmt-serial-tags.scm @@ -44,13 +44,13 @@ ADD_CUSTOM_COMMAND( ${PMT_SERIAL_TAGS_H} ) -INSTALL( +install( FILES ${PMT_SERIAL_TAGS_H} DESTINATION ${GR_INCLUDE_DIR}/gruel COMPONENT "gruel_devel" ) -INCLUDE(AddFileDependencies) +include(AddFileDependencies) ADD_FILE_DEPENDENCIES( ${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc ${PMT_SERIAL_TAGS_H} @@ -59,7 +59,7 @@ ADD_FILE_DEPENDENCIES( ######################################################################## # Generate other pmt stuff ######################################################################## -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pmt_unv_int.h ${CMAKE_CURRENT_BINARY_DIR}/qa_pmt_unv.h @@ -75,7 +75,7 @@ ADD_CUSTOM_COMMAND( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -LIST(APPEND gruel_sources +list(APPEND gruel_sources ${CMAKE_CURRENT_BINARY_DIR}/pmt_unv.cc ${CMAKE_CURRENT_SOURCE_DIR}/pmt.cc ${CMAKE_CURRENT_SOURCE_DIR}/pmt_io.cc @@ -83,7 +83,7 @@ LIST(APPEND gruel_sources ${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc ) -LIST(APPEND test_gruel_sources +list(APPEND test_gruel_sources ${CMAKE_CURRENT_BINARY_DIR}/qa_pmt_unv.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_pmt_prims.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_pmt.cc diff --git a/gruel/src/python/CMakeLists.txt b/gruel/src/python/CMakeLists.txt index 491763cd7..be5ac956e 100644 --- a/gruel/src/python/CMakeLists.txt +++ b/gruel/src/python/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -INCLUDE(GrPython) +include(GrPython) ######################################################################## # Install python files @@ -37,16 +37,16 @@ GR_PYTHON_INSTALL( ######################################################################## # Setup unit tests ######################################################################## -IF(ENABLE_TESTING) -INCLUDE(GrTest) -FILE(GLOB py_qa_test_files "qa_*.py") -FOREACH(py_qa_test_file ${py_qa_test_files}) - GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) - SET(GR_TEST_PYTHON_DIRS +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gruel/src/python ${CMAKE_BINARY_DIR}/gruel/src/swig ) - SET(GR_TEST_TARGET_DEPS gruel gnuradio-core) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) -ENDFOREACH(py_qa_test_file) -ENDIF(ENABLE_TESTING) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gruel/src/scheme/gnuradio/CMakeLists.txt b/gruel/src/scheme/gnuradio/CMakeLists.txt index bfa2a415f..4ff4f7feb 100644 --- a/gruel/src/scheme/gnuradio/CMakeLists.txt +++ b/gruel/src/scheme/gnuradio/CMakeLists.txt @@ -19,7 +19,7 @@ ######################################################################## -INSTALL(FILES +install(FILES pmt-serial-tags.scm pmt-serialize.scm macros-etc.scm diff --git a/gruel/src/swig/CMakeLists.txt b/gruel/src/swig/CMakeLists.txt index 5b256a793..c2769ae27 100644 --- a/gruel/src/swig/CMakeLists.txt +++ b/gruel/src/swig/CMakeLists.txt @@ -20,11 +20,11 @@ ######################################################################## # Setup swig generation ######################################################################## -INCLUDE(GrPython) -INCLUDE(GrSwig) +include(GrPython) +include(GrSwig) -SET(GR_SWIG_INCLUDE_DIRS ${GRUEL_INCLUDE_DIRS}) -SET(GR_SWIG_LIBRARIES gruel) +set(GR_SWIG_INCLUDE_DIRS ${GRUEL_INCLUDE_DIRS}) +set(GR_SWIG_LIBRARIES gruel) GR_SWIG_MAKE(pmt_swig pmt_swig.i) @@ -34,7 +34,7 @@ GR_SWIG_INSTALL( COMPONENT "gruel_python" ) -INSTALL( +install( FILES gr_intrusive_ptr.i pmt_swig.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "gruel_swig" diff --git a/volk/CMakeLists.txt b/volk/CMakeLists.txt index 743f07925..4b8fda059 100644 --- a/volk/CMakeLists.txt +++ b/volk/CMakeLists.txt @@ -18,44 +18,44 @@ ######################################################################## # Project setup ######################################################################## -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -IF(NOT DEFINED CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE Release) -ENDIF() -SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") -PROJECT(volk) -ENABLE_LANGUAGE(CXX) -ENABLE_LANGUAGE(C) -ENABLE_TESTING() -SET(VERSION 0.1) -SET(LIBVER 0.0.0) +cmake_minimum_required(VERSION 2.6) +if(NOT DEFINED CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") +project(volk) +enable_language(CXX) +enable_language(C) +enable_testing() +set(VERSION 0.1) +set(LIBVER 0.0.0) -SET(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project -SET(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project +set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project +set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project ######################################################################## # Dependencies setup ######################################################################## -FIND_PACKAGE(PythonInterp) -IF(NOT PYTHONINTERP_FOUND) - MESSAGE(FATAL_ERROR "Python interpreter required by the build system.") -ENDIF(NOT PYTHONINTERP_FOUND) +find_package(PythonInterp) +if(NOT PYTHONINTERP_FOUND) + message(FATAL_ERROR "Python interpreter required by the build system.") +endif(NOT PYTHONINTERP_FOUND) ######################################################################## # Setup the package config file ######################################################################## #set variables found in the pc.in file -SET(prefix ${CMAKE_INSTALL_PREFIX}) -SET(exec_prefix "\${prefix}") -SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") -SET(includedir "\${prefix}/include") +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix "\${prefix}") +set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") +set(includedir "\${prefix}/include") -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/volk.pc.in ${CMAKE_CURRENT_BINARY_DIR}/volk.pc @ONLY) -INSTALL( +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/volk.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT "volk_devel" @@ -64,13 +64,13 @@ INSTALL( ######################################################################## # Install all headers in the include directories ######################################################################## -INSTALL( +install( DIRECTORY ${CMAKE_SOURCE_DIR}/include/volk DESTINATION include COMPONENT "volk_devel" FILES_MATCHING PATTERN "*.h" ) -INSTALL(FILES +install(FILES ${CMAKE_BINARY_DIR}/include/volk/volk.h ${CMAKE_BINARY_DIR}/include/volk/volk_cpu.h ${CMAKE_BINARY_DIR}/include/volk/volk_config_fixed.h @@ -82,14 +82,14 @@ INSTALL(FILES ######################################################################## # Setup the library ######################################################################## -ADD_SUBDIRECTORY(lib) +add_subdirectory(lib) ######################################################################## # And the utility apps ######################################################################## -ADD_SUBDIRECTORY(apps) +add_subdirectory(apps) ######################################################################## # Print summary ######################################################################## -MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") diff --git a/volk/apps/CMakeLists.txt b/volk/apps/CMakeLists.txt index b0b48360f..f27bdc126 100644 --- a/volk/apps/CMakeLists.txt +++ b/volk/apps/CMakeLists.txt @@ -18,15 +18,15 @@ ######################################################################## # Setup profiler ######################################################################## -FIND_PACKAGE(Boost) +find_package(Boost) -IF(Boost_FOUND AND UNIX) #uses mkdir and $HOME +if(Boost_FOUND AND UNIX) #uses mkdir and $HOME -IF(MSVC) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/msvc) -ENDIF(MSVC) +if(MSVC) + include_directories(${CMAKE_SOURCE_DIR}/msvc) +endif(MSVC) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}/lib @@ -35,11 +35,11 @@ INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) -ADD_EXECUTABLE(volk_profile +add_executable(volk_profile ${CMAKE_CURRENT_SOURCE_DIR}/volk_profile.cc ${CMAKE_SOURCE_DIR}/lib/qa_utils.cc ) -TARGET_LINK_LIBRARIES(volk_profile volk ${Boost_LIBRARIES}) +target_link_libraries(volk_profile volk ${Boost_LIBRARIES}) -ENDIF(Boost_FOUND AND UNIX) +endif(Boost_FOUND AND UNIX) diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index 645a0dc17..f4177b16e 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -21,7 +21,7 @@ # If the test passes append the arch to the available list. ######################################################################## #extract the arch lines from the xml file using crazy python -EXECUTE_PROCESS( +execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from xml.dom import minidom; print ';'.join(map(lambda a: '%s %s'%(a.attributes['name'].value,a.getElementsByTagName('flag')[0].firstChild.data),minidom.parse('${CMAKE_SOURCE_DIR}/gen/archs.xml').getElementsByTagName('arch')))" OUTPUT_VARIABLE arch_lines OUTPUT_STRIP_TRAILING_WHITESPACE @@ -29,7 +29,7 @@ EXECUTE_PROCESS( #get any mutually exclusive archs so we can exclude them #this is really for compilers which can do both 32- and 64-bit compilations. -EXECUTE_PROCESS( +execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from xml.dom import minidom; print ';'.join(map(lambda a: '%s %s'%(a.parentNode.attributes['name'].value,a.firstChild.data),minidom.parse('${CMAKE_SOURCE_DIR}/gen/archs.xml').getElementsByTagName('mutex')))" OUTPUT_VARIABLE mutex_lines OUTPUT_STRIP_TRAILING_WHITESPACE @@ -37,56 +37,56 @@ EXECUTE_PROCESS( #This macro sets the ${arch}_flag variable, #and handles special cases for MSVC arch flags. -MACRO(set_arch_flag name flag) - IF(MSVC AND ${name} STREQUAL "mmx") - SET(${name}_flag "/arch:SSE") #no /arch:MMX - ELSEIF(MSVC AND ${name} STREQUAL "sse") - SET(${name}_flag "/arch:SSE") - ELSEIF(MSVC AND ${name} STREQUAL "sse2") - SET(${name}_flag "/arch:SSE2") - ELSE() - SET(${name}_flag -${flag}) - ENDIF() -ENDMACRO(set_arch_flag) - -MACRO(handle_arch name flag) +macro(set_arch_flag name flag) + if(MSVC AND ${name} STREQUAL "mmx") + set(${name}_flag "/arch:SSE") #no /arch:MMX + elseif(MSVC AND ${name} STREQUAL "sse") + set(${name}_flag "/arch:SSE") + elseif(MSVC AND ${name} STREQUAL "sse2") + set(${name}_flag "/arch:SSE2") + else() + set(${name}_flag -${flag}) + endif() +endmacro(set_arch_flag) + +macro(handle_arch name flag) #handle special case for none flag - IF(${flag} STREQUAL "none") - SET(have_${name} TRUE) + if(${flag} STREQUAL "none") + set(have_${name} TRUE) #otherwise test the flag against the compiler - ELSE() - INCLUDE(CheckCXXCompilerFlag) + else() + include(CheckCXXCompilerFlag) set_arch_flag(${name} ${flag}) CHECK_CXX_COMPILER_FLAG(${${name}_flag} have_${name}) - ENDIF() + endif() - IF(have_${name}) - LIST(APPEND available_arches ${name}) - ENDIF() -ENDMACRO(handle_arch) + if(have_${name}) + list(APPEND available_arches ${name}) + endif() +endmacro(handle_arch) -MACRO(remove_mutex name mutex) - IF(have_${name}) - UNSET(have_${mutex}) - ENDIF() - LIST(REMOVE_ITEM available_arches ${mutex}) -ENDMACRO(remove_mutex) +macro(remove_mutex name mutex) + if(have_${name}) + unset(have_${mutex}) + endif() + list(REMOVE_ITEM available_arches ${mutex}) +endmacro(remove_mutex) #create a list of available arches -FOREACH(arch_line ${arch_lines}) - SEPARATE_ARGUMENTS(args UNIX_COMMAND "${arch_line}") +foreach(arch_line ${arch_lines}) + separate_arguments(args UNIX_COMMAND "${arch_line}") handle_arch(${args}) -ENDFOREACH(arch_line) +endforeach(arch_line) #strip out mutex archs -FOREACH(mutex_line ${mutex_lines}) - SEPARATE_ARGUMENTS(args UNIX_COMMAND "${mutex_line}") +foreach(mutex_line ${mutex_lines}) + separate_arguments(args UNIX_COMMAND "${mutex_line}") remove_mutex(${args}) -ENDFOREACH(mutex_line) +endforeach(mutex_line) -MESSAGE(STATUS "Available arches: ${available_arches}") +message(STATUS "Available arches: ${available_arches}") ######################################################################## # Parse the machines xml file: @@ -94,61 +94,61 @@ MESSAGE(STATUS "Available arches: ${available_arches}") # Build a list of supported machines and the machine definitions. ######################################################################## #extract the machine lines from the xml file using crazy python -EXECUTE_PROCESS( +execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from xml.dom import minidom; print ';'.join(map(lambda a: '%s %s'%(a.attributes['name'].value,a.getElementsByTagName('archs')[0].firstChild.data),minidom.parse('${CMAKE_SOURCE_DIR}/gen/machines.xml').getElementsByTagName('machine')))" OUTPUT_VARIABLE machine_lines OUTPUT_STRIP_TRAILING_WHITESPACE ) -MACRO(handle_machine1 name) - UNSET(machine_flags) - STRING(TOUPPER LV_MACHINE_${name} machine_def) +macro(handle_machine1 name) + unset(machine_flags) + string(TOUPPER LV_MACHINE_${name} machine_def) #check if all the arches are supported - FOREACH(arch ${ARGN}) - SET(is_match ${have_${arch}}) - IF(NOT is_match) - SET(is_match FALSE) - BREAK() - ENDIF(NOT is_match) - SET(machine_flags "${machine_flags} ${${arch}_flag}") - ENDFOREACH(arch) - - IF(is_match) + foreach(arch ${ARGN}) + set(is_match ${have_${arch}}) + if(NOT is_match) + set(is_match FALSE) + break() + endif(NOT is_match) + set(machine_flags "${machine_flags} ${${arch}_flag}") + endforeach(arch) + + if(is_match) #this is a match, append the source and set its flags - SET(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_machine_${name}.c) - SET_SOURCE_FILES_PROPERTIES(${machine_source} PROPERTIES COMPILE_FLAGS ${machine_flags}) - LIST(APPEND machine_sources ${machine_source}) - LIST(APPEND machine_defs ${machine_def}) - LIST(APPEND available_machines ${name}) - ENDIF() -ENDMACRO(handle_machine1) - -MACRO(handle_machine name) - SET(arches ${ARGN}) - LIST(FIND arches "32|64" index) - IF(${index} EQUAL -1) + set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_machine_${name}.c) + set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS ${machine_flags}) + list(APPEND machine_sources ${machine_source}) + list(APPEND machine_defs ${machine_def}) + list(APPEND available_machines ${name}) + endif() +endmacro(handle_machine1) + +macro(handle_machine name) + set(arches ${ARGN}) + list(FIND arches "32|64" index) + if(${index} EQUAL -1) handle_machine1(${name} ${arches}) - ELSE() - LIST(REMOVE_ITEM arches "32|64") + else() + list(REMOVE_ITEM arches "32|64") handle_machine1(${name}_32 32 ${arches}) handle_machine1(${name}_64 64 ${arches}) - ENDIF() -ENDMACRO(handle_machine) + endif() +endmacro(handle_machine) #setup the available machines -FOREACH(machine_line ${machine_lines}) - SEPARATE_ARGUMENTS(args UNIX_COMMAND "${machine_line}") +foreach(machine_line ${machine_lines}) + separate_arguments(args UNIX_COMMAND "${machine_line}") handle_machine(${args}) -ENDFOREACH(machine_line) +endforeach(machine_line) -MESSAGE(STATUS "Available machines: ${available_machines}") +message(STATUS "Available machines: ${available_machines}") ######################################################################## # Create rules to run the volk generator ######################################################################## #list of the generated sources -SET(volk_gen_sources +set(volk_gen_sources ${CMAKE_BINARY_DIR}/include/volk/volk.h ${CMAKE_BINARY_DIR}/lib/volk.c ${CMAKE_BINARY_DIR}/lib/volk_init.h @@ -164,21 +164,21 @@ SET(volk_gen_sources ) #dependencies are all python, xml, and header implementation files -FILE(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml) -FILE(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py) -FILE(GLOB h_files ${CMAKE_SOURCE_DIR}/include/volk/*.h) +file(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml) +file(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py) +file(GLOB h_files ${CMAKE_SOURCE_DIR}/include/volk/*.h) #make sure we can use -B with python (introduced in 2.6) -EXECUTE_PROCESS( +execute_process( COMMAND ${PYTHON_EXECUTABLE} -B -c "" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT ) -IF(PYTHON_HAS_DASH_B_RESULT EQUAL 0) - SET(PYTHON_DASH_B "-B") -ENDIF() +if(PYTHON_HAS_DASH_B_RESULT EQUAL 0) + set(PYTHON_DASH_B "-B") +endif() -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${volk_gen_sources} DEPENDS ${xml_files} ${py_files} ${h_files} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} @@ -189,80 +189,80 @@ ADD_CUSTOM_COMMAND( ######################################################################## # Handle orc support ######################################################################## -FIND_PACKAGE(PkgConfig) -IF(PKG_CONFIG_FOUND) +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) PKG_CHECK_MODULES(ORC "orc-0.4 > 0.4.11") -ENDIF(PKG_CONFIG_FOUND) +endif(PKG_CONFIG_FOUND) -FIND_PROGRAM(ORCC_EXECUTABLE orcc) +find_program(ORCC_EXECUTABLE orcc) -IF(ORC_FOUND AND ORCC_EXECUTABLE) +if(ORC_FOUND AND ORCC_EXECUTABLE) #setup orc library usage - INCLUDE_DIRECTORIES(${ORC_INCLUDE_DIRS}) - LINK_DIRECTORIES(${ORC_LIBRARY_DIRS}) - ADD_DEFINITIONS(-DLV_HAVE_ORC) + include_directories(${ORC_INCLUDE_DIRS}) + link_directories(${ORC_LIBRARY_DIRS}) + add_definitions(-DLV_HAVE_ORC) #setup orc functions - FILE(GLOB orc_files ${CMAKE_SOURCE_DIR}/orc/*.orc) - FOREACH(orc_file ${orc_files}) + file(GLOB orc_files ${CMAKE_SOURCE_DIR}/orc/*.orc) + foreach(orc_file ${orc_files}) #extract the name for the generated c source from the orc file - GET_FILENAME_COMPONENT(orc_file_name_we ${orc_file} NAME_WE) - SET(orcc_gen ${CMAKE_CURRENT_BINARY_DIR}/${orc_file_name_we}.c) + get_filename_component(orc_file_name_we ${orc_file} NAME_WE) + set(orcc_gen ${CMAKE_CURRENT_BINARY_DIR}/${orc_file_name_we}.c) #create a rule to generate the source and add to the list of sources - ADD_CUSTOM_COMMAND( + add_custom_command( COMMAND ${ORCC_EXECUTABLE} --implementation -o ${orcc_gen} ${orc_file} DEPENDS ${orc_file} OUTPUT ${orcc_gen} ) - LIST(APPEND volk_sources ${orcc_gen}) + list(APPEND volk_sources ${orcc_gen}) - ENDFOREACH(orc_file) -ELSE() - MESSAGE(STATUS "Did not find liborc and orcc, disabling orc support...") -ENDIF() + endforeach(orc_file) +else() + message(STATUS "Did not find liborc and orcc, disabling orc support...") +endif() ######################################################################## # Setup the volk sources list and library ######################################################################## -IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) #http://gcc.gnu.org/wiki/Visibility - ADD_DEFINITIONS(-fvisibility=hidden) -ENDIF() + add_definitions(-fvisibility=hidden) +endif() -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) -LIST(APPEND volk_sources +list(APPEND volk_sources ${CMAKE_CURRENT_SOURCE_DIR}/volk_prefs.c ${CMAKE_CURRENT_SOURCE_DIR}/volk_rank_archs.c ${volk_gen_sources} ) #set the machine definitions where applicable -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/volk.c ${CMAKE_CURRENT_BINARY_DIR}/volk_machines.c PROPERTIES COMPILE_DEFINITIONS "${machine_defs}") -IF(MSVC) +if(MSVC) #add compatibility includes for stdint types - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/msvc) + include_directories(${CMAKE_SOURCE_DIR}/msvc) #compile the sources as C++ due to the lack of complex.h under MSVC - SET_SOURCE_FILES_PROPERTIES(${volk_sources} PROPERTIES LANGUAGE CXX) -ENDIF(MSVC) + set_source_files_properties(${volk_sources} PROPERTIES LANGUAGE CXX) +endif(MSVC) #create the volk runtime library -ADD_LIBRARY(volk SHARED ${volk_sources}) -TARGET_LINK_LIBRARIES(volk ${ORC_LIBRARIES}) -SET_TARGET_PROPERTIES(volk PROPERTIES SOVERSION ${LIBVER}) -SET_TARGET_PROPERTIES(volk PROPERTIES DEFINE_SYMBOL "volk_EXPORTS") +add_library(volk SHARED ${volk_sources}) +target_link_libraries(volk ${ORC_LIBRARIES}) +set_target_properties(volk PROPERTIES SOVERSION ${LIBVER}) +set_target_properties(volk PROPERTIES DEFINE_SYMBOL "volk_EXPORTS") -INSTALL(TARGETS volk +install(TARGETS volk LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_runtime" # .so file ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel" # .lib file RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file @@ -271,23 +271,23 @@ INSTALL(TARGETS volk ######################################################################## # Build the QA test application ######################################################################## -FIND_PACKAGE(Boost COMPONENTS unit_test_framework) +find_package(Boost COMPONENTS unit_test_framework) -IF(Boost_FOUND) +if(Boost_FOUND) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc PROPERTIES COMPILE_DEFINITIONS "BOOST_TEST_DYN_LINK;BOOST_TEST_MAIN" ) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -ADD_EXECUTABLE(test_all +add_executable(test_all ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc ) -TARGET_LINK_LIBRARIES(test_all volk ${Boost_LIBRARIES}) +target_link_libraries(test_all volk ${Boost_LIBRARIES}) #ADD_TEST(qa_volk_test_all test_all) -ENDIF() +endif() |