diff options
author | Josh Blum | 2011-09-17 09:26:19 -0400 |
---|---|---|
committer | Josh Blum | 2011-09-17 10:53:06 -0400 |
commit | 8524736fe3c5812b5e8e0a85af45c4775a2d4ca2 (patch) | |
tree | 0b4940bdd21b0de11de8e130765a4d197b589cfd /cmake | |
parent | 45b4f703ae4e3871f233b76d3114630e2e4c527d (diff) | |
download | gnuradio-8524736fe3c5812b5e8e0a85af45c4775a2d4ca2.tar.gz gnuradio-8524736fe3c5812b5e8e0a85af45c4775a2d4ca2.tar.bz2 gnuradio-8524736fe3c5812b5e8e0a85af45c4775a2d4ca2.zip |
cmake: modified find files to better follow coding guide
http://www.cmake.org/cgi-bin/viewcvs.cgi/Modules/readme.txt?root=CMake&view=markup
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindCppUnit.cmake | 38 | ||||
-rw-r--r-- | cmake/Modules/FindFFTW3f.cmake | 15 | ||||
-rw-r--r-- | cmake/Modules/FindGSL.cmake | 19 | ||||
-rw-r--r-- | cmake/Modules/FindUHD.cmake | 12 |
4 files changed, 45 insertions, 39 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) |