Skip to content

Commit

Permalink
Initial copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Braun committed Jun 15, 2011
0 parents commit d5b447d
Show file tree
Hide file tree
Showing 147 changed files with 15,416 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AUTHORS
@@ -0,0 +1,6 @@
Martin Braun <martin.braun@kit.edu>
Mohammed Usman Karim Khan <karim.usman@yahoo.com> (Initial Burg code)
Gerald Baier <gerald.baier@student.kit.edu> (Initial MTM code)
Moritz Krüger <moritz.krueger@student.kit.edu> (Initial fcov code)
Moritz Fischer <moritz.fischer@student.kit.edu> (ESPRIT/MUSIC code, CMake Port)
Manuel Fuhr <manuel.fuhr@student.kit.edu> (ESPRIT/MUSIC code)
9 changes: 9 additions & 0 deletions CMake/Armadillo.cmake
@@ -0,0 +1,9 @@
IF (ARMADILLO_FOUND)
SET(HAVE_ARMADILLO 1)
SET(armadillo_optional_headers "#include \"specest_music.h\" \n#include \"specest_music_vcf.h\" \n#include \"specest_music_spectrum_vcf.h\"")
SET(armadillo_optional_dot_i "%include \"specest_music.i\" \n%include \"specest_music_vcf.i\" \n%include \"specest_music_spectrum_vcf.i\"")
ELSE(ARMADILLO_FOUND)
SET(armadillo_optional_headers "")
SET(armadillo_optional_dot_i "")
MESSAGE("-- As armadillo wasn't found, the MUSIC algorithm will not be built")
ENDIF(ARMADILLO_FOUND)
97 changes: 97 additions & 0 deletions CMake/FindArmadillo.cmake
@@ -0,0 +1,97 @@
# - Try to find Armadillo include dirs and libraries
# Usage of this module as follows:
#
# == Using Armadillo: ==
# find_package( Armadillo RECQUIRED )
# include_directories(${ARMADILLO_INCLUDE_DIRS})
# add_executable(foo foo.cc)
# target_link_libraries(foo ${ARMADILLO_LIBRARIES})
#
#=============================================================================
#
# This module sets the following variables:
# ARMADILLO_FOUND - set to true if the library is found
# ARMADILLO_INCLUDE_DIRS - list of required include directories
# ARMADILLO_LIBRARIES - list of libraries to be linked
# ARMADILLO_VERSION_MAJOR - major version number
# ARMADILLO_VERSION_MINOR - minor version number
# ARMADILLO_VERSION_PATCH - patch version number
# ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
# ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
#
#=============================================================================
# Copyright 2011 Clement Creusot
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#
#=============================================================================

# UNIX paths are standard, no need to write.
find_library(ARMADILLO_LIBRARY
NAMES armadillo
PATHS "$ENV{ProgramFiles}/Armadillo/lib" "$ENV{ProgramFiles}/Armadillo/lib64" "$ENV{ProgramFiles}/Armadillo"
)
find_path(ARMADILLO_INCLUDE_DIR
NAMES armadillo
PATHS "$ENV{ProgramFiles}/Armadillo/include"
)


#if(ARMADILLO_INCLUDE_DIR)

## ------------------------------------------------------------------------
## Extract version information from <armadillo>
## ------------------------------------------------------------------------

## WARNING: Early releases of Armadillo didn't have the arma_version.hpp file.
## (e.g. v.0.9.8-1 in ubuntu maverick packages (2001-03-15))
## If the file is missing, set all values to 0
#set(ARMADILLO_VERSION_MAJOR 0)
#set(ARMADILLO_VERSION_MINOR 0)
#set(ARMADILLO_VERSION_PATCH 0)
#set(ARMADILLO_VERSION_NAME "EARLY RELEASE")

#if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")

## Read and parse armdillo version header file for version number
#file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
#string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
#string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
#string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")

## WARNING: The number of spaces before the version name is not one.
#string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")

#endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")

#set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
#endif (ARMADILLO_INCLUDE_DIR)

#======================


# Checks 'RECQUIRED', 'QUIET' and versions.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Armadillo
REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
VERSION_VAR ARMADILLO_VERSION_STRING)
# version_var fails with cmake < 2.8.4.

