2016-01-04 22:50:21 -05:00
|
|
|
# - Try to find Hamlib
|
|
|
|
# Author: George L. Emigh - AB4BD
|
|
|
|
#
|
|
|
|
# Change Log: Charles J. Cliffe <cj@cubicproductions.com>
|
|
|
|
# Updates:
|
|
|
|
# Jan 2015 - Add /opt/ paths for OSX MacPorts
|
2016-01-05 00:46:03 -05:00
|
|
|
# - Fix HAMLIB_INCLUDE_DIR absolute search
|
2016-01-04 22:50:21 -05:00
|
|
|
# TODO:
|
|
|
|
# Windows support
|
|
|
|
# Static support
|
2016-01-03 15:39:29 -05:00
|
|
|
#
|
2016-01-04 22:50:21 -05:00
|
|
|
# HAMLIB_FOUND - system has Hamlib
|
|
|
|
# HAMLIB_LIBRARY - location of the library for hamlib
|
|
|
|
# HAMLIB_INCLUDE_DIR - location of the include files for hamlib
|
|
|
|
|
|
|
|
set(HAMLIB_FOUND FALSE)
|
|
|
|
|
|
|
|
find_path(HAMLIB_INCLUDE_DIR
|
2016-01-05 00:46:03 -05:00
|
|
|
NAMES hamlib/rig.h
|
2016-01-04 22:50:21 -05:00
|
|
|
PATHS
|
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
/opt/local/include
|
2016-01-03 15:39:29 -05:00
|
|
|
)
|
|
|
|
|
2016-01-04 22:50:21 -05:00
|
|
|
find_library(HAMLIB_LIBRARY
|
|
|
|
NAMES hamlib
|
|
|
|
PATHS
|
|
|
|
/usr/lib64/hamlib
|
|
|
|
/usr/lib/hamlib
|
|
|
|
/usr/lib64
|
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib64/hamlib
|
|
|
|
/usr/local/lib/hamlib
|
|
|
|
/usr/local/lib64
|
|
|
|
/usr/local/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/local/lib/hamlib
|
|
|
|
)
|
2016-01-03 15:39:29 -05:00
|
|
|
|
2016-01-04 22:50:21 -05:00
|
|
|
if(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
|
|
|
|
set(HAMLIB_FOUND TRUE)
|
2016-01-05 00:46:03 -05:00
|
|
|
# message(STATUS "Hamlib version: ${VERSION}")
|
2016-01-04 22:50:21 -05:00
|
|
|
message(STATUS "Found hamlib library directory at: ${HAMLIB_LIBRARY}")
|
|
|
|
message(STATUS "Found hamlib include directory at: ${HAMLIB_INCLUDE_DIR}")
|
|
|
|
endif(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
|
|
|
|
|
|
|
|
IF(NOT HAMLIB_FOUND)
|
|
|
|
IF(NOT HAMLIB_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "HAMLIB was not found.")
|
|
|
|
ELSE(NOT HAMLIB_FIND_QUIETLY)
|
|
|
|
IF(HAMLIB_FIND_REQUIRED)
|
|
|
|
MESSAGE(FATAL_ERROR "HAMLIB was not found.")
|
|
|
|
ENDIF(HAMLIB_FIND_REQUIRED)
|
|
|
|
ENDIF(NOT HAMLIB_FIND_QUIETLY)
|
|
|
|
ENDIF(NOT HAMLIB_FOUND)
|