summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindCppUnit.cmake38
-rw-r--r--cmake/Modules/FindFFTW3f.cmake15
-rw-r--r--cmake/Modules/FindGSL.cmake19
-rw-r--r--cmake/Modules/FindUHD.cmake12
-rw-r--r--cmake/Modules/GrComponent.cmake9
-rw-r--r--cmake/Modules/GrPython.cmake12
-rw-r--r--cmake/Modules/GrTest.cmake12
7 files changed, 73 insertions, 44 deletions
diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake
index f986f35c6..a936bc546 100644
--- a/cmake/Modules/FindCppUnit.cmake
+++ b/cmake/Modules/FindCppUnit.cmake
@@ -1,34 +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_DIRS, where to find tiff.h, etc.
+# 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(CPPUNIT "cppunit")
-LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS})
-IF(NOT CPPUNIT_FOUND)
+PKG_CHECK_MODULES(PC_CPPUNIT "cppunit" QUIET)
-FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h
- /usr/local/include
- /usr/include
+FIND_PATH(CPPUNIT_INCLUDE_DIRS
+ NAMES cppunit/TestCase.h
+ HINTS ${PC_CPPUNIT_INCLUDE_DIRS}
+ PATHS
+ /usr/local/include
+ /usr/include
)
-FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit
- ${CPPUNIT_INCLUDE_DIRS}/../lib
- /usr/local/lib
- /usr/lib)
+FIND_LIBRARY(CPPUNIT_LIBRARIES
+ NAMES cppunit
+ HINTS ${PC_CPPUNIT_LIBRARIES}
+ PATHS
+ ${CPPUNIT_INCLUDE_DIRS}/../lib
+ /usr/local/lib
+ /usr/lib
+)
-IF(CPPUNIT_INCLUDE_DIRS)
- IF(CPPUNIT_LIBRARIES)
- SET(CPPUNIT_FOUND "YES")
- SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES} ${CMAKE_DL_LIBS})
- ENDIF(CPPUNIT_LIBRARIES)
-ENDIF(CPPUNIT_INCLUDE_DIRS)
+LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
-ENDIF(NOT CPPUNIT_FOUND)
+MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindFFTW3f.cmake b/cmake/Modules/FindFFTW3f.cmake
index d84bb37a8..e8b581aed 100644
--- a/cmake/Modules/FindFFTW3f.cmake
+++ b/cmake/Modules/FindFFTW3f.cmake
@@ -1,14 +1,16 @@
# 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(FFTW3F "fftw3f >= 3.0")
-IF(NOT FFTW3F_FOUND)
+PKG_CHECK_MODULES(PC_FFTW3F "fftw3f >= 3.0" QUIET)
FIND_PATH(
FFTW3F_INCLUDE_DIRS
NAMES fftw3.h
HINTS $ENV{FFTW3_DIR}/include
+ ${PC_FFTW3F_INCLUDE_DIRS}
PATHS /usr/local/include
/usr/include
)
@@ -17,16 +19,11 @@ FIND_LIBRARY(
FFTW3F_LIBRARIES
NAMES fftw3f libfftw3f
HINTS $ENV{FFTW3_DIR}/lib
+ ${PC_FFTW3F_LIBRARIES}
PATHS /usr/local/lib
/usr/lib
)
-SET(FFTW3F_FOUND "NO")
-
-IF( FFTW3F_INCLUDE_DIRS AND FFTW3F_LIBRARIES )
- SET(FFTW3F_FOUND "YES")
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS)
-ENDIF(NOT FFTW3F_FOUND)
+MARK_AS_ADVANCED(FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindGSL.cmake b/cmake/Modules/FindGSL.cmake
index 48fd0077f..6d7155284 100644
--- a/cmake/Modules/FindGSL.cmake
+++ b/cmake/Modules/FindGSL.cmake
@@ -26,10 +26,10 @@ 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_DIR
+ find_path( GSL_INCLUDE_DIRS
NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
)
- if( GSL_INCLUDE_DIR )
+ if( GSL_INCLUDE_DIRS )
# look for gsl library
find_library( GSL_LIBRARY
NAMES gsl
@@ -49,13 +49,13 @@ if( WIN32 AND NOT CYGWIN AND NOT MSYS )
endif( GSL_CBLAS_LIBRARY )
set( GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY} )
- endif( GSL_INCLUDE_DIR )
+ endif( GSL_INCLUDE_DIRS )
- #mark_as_advanced(
- # GSL_INCLUDE_DIR
- # GSL_LIBRARY
- # GSL_CBLAS_LIBRARY
- #)
+ 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
@@ -138,6 +138,9 @@ else( GSL_FOUND )
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/FindUHD.cmake b/cmake/Modules/FindUHD.cmake
index 7e9f70aa9..0f0cc601b 100644
--- a/cmake/Modules/FindUHD.cmake
+++ b/cmake/Modules/FindUHD.cmake
@@ -1,11 +1,15 @@
+########################################################################
+# Find the library for the USRP Hardware Driver
+########################################################################
+
INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(UHD uhd)
-IF(NOT UHD_FOUND)
+PKG_CHECK_MODULES(PC_UHD uhd QUIET)
FIND_PATH(
UHD_INCLUDE_DIRS
NAMES uhd/config.hpp
HINTS $ENV{UHD_DIR}/include
+ ${PC_UHD_INCLUDE_DIRS}
PATHS /usr/local/include
/usr/include
)
@@ -14,11 +18,11 @@ FIND_LIBRARY(
UHD_LIBRARIES
NAMES uhd
HINTS $ENV{UHD_DIR}/lib
+ ${PC_UHD_LIBRARIES}
PATHS /usr/local/lib
/usr/lib
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
-
-ENDIF(NOT UHD_FOUND)
+MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)
diff --git a/cmake/Modules/GrComponent.cmake b/cmake/Modules/GrComponent.cmake
index 8a94e219a..cbae1c4ff 100644
--- a/cmake/Modules/GrComponent.cmake
+++ b/cmake/Modules/GrComponent.cmake
@@ -25,6 +25,13 @@ 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
@@ -40,7 +47,7 @@ FUNCTION(GR_REGISTER_COMPONENT name var)
ENDFOREACH(dep)
#setup the dependent option for this component
- CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ON "${ARGN}" OFF)
+ CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${ENABLE_DEFAULT} "${ARGN}" OFF)
SET(${var}_ "${${var}}" CACHE INTERNAL "" FORCE)
#append the component into one of the lists
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index f54dbc9ba..b33c2fe62 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -51,6 +51,18 @@ 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
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
index e9e2a0c2e..8a73de3ce 100644
--- a/cmake/Modules/GrTest.cmake
+++ b/cmake/Modules/GrTest.cmake
@@ -33,7 +33,6 @@ SET(__INCLUDED_GR_TEST_CMAKE TRUE)
########################################################################
FUNCTION(GR_ADD_TEST test_name)
- IF(WIN32)
#Ensure that the build exe also appears in the PATH.
LIST(APPEND GR_TEST_TARGET_DEPS ${ARGN})
@@ -50,6 +49,7 @@ FUNCTION(GR_ADD_TEST test_name)
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:
@@ -74,15 +74,19 @@ FUNCTION(GR_ADD_TEST test_name)
#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")
- #set both LD and DYLD paths to cover multiple UNIX OS library paths
- LIST(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_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_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${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)