if (ARMADILLO_FOUND)
set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
endif (ARMADILLO_FOUND)


# Hide internal variables
mark_as_advanced(
ARMADILLO_INCLUDE_DIR
ARMADILLO_LIBRARY)

#======================

33 changes: 33 additions & 0 deletions CMake/FindCppUnit.cmake
@@ -0,0 +1,33 @@
# http://www.cmake.org/pipermail/cmake/2006-October/011446.html
#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIRS, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.

INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(CPPUNIT "cppunit")
IF(NOT CPPUNIT_FOUND)

FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h
/usr/local/include
/usr/include
)

FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit
${CPPUNIT_INCLUDE_DIRS}/../lib
/usr/local/lib
/usr/lib)

IF(CPPUNIT_INCLUDE_DIRS)
IF(CPPUNIT_LIBRARIES)
SET(CPPUNIT_FOUND "YES")
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES} ${CMAKE_DL_LIBS})
ENDIF(CPPUNIT_LIBRARIES)
ENDIF(CPPUNIT_INCLUDE_DIRS)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
ENDIF(NOT CPPUNIT_FOUND)
24 changes: 24 additions & 0 deletions CMake/FindUHD.cmake
@@ -0,0 +1,24 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(UHD uhd)
IF(NOT UHD_FOUND)

FIND_PATH(
UHD_INCLUDE_DIRS
NAMES uhd/config.hpp
HINTS $ENV{UHD_DIR}/include
PATHS /usr/local/include
/usr/include
)

FIND_LIBRARY(
UHD_LIBRARIES
NAMES uhd
HINTS $ENV{UHD_DIR}/lib
PATHS /usr/local/lib
/usr/lib
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)

ENDIF(NOT UHD_FOUND)
71 changes: 71 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,71 @@
# Copyright 2011 Communications Engineering Lab, KIT
#
# This file is part of the GNU Radio Spectral Estimation Toolbox
#
# The GNU Radio Spectral Estimation Toolbox is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# The GNU Radio Spectral Estimation Toolbox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio Spectral Estimation Toolbox; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

PROJECT(GR-SPECEST)
ENABLE_LANGUAGE(Fortran)
ENABLE_LANGUAGE(CXX)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

IF(UNIX AND EXISTS "/usr/lib64")
LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
SET(LIB_POSTFIX 64)
ENDIF(UNIX AND EXISTS "/usr/lib64")

LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)

###############################################################################
# Search for the required packages
###############################################################################

FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(CppUnit REQUIRED)
FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(LAPACK REQUIRED)
FIND_PACKAGE(Doxygen)
FIND_PACKAGE(UHD)

FIND_PACKAGE(Armadillo)
INCLUDE(Armadillo)

INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(GNURADIO_CORE REQUIRED gnuradio-core)
PKG_CHECK_MODULES(GNURADIO_UHD REQUIRED gnuradio-uhd)

INCLUDE_DIRECTORIES(${GNURADIO_CORE_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${CMAKE_SOURCE_DIR}/lib ${CMAKE_BINARY_DIR}/lib)

SUBDIRS(lib swig python grc apps doc)

#TODO generate the specest.i out of source
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/swig/specest.i.in ${CMAKE_BINARY_DIR}/swig/specest.i)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/lib/config.h.in ${CMAKE_BINARY_DIR}/lib/config.h)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/gnuradio-specest.pc.in ${CMAKE_BINARY_DIR}/gnuradio-specest.pc @ONLY)

ENABLE_TESTING()

MESSAGE("\n=============================================================================================")
MESSAGE("GNU Radio Spectral Estimation Toolbox")
MESSAGE("Copyright 2009-2011 Communications Engineering Lab, KIT\n")
MESSAGE("This program comes with ABSOLUTELY NO WARRANTY.")
MESSAGE("This is free software, and you are welcome to redistribute it under certain conditions.")
MESSAGE("For further information see COPYING")
MESSAGE("=============================================================================================\n")

INSTALL(FILES ${CMAKE_BINARY_DIR}/gnuradio-specest.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/pkgconfig)

0 comments on commit d5b447d

Please sign in to comment.