--- CMakeLists.txt.orig	2016-09-02 04:16:14 UTC
+++ CMakeLists.txt
@@ -29,6 +29,12 @@ cmake_minimum_required(VERSION 2.6)
 project(gnuradio CXX C)
 enable_testing()
 
+cmake_policy(SET CMP0026 OLD)
+cmake_policy(SET CMP0043 OLD)
+cmake_policy(SET CMP0045 OLD)
+cmake_policy(SET CMP0046 OLD)
+cmake_policy(SET CMP0056 OLD)
+
 #make sure our local CMake Modules path comes first
 list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
 
@@ -70,6 +76,10 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "M
 ELSE()
     message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
 ENDIF()
+#
+# This is a workaround for a missing -lgsl -L in the swig build somewhere
+# it needs to be properly fixed. - db
+link_directories("/usr/lib" "${LOCALBASE}/lib")
 
 IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
@@ -191,6 +201,14 @@ string(REPLACE "\n" " \\n" COMPILER_INFO
 ########################################################################
 include(GrPlatform) #define LIB_SUFFIX
 set(GR_RUNTIME_DIR     bin CACHE PATH "Path to install all binaries")
+########################################################################
+# FreeBSD libdata vs. lib
+#
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+set(GR_PKGCONFIG_DIR      libdata${LIB_SUFFIX})
+else()
+set(GR_PKGCONFIG_DIR      lib${LIB_SUFFIX})
+endif()
 set(GR_LIBRARY_DIR     lib${LIB_SUFFIX} CACHE PATH "Path to install libraries")
 set(GR_INCLUDE_DIR     include CACHE PATH "Path to install header files")
 set(GR_DATA_DIR        share CACHE PATH "Base location for data")
@@ -276,6 +294,42 @@ add_custom_target(uninstall
 include(GrBoost)
 
 ########################################################################
+# FreeBSD iconv
+########################################################################
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+  message( "-- Adding iconv for FreeBSD")
+message ("-- ICONV_LIB = ${ICONV_LIB}")
+
+  set (ICONV_INCLUDE_DIR ${ICONV_PREFIX}/include)
+  if (${ICONV_LIB} STREQUAL "X-liconv")
+      find_library(ICONV_LIBRARY
+      NAMES iconv
+      PATHS ${ICONV_PREFIX}/lib
+    )
+  else()
+    find_library(ICONV_LIBRARY
+      NAMES c
+      PATHS ${ICONV_PREFIX}/lib
+    )
+  endif()
+
+message ("-- LIBICONV_PLUG = ${LIBICONV_PLUG}")
+message ("-- ICONV_PREFIX = ${ICONV_PREFIX}")
+message ("-- ICONV_INCLUDE_DIRS = ${ICONV_INCLUDE_DIRS}")
+message ("-- ICONV_INCLUDE_DIR = ${ICONV_INCLUDE_DIR}")
+message ("-- ICONV_LIB_DIRS = ${ICONV_LIB_DIRS}")
+message ("-- ICONV_LIBRARY = ${ICONV_LIBRARY}")
+else()
+  find_path(ICONV_INCLUDE_DIR
+    NAMES iconv.h
+    PATHS ${ICONV_INCLUDE_DIRS}
+  )
+  find_library(ICONV_LIBRARY
+    NAMES iconv
+    PATHS ${ICONV_LIB_DIRS}
+  )
+endif()
+########################################################################
 # Enable python component
 ########################################################################
 find_package(PythonLibs 2)
@@ -407,11 +461,13 @@ GR_LOGGING()
 ########################################################################
 # Distribute the README file
 ########################################################################
+if(ENABLE_DOCS)
 install(
     FILES README README.hacking
     DESTINATION ${GR_PKG_DOC_DIR}
     COMPONENT "docs"
 )
+endif()
 
 ########################################################################
 # The following dependency libraries are needed by all gr modules:
