summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CMakeMacroLibtoolFile.cmake62
-rw-r--r--cmake/Modules/CMakeParseArgumentsCopy.cmake138
-rw-r--r--cmake/Modules/FindALSA.cmake36
-rw-r--r--cmake/Modules/FindCppUnit.cmake36
-rw-r--r--cmake/Modules/FindFFTW3f.cmake41
-rw-r--r--cmake/Modules/FindGSL.cmake146
-rw-r--r--cmake/Modules/FindGit.cmake46
-rw-r--r--cmake/Modules/FindJack.cmake82
-rw-r--r--cmake/Modules/FindOSS.cmake46
-rw-r--r--cmake/Modules/FindPortaudio.cmake35
-rw-r--r--cmake/Modules/FindQwt.cmake32
-rw-r--r--cmake/Modules/FindSphinx.cmake37
-rw-r--r--cmake/Modules/FindUHD.cmake28
-rw-r--r--cmake/Modules/FindUSB.cmake28
-rw-r--r--cmake/Modules/GrBoost.cmake99
-rw-r--r--cmake/Modules/GrComponent.cmake115
-rw-r--r--cmake/Modules/GrMiscUtils.cmake280
-rw-r--r--cmake/Modules/GrPackage.cmake177
-rw-r--r--cmake/Modules/GrPlatform.cmake54
-rw-r--r--cmake/Modules/GrPython.cmake234
-rw-r--r--cmake/Modules/GrSetupQt4.cmake156
-rw-r--r--cmake/Modules/GrSwig.cmake236
-rw-r--r--cmake/Modules/GrTest.cmake137
-rw-r--r--cmake/Modules/GrVersion.cmake76
-rw-r--r--cmake/Modules/LibFindMacros.cmake99
-rw-r--r--cmake/Packaging/Fedora-15.cmake12
-rw-r--r--cmake/Packaging/Fedora-16.cmake12
-rw-r--r--cmake/Packaging/Fedora-17.cmake12
-rw-r--r--cmake/Packaging/Fedora-18.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-10.04.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-10.10.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-11.04.cmake13
-rw-r--r--cmake/Packaging/Ubuntu-11.10.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-12.04.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-12.10.cmake12
-rw-r--r--cmake/Packaging/Ubuntu-13.04.cmake12
-rwxr-xr-xcmake/Packaging/post_install.in4
-rwxr-xr-xcmake/Packaging/post_uninstall.in3
-rwxr-xr-xcmake/Packaging/postinst.in6
-rwxr-xr-xcmake/Packaging/postrm.in5
-rwxr-xr-xcmake/Packaging/pre_install.in1
-rwxr-xr-xcmake/Packaging/pre_uninstall.in3
-rwxr-xr-xcmake/Packaging/preinst.in5
-rwxr-xr-xcmake/Packaging/prerm.in5
-rw-r--r--cmake/Toolchains/arm_cortex_a8_native.cmake8
-rw-r--r--cmake/cmake_uninstall.cmake.in32
-rw-r--r--cmake/msvc/config.h58
-rw-r--r--cmake/msvc/inttypes.h301
-rw-r--r--cmake/msvc/stdint.h251
-rw-r--r--cmake/msvc/sys/time.h69
-rw-r--r--cmake/msvc/unistd.h10
51 files changed, 3350 insertions, 0 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake
new file mode 100644
index 000000000..2ec791207
--- /dev/null
+++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake
@@ -0,0 +1,62 @@
+#http://www.vtk.org/Wiki/CMakeMacroLibtoolFile
+#This macro creates a libtool .la file for shared libraries or plugins. The first parameter is the target name of the library, the second parameter is the directory where it will be installed to. E.g. for a KDE 3.x module named "kfoo" the usage would be as follows:
+
+#The macro GET_TARGET_PROPERTY_WITH_DEFAULT is helpful to handle properties with default values.
+
+#ADD_LIBRARY(foo SHARED kfoo1.cpp kfoo2.cpp)
+#CREATE_LIBTOOL_FILE(foo /lib/kde3)
+
+if(DEFINED __INCLUDED_CREATE_LIBTOOL_FILE)
+ return()
+endif()
+set(__INCLUDED_CREATE_LIBTOOL_FILE TRUE)
+
+ MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
+ GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
+ IF (${_variable} MATCHES NOTFOUND)
+ SET (${_variable} ${_default_value})
+ ENDIF (${_variable} MATCHES NOTFOUND)
+ ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
+
+ MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
+ GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
+ GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
+ GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
+ GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
+ SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
+ FILE(WRITE ${_laname} "# ${_laname} - a libtool library file\n")
+ FILE(WRITE ${_laname} "# Generated by CMake ${CMAKE_VERSION} (like GNU libtool)\n")
+ FILE(WRITE ${_laname} "\n# Please DO NOT delete this file!\n# It is necessary for linking the library with libtool.\n\n" )
+ FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
+ FILE(APPEND ${_laname} "dlname='${_soname}'\n\n")
+ FILE(APPEND ${_laname} "# Names of this library.\n")
+ FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n\n")
+ FILE(APPEND ${_laname} "# The name of the static archive.\n")
+ FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n\n")
+ FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
+ FILE(APPEND ${_laname} "dependency_libs='${_target_dependency_libs}'\n\n")
+ FILE(APPEND ${_laname} "# Names of additional weak libraries provided by this library\n")
+ FILE(APPEND ${_laname} "weak_library_names=\n\n")
+ FILE(APPEND ${_laname} "# Version information for ${_laname}.\n")
+ FILE(APPEND ${_laname} "current=${_target_current}\n")
+ FILE(APPEND ${_laname} "age=${_target_age}\n")
+ FILE(APPEND ${_laname} "revision=${_target_revision}\n\n")
+ FILE(APPEND ${_laname} "# Is this an already installed library?\n")
+ FILE(APPEND ${_laname} "installed=${_target_installed}\n\n")
+ FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n")
+ FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n\n")
+ FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n")
+ FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n")
+ FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n\n")
+ FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
+ FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}${_install_DIR}'\n")
+ INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
+ ENDMACRO(CREATE_LIBTOOL_FILE)
diff --git a/cmake/Modules/CMakeParseArgumentsCopy.cmake b/cmake/Modules/CMakeParseArgumentsCopy.cmake
new file mode 100644
index 000000000..7ce4c49ae
--- /dev/null
+++ b/cmake/Modules/CMakeParseArgumentsCopy.cmake
@@ -0,0 +1,138 @@
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# parsing the arguments given to that macro or function.
+# It processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e. keywords which can be used when calling the macro without any value
+# following, like e.g. the OPTIONAL keyword of the install() command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g. DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this macro
+# which can be followed by more than one value, like e.g. the TARGETS or
+# FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.
+# These variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
+# your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments as the
+# real install() command:
+#
+# function(MY_INSTALL)
+# set(options OPTIONAL FAST)
+# set(oneValueArgs DESTINATION RENAME)
+# set(multiValueArgs TARGETS CONFIGURATIONS)
+# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+# ...
+#
+# Assume my_install() has been called like this:
+# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+# After the cmake_parse_arguments() call the macro will have set the following
+# variables:
+# MY_INSTALL_OPTIONAL = TRUE
+# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+# MY_INSTALL_DESTINATION = "bin"
+# MY_INSTALL_RENAME = "" (was not used)
+# MY_INSTALL_TARGETS = "foo;bar"
+# MY_INSTALL_CONFIGURATIONS = "" (was not used)
+# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+# You can the continue and process these variables.
+#
+# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
+# another recognized keyword follows, this is interpreted as the beginning of
+# the new option.
+# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
+# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
+#
+# 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.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
+ return()
+endif()
+set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+ # first set all result variables to empty/FALSE
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+ set(${prefix}_${arg_name})
+ endforeach(arg_name)
+
+ foreach(option ${_optionNames})
+ set(${prefix}_${option} FALSE)
+ endforeach(option)
+
+ set(${prefix}_UNPARSED_ARGUMENTS)
+
+ set(insideValues FALSE)
+ set(currentArgName)
+
+ # now iterate over all arguments and fill the result variables
+ foreach(currentArg ${ARGN})
+ list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+
+ if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
+ if(insideValues)
+ if("${insideValues}" STREQUAL "SINGLE")
+ set(${prefix}_${currentArgName} ${currentArg})
+ set(insideValues FALSE)
+ elseif("${insideValues}" STREQUAL "MULTI")
+ list(APPEND ${prefix}_${currentArgName} ${currentArg})
+ endif()
+ else(insideValues)
+ list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+ endif(insideValues)
+ else()
+ if(NOT ${optionIndex} EQUAL -1)
+ set(${prefix}_${currentArg} TRUE)
+ set(insideValues FALSE)
+ elseif(NOT ${singleArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "SINGLE")
+ elseif(NOT ${multiArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "MULTI")
+ endif()
+ endif()
+
+ endforeach(currentArg)
+
+ # propagate the result variables to the caller:
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+ set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
+ endforeach(arg_name)
+ set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
diff --git a/cmake/Modules/FindALSA.cmake b/cmake/Modules/FindALSA.cmake
new file mode 100644
index 000000000..e3e6624ff
--- /dev/null
+++ b/cmake/Modules/FindALSA.cmake
@@ -0,0 +1,36 @@
+# - Try to find ALSA
+# Once done, this will define
+#
+# ALSA_FOUND - system has ALSA (GL and GLU)
+# ALSA_INCLUDE_DIRS - the ALSA include directories
+# ALSA_LIBRARIES - link these to use ALSA
+# ALSA_GL_LIBRARY - only GL
+# ALSA_GLU_LIBRARY - only GLU
+#
+# See documentation on how to write CMake scripts at
+# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
+
+include(LibFindMacros)
+
+libfind_pkg_check_modules(ALSA_PKGCONF alsa)
+
+find_path(ALSA_INCLUDE_DIR
+ NAMES alsa/version.h
+ PATHS ${ALSA_PKGCONF_INCLUDE_DIRS}
+)
+
+find_library(ALSA_LIBRARY
+ NAMES asound
+ PATHS ${ALSA_PKGCONF_LIBRARY_DIRS}
+)
+
+# Extract the version number
+IF(ALSA_INCLUDE_DIR)
+file(READ "${ALSA_INCLUDE_DIR}/alsa/version.h" _ALSA_VERSION_H_CONTENTS)
+string(REGEX REPLACE ".*#define SND_LIB_VERSION_STR[ \t]*\"([^\n]*)\".*" "\\1" ALSA_VERSION "${_ALSA_VERSION_H_CONTENTS}")
+ENDIF(ALSA_INCLUDE_DIR)
+
+set(ALSA_PROCESS_INCLUDES ALSA_INCLUDE_DIR)
+set(ALSA_PROCESS_LIBS ALSA_LIBRARY)
+libfind_process(ALSA)
+
diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake
new file mode 100644
index 000000000..9af308f84
--- /dev/null
+++ b/cmake/Modules/FindCppUnit.cmake
@@ -0,0 +1,36 @@
+# http://www.cmake.org/pipermail/cmake/2006-October/011446.html
+# Modified to use pkg config and use standard var names
+
+#
+# Find the CppUnit includes and library
+#
+# This module defines
+# CPPUNIT_INCLUDE_DIR, 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(PC_CPPUNIT "cppunit")
+
+FIND_PATH(CPPUNIT_INCLUDE_DIRS
+ NAMES cppunit/TestCase.h
+ HINTS ${PC_CPPUNIT_INCLUDE_DIR}
+ PATHS
+ /usr/local/include
+ /usr/include
+)
+
+FIND_LIBRARY(CPPUNIT_LIBRARIES
+ NAMES cppunit
+ HINTS ${PC_CPPUNIT_LIBDIR}
+ PATHS
+ ${CPPUNIT_INCLUDE_DIRS}/../lib
+ /usr/local/lib
+ /usr/lib
+)
+
+LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS})
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
+MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindFFTW3f.cmake b/cmake/Modules/FindFFTW3f.cmake
new file mode 100644
index 000000000..0ee7e46fe
--- /dev/null
+++ b/cmake/Modules/FindFFTW3f.cmake
@@ -0,0 +1,41 @@
+# http://tim.klingt.org/code/projects/supernova/repository/revisions/d336dd6f400e381bcfd720e96139656de0c53b6a/entry/cmake_modules/FindFFTW3f.cmake
+# Modified to use pkg config and use standard var names
+
+# Find single-precision (float) version of FFTW3
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(PC_FFTW3F "fftw3f >= 3.0")
+
+FIND_PATH(
+ FFTW3F_INCLUDE_DIRS
+ NAMES fftw3.h
+ HINTS $ENV{FFTW3_DIR}/include
+ ${PC_FFTW3F_INCLUDE_DIR}
+ PATHS /usr/local/include
+ /usr/include
+)
+
+FIND_LIBRARY(
+ FFTW3F_LIBRARIES
+ NAMES fftw3f libfftw3f
+ HINTS $ENV{FFTW3_DIR}/lib
+ ${PC_FFTW3F_LIBDIR}
+ PATHS /usr/local/lib
+ /usr/lib
+ /usr/lib64
+)
+
+FIND_LIBRARY(
+ FFTW3F_THREADS_LIBRARIES
+ NAMES fftw3f_threads libfftw3f_threads
+ HINTS $ENV{FFTW3_DIR}/lib
+ ${PC_FFTW3F_LIBDIR}
+ PATHS /usr/local/lib
+ /usr/lib
+ /usr/lib64
+)
+
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS)
+MARK_AS_ADVANCED(FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS FFTW3F_THREADS_LIBRARIES) \ No newline at end of file
diff --git a/cmake/Modules/FindGSL.cmake b/cmake/Modules/FindGSL.cmake
new file mode 100644
index 000000000..6d7155284
--- /dev/null
+++ b/cmake/Modules/FindGSL.cmake
@@ -0,0 +1,146 @@
+# Try to find gnu scientific library GSL
+# See
+# http://www.gnu.org/software/gsl/ and
+# http://gnuwin32.sourceforge.net/packages/gsl.htm
+#
+# Based on a script of Felix Woelk and Jan Woetzel
+# (www.mip.informatik.uni-kiel.de)
+#
+# It defines the following variables:
+# GSL_FOUND - system has GSL lib
+# GSL_INCLUDE_DIRS - where to find headers
+# GSL_LIBRARIES - full path to the libraries
+# GSL_LIBRARY_DIRS, the directory where the PLplot library is found.
+
+# CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`"
+# GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix
+# GSL_EXE_LINKER_FLAGS = rpath on Unix
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(GSL "gsl >= 1.10")
+IF(NOT GSL_FOUND)
+
+set( GSL_FOUND OFF )
+set( GSL_CBLAS_FOUND OFF )
+
+# Windows, but not for Cygwin and MSys where gsl-config is available
+if( WIN32 AND NOT CYGWIN AND NOT MSYS )
+ # look for headers
+ find_path( GSL_INCLUDE_DIRS
+ NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
+ )
+ if( GSL_INCLUDE_DIRS )
+ # look for gsl library
+ find_library( GSL_LIBRARY
+ NAMES gsl
+ )
+ if( GSL_LIBRARY )
+ set( GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
+ get_filename_component( GSL_LIBRARY_DIRS ${GSL_LIBRARY} PATH )
+ set( GSL_FOUND ON )
+ endif( GSL_LIBRARY )
+
+ # look for gsl cblas library
+ find_library( GSL_CBLAS_LIBRARY
+ NAMES gslcblas
+ )
+ if( GSL_CBLAS_LIBRARY )
+ set( GSL_CBLAS_FOUND ON )
+ endif( GSL_CBLAS_LIBRARY )
+
+ set( GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY} )
+ endif( GSL_INCLUDE_DIRS )
+
+ mark_as_advanced(
+ GSL_INCLUDE_DIRS
+ GSL_LIBRARIES
+ GSL_CBLAS_LIBRARIES
+ )
+else( WIN32 AND NOT CYGWIN AND NOT MSYS )
+ if( UNIX OR MSYS )
+ find_program( GSL_CONFIG_EXECUTABLE gsl-config
+ /usr/bin/
+ /usr/local/bin
+ )
+
+ if( GSL_CONFIG_EXECUTABLE )
+ set( GSL_FOUND ON )
+
+ # run the gsl-config program to get cxxflags
+ execute_process(
+ COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --cflags
+ OUTPUT_VARIABLE GSL_CFLAGS
+ RESULT_VARIABLE RET
+ ERROR_QUIET
+ )
+ if( RET EQUAL 0 )
+ string( STRIP "${GSL_CFLAGS}" GSL_CFLAGS )
+ separate_arguments( GSL_CFLAGS )
+
+ # parse definitions from cflags; drop -D* from CFLAGS
+ string( REGEX MATCHALL "-D[^;]+"
+ GSL_DEFINITIONS "${GSL_CFLAGS}" )
+ string( REGEX REPLACE "-D[^;]+;" ""
+ GSL_CFLAGS "${GSL_CFLAGS}" )
+
+ # parse include dirs from cflags; drop -I prefix
+ string( REGEX MATCHALL "-I[^;]+"
+ GSL_INCLUDE_DIRS "${GSL_CFLAGS}" )
+ string( REPLACE "-I" ""
+ GSL_INCLUDE_DIRS "${GSL_INCLUDE_DIRS}")
+ string( REGEX REPLACE "-I[^;]+;" ""
+ GSL_CFLAGS "${GSL_CFLAGS}")
+
+ message("GSL_DEFINITIONS=${GSL_DEFINITIONS}")
+ message("GSL_INCLUDE_DIRS=${GSL_INCLUDE_DIRS}")
+ message("GSL_CFLAGS=${GSL_CFLAGS}")
+ else( RET EQUAL 0 )
+ set( GSL_FOUND FALSE )
+ endif( RET EQUAL 0 )
+
+ # run the gsl-config program to get the libs
+ execute_process(
+ COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --libs
+ OUTPUT_VARIABLE GSL_LIBRARIES
+ RESULT_VARIABLE RET
+ ERROR_QUIET
+ )
+ if( RET EQUAL 0 )
+ string(STRIP "${GSL_LIBRARIES}" GSL_LIBRARIES )
+ separate_arguments( GSL_LIBRARIES )
+
+ # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
+ string( REGEX MATCHALL "-L[^;]+"
+ GSL_LIBRARY_DIRS "${GSL_LIBRARIES}" )
+ string( REPLACE "-L" ""
+ GSL_LIBRARY_DIRS "${GSL_LIBRARY_DIRS}" )
+ else( RET EQUAL 0 )
+ set( GSL_FOUND FALSE )
+ endif( RET EQUAL 0 )
+
+ MARK_AS_ADVANCED(
+ GSL_CFLAGS
+ )
+ message( STATUS "Using GSL from ${GSL_PREFIX}" )
+ else( GSL_CONFIG_EXECUTABLE )
+ message( STATUS "FindGSL: gsl-config not found.")
+ endif( GSL_CONFIG_EXECUTABLE )
+ endif( UNIX OR MSYS )
+endif( WIN32 AND NOT CYGWIN AND NOT MSYS )
+
+if( GSL_FOUND )
+ if( NOT GSL_FIND_QUIETLY )
+ message( STATUS "FindGSL: Found both GSL headers and library" )
+ endif( NOT GSL_FIND_QUIETLY )
+else( GSL_FOUND )
+ if( GSL_FIND_REQUIRED )
+ message( FATAL_ERROR "FindGSL: Could not find GSL headers or library" )
+ endif( GSL_FIND_REQUIRED )
+endif( GSL_FOUND )
+
+#needed for gsl windows port but safe to always define
+LIST(APPEND GSL_DEFINITIONS "-DGSL_DLL")
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSL DEFAULT_MSG GSL_LIBRARIES GSL_INCLUDE_DIRS)
+ENDIF(NOT GSL_FOUND)
diff --git a/cmake/Modules/FindGit.cmake b/cmake/Modules/FindGit.cmake
new file mode 100644
index 000000000..2d8214287
--- /dev/null
+++ b/cmake/Modules/FindGit.cmake
@@ -0,0 +1,46 @@
+# The module defines the following variables:
+# GIT_EXECUTABLE - path to git command line client
+# GIT_FOUND - true if the command line client was found
+# Example usage:
+# find_package(Git)
+# if(GIT_FOUND)
+# message("git found: ${GIT_EXECUTABLE}")
+# endif()
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# 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.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Look for 'git' or 'eg' (easy git)
+#
+set(git_names git eg)
+
+# Prefer .cmd variants on Windows unless running in a Makefile
+# in the MSYS shell.
+#
+if(WIN32)
+ if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+ set(git_names git.cmd git eg.cmd eg)
+ endif()
+endif()
+
+find_program(GIT_EXECUTABLE
+ NAMES ${git_names}
+ DOC "git command line client"
+ )
+mark_as_advanced(GIT_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# all listed variables are TRUE
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
diff --git a/cmake/Modules/FindJack.cmake b/cmake/Modules/FindJack.cmake
new file mode 100644
index 000000000..4bdfe0a7e
--- /dev/null
+++ b/cmake/Modules/FindJack.cmake
@@ -0,0 +1,82 @@
+# - Try to find jack-2.6
+# Once done this will define
+#
+# JACK_FOUND - system has jack
+# JACK_INCLUDE_DIRS - the jack include directory
+# JACK_LIBRARIES - Link these to use jack
+# JACK_DEFINITIONS - Compiler switches required for using jack
+#
+# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
+# Modified for other libraries by Lasse Kärkkäinen <tronic>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
+ # in cache already
+ set(JACK_FOUND TRUE)
+else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_JACK jack)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(JACK_INCLUDE_DIR
+ NAMES
+ jack/jack.h
+ PATHS
+ ${_JACK_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(JACK_LIBRARY
+ NAMES
+ jack
+ PATHS
+ ${_JACK_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
+ set(JACK_FOUND TRUE)
+
+ set(JACK_INCLUDE_DIRS
+ ${JACK_INCLUDE_DIR}
+ )
+
+ set(JACK_LIBRARIES
+ ${JACK_LIBRARIES}
+ ${JACK_LIBRARY}
+ )
+
+ endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
+
+ if (JACK_FOUND)
+ if (NOT JACK_FIND_QUIETLY)
+ message(STATUS "Found jack: ${JACK_LIBRARY}")
+ endif (NOT JACK_FIND_QUIETLY)
+ else (JACK_FOUND)
+ if (JACK_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find JACK")
+ endif (JACK_FIND_REQUIRED)
+ endif (JACK_FOUND)
+
+ # show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
+ mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES)
+
+endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
+
diff --git a/cmake/Modules/FindOSS.cmake b/cmake/Modules/FindOSS.cmake
new file mode 100644
index 000000000..4c886de5f
--- /dev/null
+++ b/cmake/Modules/FindOSS.cmake
@@ -0,0 +1,46 @@
+# - Find Oss
+# Find Oss headers and libraries.
+#
+# OSS_INCLUDE_DIR - where to find soundcard.h, etc.
+# OSS_FOUND - True if Oss found.
+
+
+FIND_PATH(LINUX_OSS_INCLUDE_DIR "linux/soundcard.h"
+ "/usr/include" "/usr/local/include"
+)
+
+FIND_PATH(SYS_OSS_INCLUDE_DIR "sys/soundcard.h"
+ "/usr/include" "/usr/local/include"
+)
+
+FIND_PATH(MACHINE_OSS_INCLUDE_DIR "machine/soundcard.h"
+ "/usr/include" "/usr/local/include"
+)
+
+SET(OSS_FOUND FALSE)
+
+IF(LINUX_OSS_INCLUDE_DIR)
+ SET(OSS_FOUND TRUE)
+ SET(OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR})
+ SET(HAVE_LINUX_SOUNDCARD_H 1)
+ENDIF()
+
+IF(SYS_OSS_INCLUDE_DIR)
+ SET(OSS_FOUND TRUE)
+ SET(OSS_INCLUDE_DIR ${SYS_OSS_INCLUDE_DIR})
+ SET(HAVE_SYS_SOUNDCARD_H 1)
+ENDIF()
+
+IF(MACHINE_OSS_INCLUDE_DIR)
+ SET(OSS_FOUND TRUE)
+ SET(OSS_INCLUDE_DIR ${MACHINE_OSS_INCLUDE_DIR})
+ SET(HAVE_MACHINE_SOUNDCARD_H 1)
+ENDIF()
+
+MARK_AS_ADVANCED (
+ OSS_FOUND
+ OSS_INCLUDE_DIR
+ LINUX_OSS_INCLUDE_DIR
+ SYS_OSS_INCLUDE_DIR
+ MACHINE_OSS_INCLUDE_DIR
+)
diff --git a/cmake/Modules/FindPortaudio.cmake b/cmake/Modules/FindPortaudio.cmake
new file mode 100644
index 000000000..61e4ae23a
--- /dev/null
+++ b/cmake/Modules/FindPortaudio.cmake
@@ -0,0 +1,35 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+# PORTAUDIO_FOUND - system has Portaudio
+# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+# PORTAUDIO_LIBRARIES - Link these to use Portaudio
+
+include(FindPkgConfig)
+pkg_check_modules(PC_PORTAUDIO portaudio)
+
+find_path(PORTAUDIO_INCLUDE_DIRS
+ NAMES
+ portaudio.h
+ PATHS
+ /usr/local/include
+ /usr/include
+ HINTS
+ ${PC_PORTAUDIO_INCLUDE_DIR}
+)
+
+find_library(PORTAUDIO_LIBRARIES
+ NAMES
+ portaudio
+ PATHS
+ /usr/local/lib
+ /usr/lib
+ /usr/lib64
+ HINTS
+ ${PC_PORTAUDIO_LIBDIR}
+)
+
+mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
new file mode 100644
index 000000000..db5ca6d27
--- /dev/null
+++ b/cmake/Modules/FindQwt.cmake
@@ -0,0 +1,32 @@
+# - try to find Qwt libraries and include files
+# QWT_INCLUDE_DIR where to find qwt_plot.h, etc.
+# QWT_LIBRARIES libraries to link against
+# QWT_FOUND If false, do not try to use Qwt
+
+find_path (QWT_INCLUDE_DIRS
+ NAMES qwt_plot.h
+ PATHS
+ /usr/local/include/qwt-qt4
+ /usr/local/include/qwt
+ /usr/include/qwt-qt4
+ /usr/include/qwt
+ /opt/local/include/qwt
+ /opt/local/lib/qwt.framework/Headers
+ /sw/include/qwt
+)
+
+find_library (QWT_LIBRARIES
+ NAMES qwt-qt4 qwt
+ PATHS
+ /usr/local/lib
+ /usr/lib
+ /opt/local/lib
+ /opt/local/lib/qwt.framework
+ /sw/lib
+)
+
+# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
+# all listed variables are TRUE
+include ( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
+MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake
new file mode 100644
index 000000000..da12ee93d
--- /dev/null
+++ b/cmake/Modules/FindSphinx.cmake
@@ -0,0 +1,37 @@
+# - This module looks for Sphinx
+# Find the Sphinx documentation generator
+#
+# This modules defines
+# SPHINX_EXECUTABLE
+# SPHINX_FOUND
+
+#=============================================================================
+# Copyright 2002-2009 Kitware, Inc.
+# Copyright 2009-2011 Peter Colberg
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file COPYING-CMAKE-SCRIPTS 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.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_program(SPHINX_EXECUTABLE NAMES sphinx-build
+ HINTS
+ $ENV{SPHINX_DIR}
+ PATH_SUFFIXES bin
+ DOC "Sphinx documentation generator"
+)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(Sphinx DEFAULT_MSG
+ SPHINX_EXECUTABLE
+)
+
+mark_as_advanced(
+ SPHINX_EXECUTABLE
+)
diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake
new file mode 100644
index 000000000..b4d12b6d7
--- /dev/null
+++ b/cmake/Modules/FindUHD.cmake
@@ -0,0 +1,28 @@
+########################################################################
+# Find the library for the USRP Hardware Driver
+########################################################################
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(PC_UHD uhd)
+
+FIND_PATH(
+ UHD_INCLUDE_DIRS
+ NAMES uhd/config.hpp
+ HINTS $ENV{UHD_DIR}/include
+ ${PC_UHD_INCLUDEDIR}
+ PATHS /usr/local/include
+ /usr/include
+)
+
+FIND_LIBRARY(
+ UHD_LIBRARIES
+ NAMES uhd
+ HINTS $ENV{UHD_DIR}/lib
+ ${PC_UHD_LIBDIR}
+ PATHS /usr/local/lib
+ /usr/lib
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
+MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindUSB.cmake b/cmake/Modules/FindUSB.cmake
new file mode 100644
index 000000000..97f3db675
--- /dev/null
+++ b/cmake/Modules/FindUSB.cmake
@@ -0,0 +1,28 @@
+if(NOT LIBUSB_FOUND)
+ pkg_check_modules (LIBUSB_PKG libusb-1.0)
+ find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
+ PATHS
+ ${LIBUSB_PKG_INCLUDE_DIRS}
+ /usr/include/libusb-1.0
+ /usr/include
+ /usr/local/include
+ )
+
+ find_library(LIBUSB_LIBRARIES NAMES usb-1.0
+ PATHS
+ ${LIBUSB_PKG_LIBRARY_DIRS}
+ /usr/lib
+ /usr/local/lib
+ )
+
+if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
+else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "libusb-1.0 not found.")
+endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+
+mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
+
+endif(NOT LIBUSB_FOUND)
diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake
new file mode 100644
index 000000000..d2e91a6f1
--- /dev/null
+++ b/cmake/Modules/GrBoost.cmake
@@ -0,0 +1,99 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+########################################################################
+# Setup Boost and handle some system specific things
+########################################################################
+
+set(BOOST_REQUIRED_COMPONENTS
+ date_time
+ program_options
+ filesystem
+ system
+ thread
+)
+
+if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
+ list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
+endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
+
+if(MSVC)
+ set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono)
+
+ 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)
+
+find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+
+# This does not allow us to disable specific versions. It is used
+# internally by cmake to know the formation newer versions. As newer
+# Boost version beyond what is shown here are produced, we must extend
+# this list. To disable Boost versions, see below.
+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"
+ "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
+ "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
+ "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"
+)
+
+# Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
+# Similar problems with Boost 1.46 and 1.47.
+
+OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF)
+if(ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "Enabling use of known bad versions of Boost.")
+endif(ENABLE_BAD_BOOST)
+
+# For any unsuitable Boost version, add the version number below in
+# the following format: XXYYZZ
+# Where:
+# XX is the major version ('10' for version 1)
+# YY is the minor version number ('46' for 1.46)
+# ZZ is the patcher version number (typically just '00')
+set(Boost_NOGO_VERSIONS
+ 104600 104601 104700 105200
+ )
+
+foreach(ver ${Boost_NOGO_VERSIONS})
+ if(${Boost_VERSION} EQUAL ${ver})
+ if(NOT ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
+ set(Boost_FOUND FALSE)
+ else(NOT ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
+ set(Boost_FOUND TRUE)
+ endif(NOT ENABLE_BAD_BOOST)
+ endif(${Boost_VERSION} EQUAL ${ver})
+endforeach(ver)
diff --git a/cmake/Modules/GrComponent.cmake b/cmake/Modules/GrComponent.cmake
new file mode 100644
index 000000000..f802cdcb4
--- /dev/null
+++ b/cmake/Modules/GrComponent.cmake
@@ -0,0 +1,115 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+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()
+
+########################################################################
+# Register a component into the system
+# - name: canonical component name
+# - 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)
+
+ #if the user set the var to force, we note this
+ if("${${var}}" STREQUAL "FORCE")
+ set(${var} ON)
+ set(var_force TRUE)
+ else()
+ set(var_force FALSE)
+ endif()
+
+ #rewrite the dependency list so that deps that are also components use the cached version
+ unset(comp_deps)
+ foreach(dep ${ARGN})
+ list(FIND _gr_enabled_components ${dep} dep_enb_index)
+ list(FIND _gr_disabled_components ${dep} dep_dis_index)
+ if (${dep_enb_index} EQUAL -1 AND ${dep_dis_index} EQUAL -1)
+ list(APPEND comp_deps ${dep})
+ else()
+ list(APPEND comp_deps ${dep}_cached) #is a component, use cached version
+ endif()
+ endforeach(dep)
+
+ #setup the dependent option for this component
+ CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${ENABLE_DEFAULT} "${comp_deps}" OFF)
+ set(${var} "${${var}}" PARENT_SCOPE)
+ set(${var}_cached "${${var}}" CACHE INTERNAL "" FORCE)
+
+ #force was specified, but the dependencies were not met
+ if(NOT ${var} AND var_force)
+ message(FATAL_ERROR "user force-enabled ${name} but configuration checked failed")
+ endif()
+
+ #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")
+
+ #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)
+
+########################################################################
+# 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)
+
+ 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)
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
new file mode 100644
index 000000000..b9ab38fc6
--- /dev/null
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -0,0 +1,280 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+########################################################################
+# 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)
+
+########################################################################
+# 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)
+
+########################################################################
+# 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)
+ CHECK_INCLUDE_FILE_CXX(${hdr} ${def})
+ GR_ADD_COND_DEF(${def})
+endfunction(GR_CHECK_HDR_N_DEF)
+
+########################################################################
+# Include subdirectory macro.
+# Sets the CMake directory variables,
+# includes the subdirectory CMakeLists.txt,
+# resets the CMake directory variables.
+#
+# This macro includes subdirectories rather than adding them
+# so that the subdirectory can affect variables in the level above.
+# 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)
+ #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})
+
+ #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})
+
+ #include the subdirectory CMakeLists to run it
+ 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)
+
+ #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)
+
+########################################################################
+# Check if a compiler flag works and conditionally set a compile define.
+# - flag the compiler flag to check for
+# - have the variable to set with result
+########################################################################
+macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
+ include(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG(${flag} ${have})
+ if(${have})
+ add_definitions(${flag})
+ endif(${have})
+endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
+
+########################################################################
+# Generates the .la libtool file
+# This appears to generate libtool files that cannot be used by auto*.
+# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest])
+# Notice: there is not COMPONENT option, these will not get distributed.
+########################################################################
+function(GR_LIBTOOL)
+ if(NOT DEFINED GENERATE_LIBTOOL)
+ set(GENERATE_LIBTOOL OFF) #disabled by default
+ endif()
+
+ if(GENERATE_LIBTOOL)
+ include(CMakeParseArgumentsCopy)
+ CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN})
+
+ find_program(LIBTOOL libtool)
+ if(LIBTOOL)
+ include(CMakeMacroLibtoolFile)
+ CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION})
+ endif(LIBTOOL)
+ endif(GENERATE_LIBTOOL)
+
+endfunction(GR_LIBTOOL)
+
+########################################################################
+# Do standard things to the library target
+# - set target properties
+# - make install rules
+# Also handle gnuradio custom naming conventions w/ extras mode.
+########################################################################
+function(GR_LIBRARY_FOO target)
+
+ target_link_libraries(${target} ${GR_MOAR_LIBRARIES})
+
+ #parse the arguments for component names
+ include(CMakeParseArgumentsCopy)
+ CMAKE_PARSE_ARGUMENTS(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN})
+
+ #set additional target properties
+ set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER})
+
+ #install the generated files like so...
+ install(TARGETS ${target}
+ LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .so/.dylib file
+ ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_DEVEL_COMPONENT} # .lib file
+ RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .dll file
+ )
+
+ #extras mode enabled automatically on linux
+ if(NOT DEFINED LIBRARY_EXTRAS)
+ set(LIBRARY_EXTRAS ${LINUX})
+ endif()
+
+ #special extras mode to enable alternative naming conventions
+ if(LIBRARY_EXTRAS)
+
+ #create .la file before changing props
+ GR_LIBTOOL(TARGET ${target} DESTINATION ${GR_LIBRARY_DIR})
+
+ #give the library a special name with ultra-zero soversion
+ set_target_properties(${target} PROPERTIES OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0")
+ set(target_name lib${target}-${LIBVER}.so.0.0.0)
+
+ #custom command to generate symlinks
+ add_custom_command(
+ TARGET ${target}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
+ COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install
+ )
+
+ #and install the extra symlinks
+ install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
+ ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
+ DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT}
+ )
+
+ endif(LIBRARY_EXTRAS)
+endfunction(GR_LIBRARY_FOO)
+
+########################################################################
+# Create a dummy custom command that depends on other targets.
+# Usage:
+# GR_GEN_TARGET_DEPS(unique_name target_deps <target1> <target2> ...)
+# ADD_CUSTOM_COMMAND(<the usual args> ${target_deps})
+#
+# Custom command cant depend on targets, but can depend on executables,
+# and executables can depend on targets. So this is the process:
+########################################################################
+function(GR_GEN_TARGET_DEPS name var)
+ file(
+ WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
+ "int main(void){return 0;}\n"
+ )
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp
+ )
+ add_executable(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp)
+ if(ARGN)
+ add_dependencies(${name} ${ARGN})
+ endif(ARGN)
+
+ if(CMAKE_CROSSCOMPILING)
+ set(${var} "DEPENDS;${name}" PARENT_SCOPE) #cant call command when cross
+ else()
+ set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE)
+ endif()
+endfunction(GR_GEN_TARGET_DEPS)
+
+
+########################################################################
+# Run GRCC to compile .grc files into .py files.
+#
+# Usage: GRCC(filename, directory)
+# - filenames: List of file name of .grc file
+# - directory: directory of built .py file - usually in
+# ${CMAKE_CURRENT_BINARY_DIR}
+# - Sets PYFILES: output converted GRC file names to Python files.
+########################################################################
+function(GRCC)
+ # Extract directory from list of args, remove it for the list of filenames.
+ list(GET ARGV -1 directory)
+ list(REMOVE_AT ARGV -1)
+ set(filenames ${ARGV})
+ file(MAKE_DIRECTORY ${directory})
+
+ SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/src/python/grcc)
+
+ # GRCC uses some stuff in grc and gnuradio-core, so we force
+ # the known paths here
+ list(APPEND PYTHONPATHS
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/gnuradio-core/src/python
+ ${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/swig
+ ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
+ )
+
+ 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 ${PYTHONPATHS})
+ get_filename_component(name ${pydir} NAME)
+ if(name MATCHES "^(swig|lib|src)$")
+ list(APPEND PYTHONPATHS ${pydir}/${CMAKE_BUILD_TYPE})
+ endif()
+ endforeach(pydir)
+ endif(WIN32)
+
+ file(TO_NATIVE_PATH "${PYTHONPATHS}" pypath)
+
+ if(UNIX)
+ list(APPEND pypath "$PYTHONPATH")
+ string(REPLACE ";" ":" pypath "${pypath}")
+ set(ENV{PYTHONPATH} ${pypath})
+ endif(UNIX)
+
+ if(WIN32)
+ list(APPEND pypath "%PYTHONPATH%")
+ string(REPLACE ";" "\\;" pypath "${pypath}")
+ #list(APPEND environs "PYTHONPATH=${pypath}")
+ set(ENV{PYTHONPATH} ${pypath})
+ endif(WIN32)
+
+ foreach(f ${filenames})
+ execute_process(
+ COMMAND ${GRCC_COMMAND} -d ${directory} ${f}
+ )
+ string(REPLACE ".grc" ".py" pyfile "${f}")
+ string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" pyfile "${pyfile}")
+ list(APPEND pyfiles ${pyfile})
+ endforeach(f)
+
+ set(PYFILES ${pyfiles} PARENT_SCOPE)
+endfunction(GRCC)
diff --git a/cmake/Modules/GrPackage.cmake b/cmake/Modules/GrPackage.cmake
new file mode 100644
index 000000000..d1b0b3320
--- /dev/null
+++ b/cmake/Modules/GrPackage.cmake
@@ -0,0 +1,177 @@
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+include(GrVersion) #sets version information
+include(GrPlatform) #sets platform information
+
+#set the cpack generator based on the platform type
+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()
+
+########################################################################
+# 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)
+
+########################################################################
+# CPACK_FINALIZE - include cpack and the unset all the cpack variables
+########################################################################
+function(CPACK_FINALIZE)
+
+ #set the package depends for monolithic package
+ foreach(comp ${CPACK_COMPONENTS_ALL})
+ string(TOUPPER "PACKAGE_DEPENDS_${comp}" package_depends_var)
+ list(APPEND PACKAGE_DEPENDS_ALL ${${package_depends_var}})
+ endforeach(comp)
+ string(REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_DEPENDS "${PACKAGE_DEPENDS_ALL}")
+ string(REPLACE ";" ", " CPACK_RPM_PACKAGE_REQUIRES "${PACKAGE_DEPENDS_ALL}")
+
+ 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
+#
+# Usage: CPACK_COMPONENT(
+# name
+# [GROUP group]
+# [DISPLAY_NAME display_name]
+# [DESCRIPTION description]
+# [DEPENDS 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})
+ CPACK_SET(CPACK_COMPONENT_${name_upper}_${_option} "${CPACK_COMPONENT_${_option}}")
+ endif()
+ endforeach(_option)
+
+ CPACK_SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL};${name}")
+
+endfunction(CPACK_COMPONENT)
+
+########################################################################
+# Setup CPack
+########################################################################
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GNU Radio - The GNU Software Radio")
+set(CPACK_PACKAGE_VENDOR "Free Software Foundation, Inc.")
+set(CPACK_PACKAGE_CONTACT "Discuss GNURadio <discuss-gnuradio@gnu.org>")
+string(REPLACE "v" "" 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)
+
+find_program(LSB_RELEASE_EXECUTABLE lsb_release)
+
+if((DEBIAN OR REDHAT) AND LSB_RELEASE_EXECUTABLE)
+
+ #extract system information by executing the commands
+ execute_process(
+ COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id
+ OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ execute_process(
+ COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release
+ OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ #set a more sensible package name for this system
+ SET(CPACK_PACKAGE_FILE_NAME "gnuradio_${CPACK_PACKAGE_VERSION}_${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}")
+
+ #now try to include the component based dependencies
+ set(package_deps_file "${CMAKE_SOURCE_DIR}/cmake/Packaging/${LSB_ID}-${LSB_RELEASE}.cmake")
+ if (EXISTS ${package_deps_file})
+ include(${package_deps_file})
+ endif()
+
+endif()
+
+if(${CPACK_GENERATOR} STREQUAL NSIS)
+
+ ENABLE_LANGUAGE(C)
+
+ include(CheckTypeSize)
+ check_type_size("void*[8]" BIT_WIDTH BUILTIN_TYPES_ONLY)
+ SET(CPACK_PACKAGE_FILE_NAME "gnuradio_${CPACK_PACKAGE_VERSION}_Win${BIT_WIDTH}")
+
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
+endif()
+
+########################################################################
+# DEB package specific
+########################################################################
+foreach(filename preinst postinst prerm postrm)
+ list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_BINARY_DIR}/Packaging/${filename})
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Packaging)
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/cmake/Packaging/${filename}.in
+ ${CMAKE_BINARY_DIR}/Packaging/${filename}
+ @ONLY)
+endforeach(filename)
+
+########################################################################
+# RPM package specific
+########################################################################
+foreach(filename post_install post_uninstall pre_install pre_uninstall)
+ string(TOUPPER ${filename} filename_upper)
+ list(APPEND CPACK_RPM_${filename_upper}_SCRIPT_FILE ${CMAKE_BINARY_DIR}/Packaging/${filename})
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Packaging)
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/cmake/Packaging/${filename}.in
+ ${CMAKE_BINARY_DIR}/Packaging/${filename}
+ @ONLY)
+endforeach(filename)
+
+########################################################################
+# NSIS package specific
+########################################################################
+set(CPACK_NSIS_MODIFY_PATH ON)
+
+set(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"")
diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake
new file mode 100644
index 000000000..5b7e886f8
--- /dev/null
+++ b/cmake/Modules/GrPlatform.cmake
@@ -0,0 +1,54 @@
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+########################################################################
+# Setup additional defines for OS types
+########################################################################
+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/redhat-release")
+ set(REDHAT TRUE)
+endif()
+
+if(LINUX AND EXISTS "/etc/slackware-version")
+ set(SLACKWARE TRUE)
+endif()
+
+########################################################################
+# when the library suffix should be 64 (applies to redhat linux family)
+########################################################################
+if (REDHAT OR SLACKWARE)
+ set(LIB64_CONVENTION TRUE)
+endif()
+
+if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION 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
new file mode 100644
index 000000000..791114e05
--- /dev/null
+++ b/cmake/Modules/GrPython.cmake
@@ -0,0 +1,234 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+########################################################################
+# Setup the python interpreter:
+# This allows the user to specify a specific interpreter,
+# or finds the interpreter via the built-in cmake module.
+########################################################################
+#this allows the user to override PYTHON_EXECUTABLE
+if(PYTHON_EXECUTABLE)
+
+ set(PYTHONINTERP_FOUND TRUE)
+
+#otherwise if not set, try to automatically find it
+else(PYTHON_EXECUTABLE)
+
+ #use the built-in find script
+ 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)
+
+endif(PYTHON_EXECUTABLE)
+
+#make the path to the executable appear in the cmake gui
+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(
+ 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)
+
+########################################################################
+# Check for the existence of a python module:
+# - desc a string description of the check
+# - mod the name of the module to import
+# - 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(
+ COMMAND ${PYTHON_EXECUTABLE} -c "
+#########################################
+try:
+ import ${mod}
+ assert ${cmd}
+except ImportError, AssertionError: exit(-1)
+except: pass
+#########################################"
+ 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)
+
+########################################################################
+# Sets the python installation directory GR_PYTHON_DIR
+########################################################################
+if(NOT DEFINED GR_PYTHON_DIR)
+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
+)
+endif()
+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
+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)
+
+########################################################################
+# Install python sources (also builds and installs byte-compiled python)
+########################################################################
+function(GR_PYTHON_INSTALL)
+ include(CMakeParseArgumentsCopy)
+ CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN})
+
+ ####################################################################
+ if(GR_PYTHON_INSTALL_FILES)
+ ####################################################################
+ install(${ARGN}) #installs regular python files
+
+ #create a list of all generated files
+ unset(pysrcfiles)
+ unset(pycfiles)
+ unset(pyofiles)
+ foreach(pyfile ${GR_PYTHON_INSTALL_FILES})
+ get_filename_component(pyfile ${pyfile} ABSOLUTE)
+ list(APPEND pysrcfiles ${pyfile})
+
+ #determine if this file is in the source or binary directory
+ file(RELATIVE_PATH source_rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${pyfile})
+ string(LENGTH "${source_rel_path}" source_rel_path_len)
+ file(RELATIVE_PATH binary_rel_path ${CMAKE_CURRENT_BINARY_DIR} ${pyfile})
+ string(LENGTH "${binary_rel_path}" binary_rel_path_len)
+
+ #and set the generated path appropriately
+ if(${source_rel_path_len} GREATER ${binary_rel_path_len})
+ set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${binary_rel_path})
+ else()
+ set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${source_rel_path})
+ endif()
+ list(APPEND pycfiles ${pygenfile}c)
+ list(APPEND pyofiles ${pygenfile}o)
+
+ #ensure generation path exists
+ get_filename_component(pygen_path ${pygenfile} PATH)
+ file(MAKE_DIRECTORY ${pygen_path})
+
+ endforeach(pyfile)
+
+ #the command to generate the pyc files
+ add_custom_command(
+ DEPENDS ${pysrcfiles} OUTPUT ${pycfiles}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
+ )
+
+ #the command to generate the pyo files
+ add_custom_command(
+ DEPENDS ${pysrcfiles} OUTPUT ${pyofiles}
+ COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
+ )
+
+ #create install rule and add generated files to target list
+ set(python_install_gen_targets ${pycfiles} ${pyofiles})
+ install(FILES ${python_install_gen_targets}
+ DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
+ COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
+ )
+
+
+ ####################################################################
+ elseif(GR_PYTHON_INSTALL_PROGRAMS)
+ ####################################################################
+ file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native)
+
+ if (CMAKE_CROSSCOMPILING)
+ set(pyexe_native /usr/bin/env python)
+ endif()
+
+ 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})
+
+ add_custom_command(
+ OUTPUT ${pyexefile} DEPENDS ${pyfile}
+ COMMAND ${PYTHON_EXECUTABLE} -c
+ \"open('${pyexefile}', 'w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())\"
+ COMMENT "Shebangin ${pyfile_name}"
+ )
+
+ #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()
+
+ install(PROGRAMS ${pyexefile} RENAME ${pyfile_name}
+ DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
+ COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
+ )
+ endforeach(pyfile)
+
+ endif()
+
+ GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets})
+
+endfunction(GR_PYTHON_INSTALL)
+
+########################################################################
+# Write the python helper script that generates byte code files
+########################################################################
+file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py "
+import sys, py_compile
+files = sys.argv[1:]
+srcs, gens = files[:len(files)/2], files[len(files)/2:]
+for src, gen in zip(srcs, gens):
+ py_compile.compile(file=src, cfile=gen, doraise=True)
+")
diff --git a/cmake/Modules/GrSetupQt4.cmake b/cmake/Modules/GrSetupQt4.cmake
new file mode 100644
index 000000000..2fa4d9bab
--- /dev/null
+++ b/cmake/Modules/GrSetupQt4.cmake
@@ -0,0 +1,156 @@
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+if(DEFINED __INCLUDED_GR_USEQT4_CMAKE)
+ return()
+endif()
+set(__INCLUDED_GR_USEQT4_CMAKE TRUE)
+
+# This file is derived from the default "UseQt4" file provided by
+# CMake. This version sets the variables "QT_INCLUDE_DIRS",
+# "QT_LIBRARIES", and "QT_LIBRARIES_PLUGINS" depending on those
+# requested during the "find_package(Qt4 ...)" function call, but
+# without actually adding them to the include or library search
+# directories ("include_directories" or "link_directories"). The
+# adding in is done by the CMakeLists.txt build scripts in the using
+# project.
+
+# Copyright from the original file, as required by the license.
+################################################################
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+################################################################
+
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
+SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
+SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
+SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
+IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
+ENDIF()
+
+SET(QT_INCLUDE_DIRS ${QT_INCLUDE_DIR})
+SET(QT_LIBRARIES "")
+SET(QT_LIBRARIES_PLUGINS "")
+
+IF (QT_USE_QTMAIN)
+ IF (Q_WS_WIN)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
+ ENDIF (Q_WS_WIN)
+ENDIF (QT_USE_QTMAIN)
+
+IF(QT_DONT_USE_QTGUI)
+ SET(QT_USE_QTGUI 0)
+ELSE(QT_DONT_USE_QTGUI)
+ SET(QT_USE_QTGUI 1)
+ENDIF(QT_DONT_USE_QTGUI)
+
+IF(QT_DONT_USE_QTCORE)
+ SET(QT_USE_QTCORE 0)
+ELSE(QT_DONT_USE_QTCORE)
+ SET(QT_USE_QTCORE 1)
+ENDIF(QT_DONT_USE_QTCORE)
+
+IF (QT_USE_QT3SUPPORT)
+ ADD_DEFINITIONS(-DQT3_SUPPORT)
+ENDIF (QT_USE_QT3SUPPORT)
+
+# list dependent modules, so dependent libraries are added
+SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
+SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
+SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+IF(QT_QTDBUS_FOUND)
+ SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
+ELSE(QT_QTDBUS_FOUND)
+ SET(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
+ENDIF(QT_QTDBUS_FOUND)
+SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
+SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
+SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
+SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
+SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
+SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
+SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
+SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
+SET(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
+SET(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
+SET(QT_QTGUI_MODULE_DEPENDS QTCORE)
+SET(QT_QTTEST_MODULE_DEPENDS QTCORE)
+SET(QT_QTXML_MODULE_DEPENDS QTCORE)
+SET(QT_QTSQL_MODULE_DEPENDS QTCORE)
+SET(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
+
+# Qt modules (in order of dependence)
+FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
+ QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
+ QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
+ QTDBUS QTXML QTSQL QTNETWORK QTCORE)
+
+ IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+ IF (QT_${module}_FOUND)
+ IF(QT_USE_${module})
+ STRING(REPLACE "QT" "" qt_module_def "${module}")
+ ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
+ SET(QT_INCLUDE_DIRS ${QT_INCLUDE_DIRS} ${QT_${module}_INCLUDE_DIR})
+ ENDIF(QT_USE_${module})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
+ SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
+ IF(QT_IS_STATIC)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
+ ENDIF(QT_IS_STATIC)
+ FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
+ SET(QT_USE_${depend_module}_DEPENDS 1)
+ ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
+ ELSE (QT_${module}_FOUND)
+ MESSAGE("Qt ${module} library not found.")
+ ENDIF (QT_${module}_FOUND)
+ ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+
+ENDFOREACH(module)
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
new file mode 100644
index 000000000..505fe104c
--- /dev/null
+++ b/cmake/Modules/GrSwig.cmake
@@ -0,0 +1,236 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+include(GrPython)
+
+########################################################################
+# Builds a swig documentation file to be generated into python docstrings
+# Usage: GR_SWIG_MAKE_DOCS(output_file input_path input_path....)
+#
+# Set the following variable to specify extra dependent targets:
+# - GR_SWIG_DOCS_SOURCE_DEPS
+# - GR_SWIG_DOCS_TARGET_DEPS
+########################################################################
+function(GR_SWIG_MAKE_DOCS output_file)
+ if(ENABLE_DOXYGEN)
+
+ #setup the input files variable list, quote formated
+ set(input_files)
+ unset(INPUT_PATHS)
+ foreach(input_path ${ARGN})
+ if (IS_DIRECTORY ${input_path}) #when input path is a directory
+ file(GLOB input_path_h_files ${input_path}/*.h)
+ else() #otherwise its just a file, no glob
+ set(input_path_h_files ${input_path})
+ endif()
+ list(APPEND input_files ${input_path_h_files})
+ set(INPUT_PATHS "${INPUT_PATHS} \"${input_path}\"")
+ endforeach(input_path)
+
+ #determine the output directory
+ get_filename_component(name ${output_file} NAME_WE)
+ get_filename_component(OUTPUT_DIRECTORY ${output_file} PATH)
+ set(OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/${name}_swig_docs)
+ make_directory(${OUTPUT_DIRECTORY})
+
+ #generate the Doxyfile used by doxygen
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.swig_doc.in
+ ${OUTPUT_DIRECTORY}/Doxyfile
+ @ONLY)
+
+ #Create a dummy custom command that depends on other targets
+ include(GrMiscUtils)
+ GR_GEN_TARGET_DEPS(_${name}_tag tag_deps ${GR_SWIG_DOCS_TARGET_DEPS})
+
+ #call doxygen on the Doxyfile + input headers
+ add_custom_command(
+ OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml
+ DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps}
+ COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile
+ COMMENT "Generating doxygen xml for ${name} docs"
+ )
+
+ #call the swig_doc script on the xml files
+ add_custom_command(
+ OUTPUT ${output_file}
+ DEPENDS ${input_files} ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml
+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py
+ ${OUTPUT_DIRECTORY}/xml
+ ${output_file}
+ COMMENT "Generating python docstrings for ${name}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/doxygen
+ )
+
+ else(ENABLE_DOXYGEN)
+ file(WRITE ${output_file} "\n") #no doxygen -> empty file
+ endif(ENABLE_DOXYGEN)
+endfunction(GR_SWIG_MAKE_DOCS)
+
+########################################################################
+# Build a swig target for the common gnuradio use case. Usage:
+# GR_SWIG_MAKE(target ifile ifile ifile...)
+#
+# Set the following variables before calling:
+# - GR_SWIG_FLAGS
+# - GR_SWIG_INCLUDE_DIRS
+# - GR_SWIG_LIBRARIES
+# - GR_SWIG_SOURCE_DEPS
+# - GR_SWIG_TARGET_DEPS
+# - GR_SWIG_DOC_FILE
+# - GR_SWIG_DOC_DIRS
+########################################################################
+macro(GR_SWIG_MAKE name)
+ set(ifiles ${ARGN})
+
+ list(APPEND GR_SWIG_LIBRARIES ${GR_MOAR_LIBRARIES})
+
+ #do swig doc generation if specified
+ if (GR_SWIG_DOC_FILE)
+ set(GR_SWIG_DOCS_SOURCE_DEPS ${GR_SWIG_SOURCE_DEPS})
+ set(GR_SWIG_DOCS_TARGET_DEPS ${GR_SWIG_TARGET_DEPS})
+ GR_SWIG_MAKE_DOCS(${GR_SWIG_DOC_FILE} ${GR_SWIG_DOC_DIRS})
+ add_custom_target(${name}_swig_doc DEPENDS ${GR_SWIG_DOC_FILE})
+ list(APPEND GR_SWIG_TARGET_DEPS ${name}_swig_doc)
+ endif()
+
+ #append additional include directories
+ find_package(PythonLibs)
+ list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs)
+ list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
+ list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
+ list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR})
+
+ #determine include dependencies for swig file
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${CMAKE_BINARY_DIR}/get_swig_deps.py
+ "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}"
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE SWIG_MODULE_${name}_EXTRA_DEPS
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ #Create a dummy custom command that depends on other targets
+ include(GrMiscUtils)
+ GR_GEN_TARGET_DEPS(_${name}_swig_tag tag_deps ${GR_SWIG_TARGET_DEPS})
+ set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag)
+ add_custom_command(
+ OUTPUT ${tag_file}
+ DEPENDS ${GR_SWIG_SOURCE_DEPS} ${tag_deps}
+ COMMAND ${CMAKE_COMMAND} -E touch ${tag_file}
+ )
+
+ #append the specified include directories
+ include_directories(${GR_SWIG_INCLUDE_DIRS})
+ list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})
+
+ #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 the C++ property on the swig .i file so it builds
+ set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON)
+
+ #setup the actual swig library target to be built
+ include(UseSWIG)
+ SWIG_ADD_MODULE(${name} python ${ifiles})
+ SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES})
+
+endmacro(GR_SWIG_MAKE)
+
+########################################################################
+# Install swig targets generated by GR_SWIG_MAKE. Usage:
+# GR_SWIG_INSTALL(
+# TARGETS target target target...
+# [DESTINATION destination]
+# [COMPONENT component]
+# )
+########################################################################
+macro(GR_SWIG_INSTALL)
+
+ 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}
+ DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
+ COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
+ )
+
+ include(GrPython)
+ GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py
+ DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
+ COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
+ )
+
+ GR_LIBTOOL(
+ TARGET ${SWIG_MODULE_${name}_REAL_NAME}
+ DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
+ )
+
+ endforeach(name)
+
+endmacro(GR_SWIG_INSTALL)
+
+########################################################################
+# Generate a python file that can determine swig dependencies.
+# Used by the make macro above to determine extra dependencies.
+# 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 "
+
+import os, sys, re
+
+i_include_matcher = re.compile('%(include|import)\\s*[<|\"](.*)[>|\"]')
+h_include_matcher = re.compile('#(include)\\s*[<|\"](.*)[>|\"]')
+include_dirs = sys.argv[2].split(';')
+
+def get_swig_incs(file_path):
+ if file_path.endswith('.i'): matcher = i_include_matcher
+ else: matcher = h_include_matcher
+ file_contents = open(file_path, 'r').read()
+ return matcher.findall(file_contents, re.MULTILINE)
+
+def get_swig_deps(file_path, level):
+ deps = [file_path]
+ if level == 0: return deps
+ for keyword, inc_file in get_swig_incs(file_path):
+ for inc_dir in include_dirs:
+ inc_path = os.path.join(inc_dir, inc_file)
+ if not os.path.exists(inc_path): continue
+ deps.extend(get_swig_deps(inc_path, level-1))
+ break #found, we dont search in lower prio inc dirs
+ return deps
+
+if __name__ == '__main__':
+ ifiles = sys.argv[1].split(';')
+ deps = sum([get_swig_deps(ifile, 3) for ifile in ifiles], [])
+ #sys.stderr.write(';'.join(set(deps)) + '\\n\\n')
+ print(';'.join(set(deps)))
+")
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
new file mode 100644
index 000000000..4723cca58
--- /dev/null
+++ b/cmake/Modules/GrTest.cmake
@@ -0,0 +1,137 @@
+# Copyright 2010-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+########################################################################
+# Add a unit test and setup the environment for a unit test.
+# Takes the same arguments as the ADD_TEST function.
+#
+# Before calling set the following variables:
+# GR_TEST_TARGET_DEPS - built targets for the library path
+# GR_TEST_LIBRARY_DIRS - directories for the library path
+# GR_TEST_PYTHON_DIRS - directories for the python path
+########################################################################
+function(GR_ADD_TEST test_name)
+
+ #Ensure that the build exe also appears in the PATH.
+ 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)
+ #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)
+
+ 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}")
+
+ #http://www.cmake.org/pipermail/cmake/2009-May/029464.html
+ #Replaced this add test + set environs code with the shell script generation.
+ #Its nicer to be able to manually run the shell script to diagnose problems.
+ #ADD_TEST(${ARGV})
+ #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}")
+
+ 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")
+
+ #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}")
+
+ #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")
+ #each line sets an environment variable
+ 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")
+
+ #make the shell file executable
+ execute_process(COMMAND chmod +x ${sh_file})
+
+ add_test(${test_name} ${SHELL} ${sh_file})
+
+ endif(UNIX)
+
+ 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}")
+
+ #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")
+ #each line sets an environment variable
+ 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")
+
+ add_test(${test_name} ${bat_file})
+ endif(WIN32)
+
+endfunction(GR_ADD_TEST)
diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake
new file mode 100644
index 000000000..9199a702b
--- /dev/null
+++ b/cmake/Modules/GrVersion.cmake
@@ -0,0 +1,76 @@
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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.
+#
+# GNU Radio 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; see the file COPYING. If not, write to
+# 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)
+
+#eventually, replace version.sh and fill in the variables below
+set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION})
+set(API_COMPAT ${VERSION_INFO_API_COMPAT})
+set(MINOR_VERSION ${VERSION_INFO_MINOR_VERSION})
+set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION})
+
+########################################################################
+# Extract the version string from git describe.
+########################################################################
+find_package(Git)
+
+if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
+ message(STATUS "Extracting version information from git describe...")
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
+ OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ )
+else()
+ set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown")
+endif()
+
+########################################################################
+# Use the logic below to set the version constants
+########################################################################
+if("${MINOR_VERSION}" STREQUAL "git")
+ # VERSION: 3.3git-xxx-gxxxxxxxx
+ # DOCVER: 3.3git
+ # LIBVER: 3.3git
+ set(VERSION "${GIT_DESCRIBE}")
+ set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}")
+ set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}")
+elseif("${MAINT_VERSION}" STREQUAL "git")
+ # VERSION: 3.3.1git-xxx-gxxxxxxxx
+ # DOCVER: 3.3.1git
+ # LIBVER: 3.3.1git
+ set(VERSION "${GIT_DESCRIBE}")
+ set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}")
+ set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}")
+else()
+ # This is a numbered release.
+ # VERSION: 3.3.1{.x}
+ # DOCVER: 3.3.1{.x}
+ # LIBVER: 3.3.1{.x}
+ if("${MAINT_VERSION}" STREQUAL "0")
+ set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}")
+ else()
+ set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}.${MAINT_VERSION}")
+ endif()
+ set(DOCVER "${VERSION}")
+ set(LIBVER "${VERSION}")
+endif()
diff --git a/cmake/Modules/LibFindMacros.cmake b/cmake/Modules/LibFindMacros.cmake
new file mode 100644
index 000000000..69975c51b
--- /dev/null
+++ b/cmake/Modules/LibFindMacros.cmake
@@ -0,0 +1,99 @@
+# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
+# used for the current package. For this to work, the first parameter must be the
+# prefix of the current package, then the prefix of the new package etc, which are
+# passed to find_package.
+macro (libfind_package PREFIX)
+ set (LIBFIND_PACKAGE_ARGS ${ARGN})
+ if (${PREFIX}_FIND_QUIETLY)
+ set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
+ endif (${PREFIX}_FIND_QUIETLY)
+ if (${PREFIX}_FIND_REQUIRED)
+ set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
+ endif (${PREFIX}_FIND_REQUIRED)
+ find_package(${LIBFIND_PACKAGE_ARGS})
+endmacro (libfind_package)
+
+# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
+# where they added pkg_check_modules. Consequently I need to support both in my scripts
+# to avoid those deprecated warnings. Here's a helper that does just that.
+# Works identically to pkg_check_modules, except that no checks are needed prior to use.
+macro (libfind_pkg_check_modules PREFIX PKGNAME)
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(${PREFIX} ${PKGNAME})
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+endmacro (libfind_pkg_check_modules)
+
+# Do the final processing once the paths have been detected.
+# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
+# all the variables, each of which contain one include directory.
+# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
+# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
+# Also handles errors in case library detection was required, etc.
+macro (libfind_process PREFIX)
+ # Skip processing if already processed during this run
+ if (NOT ${PREFIX}_FOUND)
+ # Start with the assumption that the library was found
+ set (${PREFIX}_FOUND TRUE)
+
+ # Process all includes and set _FOUND to false if any are missing
+ foreach (i ${${PREFIX}_PROCESS_INCLUDES})
+ if (${i})
+ set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
+ mark_as_advanced(${i})
+ else (${i})
+ set (${PREFIX}_FOUND FALSE)
+ endif (${i})
+ endforeach (i)
+
+ # Process all libraries and set _FOUND to false if any are missing
+ foreach (i ${${PREFIX}_PROCESS_LIBS})
+ if (${i})
+ set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
+ mark_as_advanced(${i})
+ else (${i})
+ set (${PREFIX}_FOUND FALSE)
+ endif (${i})
+ endforeach (i)
+
+ # Print message and/or exit on fatal error
+ if (${PREFIX}_FOUND)
+ if (NOT ${PREFIX}_FIND_QUIETLY)
+ message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
+ endif (NOT ${PREFIX}_FIND_QUIETLY)
+ else (${PREFIX}_FOUND)
+ if (${PREFIX}_FIND_REQUIRED)
+ foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
+ message("${i}=${${i}}")
+ endforeach (i)
+ message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
+ endif (${PREFIX}_FIND_REQUIRED)
+ endif (${PREFIX}_FOUND)
+ endif (NOT ${PREFIX}_FOUND)
+endmacro (libfind_process)
+
+macro(libfind_library PREFIX basename)
+ set(TMP "")
+ if(MSVC80)
+ set(TMP -vc80)
+ endif(MSVC80)
+ if(MSVC90)
+ set(TMP -vc90)
+ endif(MSVC90)
+ set(${PREFIX}_LIBNAMES ${basename}${TMP})
+ if(${ARGC} GREATER 2)
+ set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
+ string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
+ set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
+ endif(${ARGC} GREATER 2)
+ find_library(${PREFIX}_LIBRARY
+ NAMES ${${PREFIX}_LIBNAMES}
+ PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
+ )
+endmacro(libfind_library)
+
diff --git a/cmake/Packaging/Fedora-15.cmake b/cmake/Packaging/Fedora-15.cmake
new file mode 100644
index 000000000..2e9e78ee1
--- /dev/null
+++ b/cmake/Packaging/Fedora-15.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "boost-python" "glibc")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4" "PyQwt")
+SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "pulseaudio" "alsa-lib" "jack-audio-connection-kit")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "gsl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "numpy")
diff --git a/cmake/Packaging/Fedora-16.cmake b/cmake/Packaging/Fedora-16.cmake
new file mode 100644
index 000000000..2e9e78ee1
--- /dev/null
+++ b/cmake/Packaging/Fedora-16.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "boost-python" "glibc")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4" "PyQwt")
+SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "pulseaudio" "alsa-lib" "jack-audio-connection-kit")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "gsl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "numpy")
diff --git a/cmake/Packaging/Fedora-17.cmake b/cmake/Packaging/Fedora-17.cmake
new file mode 100644
index 000000000..13573ebac
--- /dev/null
+++ b/cmake/Packaging/Fedora-17.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "boost-python" "glibc")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4" "PyQwt")
+SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy" "PyOpenGL")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "pulseaudio" "alsa-lib" "jack-audio-connection-kit")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "gsl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "numpy")
diff --git a/cmake/Packaging/Fedora-18.cmake b/cmake/Packaging/Fedora-18.cmake
new file mode 100644
index 000000000..13573ebac
--- /dev/null
+++ b/cmake/Packaging/Fedora-18.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "boost-python" "glibc")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4" "PyQwt")
+SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy" "PyOpenGL")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "pulseaudio" "alsa-lib" "jack-audio-connection-kit")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "gsl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "numpy")
diff --git a/cmake/Packaging/Ubuntu-10.04.cmake b/cmake/Packaging/Ubuntu-10.04.cmake
new file mode 100644
index 000000000..3320073c6
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-10.04.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python" "python-numpy")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-10.10.cmake b/cmake/Packaging/Ubuntu-10.10.cmake
new file mode 100644
index 000000000..3320073c6
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-10.10.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python" "python-numpy")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-11.04.cmake b/cmake/Packaging/Ubuntu-11.04.cmake
new file mode 100644
index 000000000..c166bcf42
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-11.04.cmake
@@ -0,0 +1,13 @@
+#set the debian package dependencies (parsed by our deb component maker)
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-11.10.cmake b/cmake/Packaging/Ubuntu-11.10.cmake
new file mode 100644
index 000000000..702ce574f
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-11.10.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-12.04.cmake b/cmake/Packaging/Ubuntu-12.04.cmake
new file mode 100644
index 000000000..40f748fdf
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-12.04.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python-opengl")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-12.10.cmake b/cmake/Packaging/Ubuntu-12.10.cmake
new file mode 100644
index 000000000..40f748fdf
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-12.10.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python-opengl")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/Ubuntu-13.04.cmake b/cmake/Packaging/Ubuntu-13.04.cmake
new file mode 100644
index 000000000..40f748fdf
--- /dev/null
+++ b/cmake/Packaging/Ubuntu-13.04.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4")
+SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python-opengl")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy")
diff --git a/cmake/Packaging/post_install.in b/cmake/Packaging/post_install.in
new file mode 100755
index 000000000..e7245f032
--- /dev/null
+++ b/cmake/Packaging/post_install.in
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+@CMAKE_INSTALL_PREFIX@/libexec/gnuradio/grc_setup_freedesktop install
+ldconfig
diff --git a/cmake/Packaging/post_uninstall.in b/cmake/Packaging/post_uninstall.in
new file mode 100755
index 000000000..2d1871b1d
--- /dev/null
+++ b/cmake/Packaging/post_uninstall.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ldconfig
diff --git a/cmake/Packaging/postinst.in b/cmake/Packaging/postinst.in
new file mode 100755
index 000000000..7fef2accf
--- /dev/null
+++ b/cmake/Packaging/postinst.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ "$1" = "configure" ]; then
+ @CMAKE_INSTALL_PREFIX@/libexec/gnuradio/grc_setup_freedesktop install
+ ldconfig
+fi
diff --git a/cmake/Packaging/postrm.in b/cmake/Packaging/postrm.in
new file mode 100755
index 000000000..b780602a7
--- /dev/null
+++ b/cmake/Packaging/postrm.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ "$1" = "remove" ]; then
+ ldconfig
+fi
diff --git a/cmake/Packaging/pre_install.in b/cmake/Packaging/pre_install.in
new file mode 100755
index 000000000..1a2485251
--- /dev/null
+++ b/cmake/Packaging/pre_install.in
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/cmake/Packaging/pre_uninstall.in b/cmake/Packaging/pre_uninstall.in
new file mode 100755
index 000000000..c5e085e89
--- /dev/null
+++ b/cmake/Packaging/pre_uninstall.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@CMAKE_INSTALL_PREFIX@/libexec/gnuradio/grc_setup_freedesktop uninstall
diff --git a/cmake/Packaging/preinst.in b/cmake/Packaging/preinst.in
new file mode 100755
index 000000000..cb7ee1bc4
--- /dev/null
+++ b/cmake/Packaging/preinst.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ "$1" = "install" ]; then
+ echo
+fi
diff --git a/cmake/Packaging/prerm.in b/cmake/Packaging/prerm.in
new file mode 100755
index 000000000..d09887850
--- /dev/null
+++ b/cmake/Packaging/prerm.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ "$1" = "remove" ]; then
+ @CMAKE_INSTALL_PREFIX@/libexec/gnuradio/grc_setup_freedesktop uninstall
+fi
diff --git a/cmake/Toolchains/arm_cortex_a8_native.cmake b/cmake/Toolchains/arm_cortex_a8_native.cmake
new file mode 100644
index 000000000..8e60eaab1
--- /dev/null
+++ b/cmake/Toolchains/arm_cortex_a8_native.cmake
@@ -0,0 +1,8 @@
+########################################################################
+# Toolchain file for building native on a ARM Cortex A8 w/ NEON
+# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=<this file> <source directory>
+########################################################################
+set(CMAKE_CXX_COMPILER g++)
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_FLAGS "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp" CACHE STRING "" FORCE)
+set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) #same flags for C sources
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
new file mode 100644
index 000000000..9ae1ae4bd
--- /dev/null
+++ b/cmake/cmake_uninstall.cmake.in
@@ -0,0 +1,32 @@
+# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
+
+IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE "\n" ";" files "${files}")
+FOREACH(file ${files})
+ MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ IF(EXISTS "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ IF(NOT "${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ ENDIF(NOT "${rm_retval}" STREQUAL 0)
+ ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ IF(NOT "${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ ENDIF(NOT "${rm_retval}" STREQUAL 0)
+ ELSE(EXISTS "$ENV{DESTDIR}${file}")
+ MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)
diff --git a/cmake/msvc/config.h b/cmake/msvc/config.h
new file mode 100644
index 000000000..43792c783
--- /dev/null
+++ b/cmake/msvc/config.h
@@ -0,0 +1,58 @@
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_CONFIG_H_ // [
+#define _MSC_CONFIG_H_
+
+////////////////////////////////////////////////////////////////////////
+// enable inline functions for C code
+////////////////////////////////////////////////////////////////////////
+#ifndef __cplusplus
+# define inline __inline
+#endif
+
+////////////////////////////////////////////////////////////////////////
+// signed size_t
+////////////////////////////////////////////////////////////////////////
+#include <stddef.h>
+typedef ptrdiff_t ssize_t;
+
+////////////////////////////////////////////////////////////////////////
+// rint functions
+////////////////////////////////////////////////////////////////////////
+#include <math.h>
+static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);}
+static inline long lrintf(float x){return (long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
+static inline long long llrint(double x){return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);}
+static inline long long llrintf(float x){return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
+static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 0.5);}
+static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x - 0.5f);}
+
+////////////////////////////////////////////////////////////////////////
+// math constants
+////////////////////////////////////////////////////////////////////////
+#define INFINITY HUGE_VAL
+
+# define M_E 2.7182818284590452354 /* e */
+# define M_LOG2E 1.4426950408889634074 /* log_2 e */
+# define M_LOG10E 0.43429448190325182765 /* log_10 e */
+# define M_LN2 0.69314718055994530942 /* log_e 2 */
+# define M_LN10 2.30258509299404568402 /* log_e 10 */
+# define M_PI 3.14159265358979323846 /* pi */
+# define M_PI_2 1.57079632679489661923 /* pi/2 */
+# define M_PI_4 0.78539816339744830962 /* pi/4 */
+# define M_1_PI 0.31830988618379067154 /* 1/pi */
+# define M_2_PI 0.63661977236758134308 /* 2/pi */
+# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
+# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
+# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+
+////////////////////////////////////////////////////////////////////////
+// random and srandom
+////////////////////////////////////////////////////////////////////////
+#include <stdlib.h>
+static inline long int random (void) { return rand(); }
+static inline void srandom (unsigned int seed) { srand(seed); }
+
+#endif // _MSC_CONFIG_H_ ]
diff --git a/cmake/msvc/inttypes.h b/cmake/msvc/inttypes.h
new file mode 100644
index 000000000..0a1b60fc1
--- /dev/null
+++ b/cmake/msvc/inttypes.h
@@ -0,0 +1,301 @@
+// ISO C9x compliant inttypes.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006 Alexander Chemeris
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. The name of the author may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_INTTYPES_H_ // [
+#define _MSC_INTTYPES_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include <stdint.h>
+
+// 7.8 Format conversion of integer types
+
+typedef struct {
+ intmax_t quot;
+ intmax_t rem;
+} imaxdiv_t;
+
+// 7.8.1 Macros for format specifiers
+
+// The fprintf macros for signed integers are:
+#define PRId8 "d"
+#define PRIi8 "i"
+#define PRIdLEAST8 "d"
+#define PRIiLEAST8 "i"
+#define PRIdFAST8 "d"
+#define PRIiFAST8 "i"
+
+#define PRId16 "hd"
+#define PRIi16 "hi"
+#define PRIdLEAST16 "hd"
+#define PRIiLEAST16 "hi"
+#define PRIdFAST16 "hd"
+#define PRIiFAST16 "hi"
+
+#define PRId32 "I32d"
+#define PRIi32 "I32i"
+#define PRIdLEAST32 "I32d"
+#define PRIiLEAST32 "I32i"
+#define PRIdFAST32 "I32d"
+#define PRIiFAST32 "I32i"
+
+#define PRId64 "I64d"
+#define PRIi64 "I64i"
+#define PRIdLEAST64 "I64d"
+#define PRIiLEAST64 "I64i"
+#define PRIdFAST64 "I64d"
+#define PRIiFAST64 "I64i"
+
+#define PRIdMAX "I64d"
+#define PRIiMAX "I64i"
+
+#define PRIdPTR "Id"
+#define PRIiPTR "Ii"
+
+// The fprintf macros for unsigned integers are:
+#define PRIo8 "o"
+#define PRIu8 "u"
+#define PRIx8 "x"
+#define PRIX8 "X"
+#define PRIoLEAST8 "o"
+#define PRIuLEAST8 "u"
+#define PRIxLEAST8 "x"
+#define PRIXLEAST8 "X"
+#define PRIoFAST8 "o"
+#define PRIuFAST8 "u"
+#define PRIxFAST8 "x"
+#define PRIXFAST8 "X"
+
+#define PRIo16 "ho"
+#define PRIu16 "hu"
+#define PRIx16 "hx"
+#define PRIX16 "hX"
+#define PRIoLEAST16 "ho"
+#define PRIuLEAST16 "hu"
+#define PRIxLEAST16 "hx"
+#define PRIXLEAST16 "hX"
+#define PRIoFAST16 "ho"
+#define PRIuFAST16 "hu"
+#define PRIxFAST16 "hx"
+#define PRIXFAST16 "hX"
+
+#define PRIo32 "I32o"
+#define PRIu32 "I32u"
+#define PRIx32 "I32x"
+#define PRIX32 "I32X"
+#define PRIoLEAST32 "I32o"
+#define PRIuLEAST32 "I32u"
+#define PRIxLEAST32 "I32x"
+#define PRIXLEAST32 "I32X"
+#define PRIoFAST32 "I32o"
+#define PRIuFAST32 "I32u"
+#define PRIxFAST32 "I32x"
+#define PRIXFAST32 "I32X"
+
+#define PRIo64 "I64o"
+#define PRIu64 "I64u"
+#define PRIx64 "I64x"
+#define PRIX64 "I64X"
+#define PRIoLEAST64 "I64o"
+#define PRIuLEAST64 "I64u"
+#define PRIxLEAST64 "I64x"
+#define PRIXLEAST64 "I64X"
+#define PRIoFAST64 "I64o"
+#define PRIuFAST64 "I64u"
+#define PRIxFAST64 "I64x"
+#define PRIXFAST64 "I64X"
+
+#define PRIoMAX "I64o"
+#define PRIuMAX "I64u"
+#define PRIxMAX "I64x"
+#define PRIXMAX "I64X"
+
+#define PRIoPTR "Io"
+#define PRIuPTR "Iu"
+#define PRIxPTR "Ix"
+#define PRIXPTR "IX"
+
+// The fscanf macros for signed integers are:
+#define SCNd8 "d"
+#define SCNi8 "i"
+#define SCNdLEAST8 "d"
+#define SCNiLEAST8 "i"
+#define SCNdFAST8 "d"
+#define SCNiFAST8 "i"
+
+#define SCNd16 "hd"
+#define SCNi16 "hi"
+#define SCNdLEAST16 "hd"
+#define SCNiLEAST16 "hi"
+#define SCNdFAST16 "hd"
+#define SCNiFAST16 "hi"
+
+#define SCNd32 "ld"
+#define SCNi32 "li"
+#define SCNdLEAST32 "ld"
+#define SCNiLEAST32 "li"
+#define SCNdFAST32 "ld"
+#define SCNiFAST32 "li"
+
+#define SCNd64 "I64d"
+#define SCNi64 "I64i"
+#define SCNdLEAST64 "I64d"
+#define SCNiLEAST64 "I64i"
+#define SCNdFAST64 "I64d"
+#define SCNiFAST64 "I64i"
+
+#define SCNdMAX "I64d"
+#define SCNiMAX "I64i"
+
+#ifdef _WIN64 // [
+# define SCNdPTR "I64d"
+# define SCNiPTR "I64i"
+#else // _WIN64 ][
+# define SCNdPTR "ld"
+# define SCNiPTR "li"
+#endif // _WIN64 ]
+
+// The fscanf macros for unsigned integers are:
+#define SCNo8 "o"
+#define SCNu8 "u"
+#define SCNx8 "x"
+#define SCNX8 "X"
+#define SCNoLEAST8 "o"
+#define SCNuLEAST8 "u"
+#define SCNxLEAST8 "x"
+#define SCNXLEAST8 "X"
+#define SCNoFAST8 "o"
+#define SCNuFAST8 "u"
+#define SCNxFAST8 "x"
+#define SCNXFAST8 "X"
+
+#define SCNo16 "ho"
+#define SCNu16 "hu"
+#define SCNx16 "hx"
+#define SCNX16 "hX"
+#define SCNoLEAST16 "ho"
+#define SCNuLEAST16 "hu"
+#define SCNxLEAST16 "hx"
+#define SCNXLEAST16 "hX"
+#define SCNoFAST16 "ho"
+#define SCNuFAST16 "hu"
+#define SCNxFAST16 "hx"
+#define SCNXFAST16 "hX"
+
+#define SCNo32 "lo"
+#define SCNu32 "lu"
+#define SCNx32 "lx"
+#define SCNX32 "lX"
+#define SCNoLEAST32 "lo"
+#define SCNuLEAST32 "lu"
+#define SCNxLEAST32 "lx"
+#define SCNXLEAST32 "lX"
+#define SCNoFAST32 "lo"
+#define SCNuFAST32 "lu"
+#define SCNxFAST32 "lx"
+#define SCNXFAST32 "lX"
+
+#define SCNo64 "I64o"
+#define SCNu64 "I64u"
+#define SCNx64 "I64x"
+#define SCNX64 "I64X"
+#define SCNoLEAST64 "I64o"
+#define SCNuLEAST64 "I64u"
+#define SCNxLEAST64 "I64x"
+#define SCNXLEAST64 "I64X"
+#define SCNoFAST64 "I64o"
+#define SCNuFAST64 "I64u"
+#define SCNxFAST64 "I64x"
+#define SCNXFAST64 "I64X"
+
+#define SCNoMAX "I64o"
+#define SCNuMAX "I64u"
+#define SCNxMAX "I64x"
+#define SCNXMAX "I64X"
+
+#ifdef _WIN64 // [
+# define SCNoPTR "I64o"
+# define SCNuPTR "I64u"
+# define SCNxPTR "I64x"
+# define SCNXPTR "I64X"
+#else // _WIN64 ][
+# define SCNoPTR "lo"
+# define SCNuPTR "lu"
+# define SCNxPTR "lx"
+# define SCNXPTR "lX"
+#endif // _WIN64 ]
+
+// 7.8.2 Functions for greatest-width integer types
+
+// 7.8.2.1 The imaxabs function
+#define imaxabs _abs64
+
+// 7.8.2.2 The imaxdiv function
+
+// This is modified version of div() function from Microsoft's div.c found
+// in %MSVC.NET%\crt\src\div.c
+#ifdef STATIC_IMAXDIV // [
+static
+#else // STATIC_IMAXDIV ][
+_inline
+#endif // STATIC_IMAXDIV ]
+imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
+{
+ imaxdiv_t result;
+
+ result.quot = numer / denom;
+ result.rem = numer % denom;
+
+ if (numer < 0 && result.rem > 0) {
+ // did division wrong; must fix up
+ ++result.quot;
+ result.rem -= denom;
+ }
+
+ return result;
+}
+
+// 7.8.2.3 The strtoimax and strtoumax functions
+#define strtoimax _strtoi64
+#define strtoumax _strtoui64
+
+// 7.8.2.4 The wcstoimax and wcstoumax functions
+#define wcstoimax _wcstoi64
+#define wcstoumax _wcstoui64
+
+
+#endif // _MSC_INTTYPES_H_ ]
diff --git a/cmake/msvc/stdint.h b/cmake/msvc/stdint.h
new file mode 100644
index 000000000..108bc8982
--- /dev/null
+++ b/cmake/msvc/stdint.h
@@ -0,0 +1,251 @@
+// ISO C9x compliant stdint.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006-2008 Alexander Chemeris
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. The name of the author may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_STDINT_H_ // [
+#define _MSC_STDINT_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include <limits.h>
+
+// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
+// or compiler give many errors like this:
+// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+#ifdef __cplusplus
+extern "C" {
+#endif
+# include <wchar.h>
+#ifdef __cplusplus
+}
+#endif
+
+// Define _W64 macros to mark types changing their size, like intptr_t.
+#ifndef _W64
+# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+# define _W64 __w64
+# else
+# define _W64
+# endif
+#endif
+
+
+// 7.18.1 Integer types
+
+// 7.18.1.1 Exact-width integer types
+
+// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+// realize that, e.g. char has the same size as __int8
+// so we give up on __intX for them.
+#if (_MSC_VER < 1300)
+ typedef signed char int8_t;
+ typedef signed short int16_t;
+ typedef signed int int32_t;
+ typedef unsigned char uint8_t;
+ typedef unsigned short uint16_t;
+ typedef unsigned int uint32_t;
+#else
+ typedef signed __int8 int8_t;
+ typedef signed __int16 int16_t;
+ typedef signed __int32 int32_t;
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int16 uint16_t;
+ typedef unsigned __int32 uint32_t;
+#endif
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+
+
+// 7.18.1.2 Minimum-width integer types
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+// 7.18.1.3 Fastest minimum-width integer types
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+// 7.18.1.4 Integer types capable of holding object pointers
+#ifdef _WIN64 // [
+ typedef signed __int64 intptr_t;
+ typedef unsigned __int64 uintptr_t;
+#else // _WIN64 ][
+ typedef _W64 signed int intptr_t;
+ typedef _W64 unsigned int uintptr_t;
+#endif // _WIN64 ]
+
+// 7.18.1.5 Greatest-width integer types
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+
+
+// 7.18.2 Limits of specified-width integer types
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
+
+// 7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN ((int8_t)_I8_MIN)
+#define INT8_MAX _I8_MAX
+#define INT16_MIN ((int16_t)_I16_MIN)
+#define INT16_MAX _I16_MAX
+#define INT32_MIN ((int32_t)_I32_MIN)
+#define INT32_MAX _I32_MAX
+#define INT64_MIN ((int64_t)_I64_MIN)
+#define INT64_MAX _I64_MAX
+#define UINT8_MAX _UI8_MAX
+#define UINT16_MAX _UI16_MAX
+#define UINT32_MAX _UI32_MAX
+#define UINT64_MAX _UI64_MAX
+
+// 7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MIN INT64_MIN
+#define INT_LEAST64_MAX INT64_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+// 7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MIN INT64_MIN
+#define INT_FAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+// 7.18.2.4 Limits of integer types capable of holding object pointers
+#ifdef _WIN64 // [
+# define INTPTR_MIN INT64_MIN
+# define INTPTR_MAX INT64_MAX
+# define UINTPTR_MAX UINT64_MAX
+#else // _WIN64 ][
+# define INTPTR_MIN INT32_MIN
+# define INTPTR_MAX INT32_MAX
+# define UINTPTR_MAX UINT32_MAX
+#endif // _WIN64 ]
+
+// 7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+// 7.18.3 Limits of other integer types
+
+#ifdef _WIN64 // [
+# define PTRDIFF_MIN _I64_MIN
+# define PTRDIFF_MAX _I64_MAX
+#else // _WIN64 ][
+# define PTRDIFF_MIN _I32_MIN
+# define PTRDIFF_MAX _I32_MAX
+#endif // _WIN64 ]
+
+#define SIG_ATOMIC_MIN INT_MIN
+#define SIG_ATOMIC_MAX INT_MAX
+
+#ifndef SIZE_MAX // [
+# ifdef _WIN64 // [
+# define SIZE_MAX _UI64_MAX
+# else // _WIN64 ][
+# define SIZE_MAX _UI32_MAX
+# endif // _WIN64 ]
+#endif // SIZE_MAX ]
+
+// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+#ifndef WCHAR_MIN // [
+# define WCHAR_MIN 0
+#endif // WCHAR_MIN ]
+#ifndef WCHAR_MAX // [
+# define WCHAR_MAX _UI16_MAX
+#endif // WCHAR_MAX ]
+
+#define WINT_MIN 0
+#define WINT_MAX _UI16_MAX
+
+#endif // __STDC_LIMIT_MACROS ]
+
+
+// 7.18.4 Limits of other integer types
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val) val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val) val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+#ifndef INTMAX_C
+#define INTMAX_C INT64_C
+#endif
+#ifndef UINTMAX_C
+#define UINTMAX_C UINT64_C
+#endif
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+
+#endif // _MSC_STDINT_H_ ]
diff --git a/cmake/msvc/sys/time.h b/cmake/msvc/sys/time.h
new file mode 100644
index 000000000..8800ed5cb
--- /dev/null
+++ b/cmake/msvc/sys/time.h
@@ -0,0 +1,69 @@
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_SYS_TIME_H_
+#define _MSC_SYS_TIME_H_
+
+//http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668
+#include < time.h >
+#include <windows.h> //I've ommited this line.
+#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
+ #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
+#else
+ #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
+#endif
+
+struct timespec {
+
+time_t tv_sec; /* Seconds since 00:00:00 GMT, */
+
+/* 1 January 1970 */
+
+long tv_nsec; /* Additional nanoseconds since */
+
+/* tv_sec */
+
+};
+
+struct timezone
+{
+ int tz_minuteswest; /* minutes W of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+
+static inline int gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ FILETIME ft;
+ unsigned __int64 tmpres = 0;
+ static int tzflag;
+
+ if (NULL != tv)
+ {
+ GetSystemTimeAsFileTime(&ft);
+
+ tmpres |= ft.dwHighDateTime;
+ tmpres <<= 32;
+ tmpres |= ft.dwLowDateTime;
+
+ /*converting file time to unix epoch*/
+ tmpres -= DELTA_EPOCH_IN_MICROSECS;
+ tv->tv_sec = (long)(tmpres / 1000000UL);
+ tv->tv_usec = (long)(tmpres % 1000000UL);
+ }
+
+ if (NULL != tz)
+ {
+ if (!tzflag)
+ {
+ _tzset();
+ tzflag++;
+ }
+ tz->tz_minuteswest = _timezone / 60;
+ tz->tz_dsttime = _daylight;
+ }
+
+ return 0;
+}
+
+#endif //_MSC_SYS_TIME_H_
diff --git a/cmake/msvc/unistd.h b/cmake/msvc/unistd.h
new file mode 100644
index 000000000..de412e42a
--- /dev/null
+++ b/cmake/msvc/unistd.h
@@ -0,0 +1,10 @@
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_UNISTD_H_ // [
+#define _MSC_UNISTD_H_
+
+#include <process.h>
+
+#endif // _MSC_UNISTD_H_ ]