Index: CMakeLists.txt
--- CMakeLists.txt.orig	2014-08-10 06:23:56.000000000 +0200
+++ CMakeLists.txt	2016-01-14 20:59:12.519555500 +0100
@@ -160,30 +160,30 @@
 
 SET_TARGET_PROPERTIES ( Half
   PROPERTIES
-  VERSION 12.0.0
+  VERSION 12
   SOVERSION 12
   )
 SET_TARGET_PROPERTIES ( Iex
   PROPERTIES
-  VERSION 12.0.0
+  VERSION 12
   SOVERSION 12
   OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}"
   )
 SET_TARGET_PROPERTIES ( Imath
   PROPERTIES
-  VERSION 12.0.0
+  VERSION 12
   SOVERSION 12
   OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}"
   )
 SET_TARGET_PROPERTIES ( IlmThread
   PROPERTIES
-  VERSION 12.0.0
+  VERSION 12
   SOVERSION 12
   OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}"
   )
 SET_TARGET_PROPERTIES ( IexMath
   PROPERTIES
-  VERSION 12.0.0
+  VERSION 12
   SOVERSION 12
   OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}"
   )
@@ -227,5 +227,5 @@
 INSTALL ( FILES
   ${CMAKE_BINARY_DIR}/IlmBase.pc
   DESTINATION
-  lib/pkgconfig
+  libdata/pkgconfig
 )
Index: IexMath/IexMathFpu.cpp
--- IexMath/IexMathFpu.cpp.orig	2014-08-10 06:23:56.000000000 +0200
+++ IexMath/IexMathFpu.cpp	2016-01-14 21:23:18.060029150 +0100
@@ -273,15 +273,21 @@
 // <asm/sigcontext.h>
 //
 
+#ifdef __FreeBSD__
+#include <signal.h>
+#else
 #include <asm/sigcontext.h>
+#endif
 
 inline void
 restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
 {
+#ifndef __FreeBSD__
     setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
     
     _fpstate * kfp = reinterpret_cast<_fpstate *> (ucon.uc_mcontext.fpregs);
     setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
+#endif
 }
 
 #endif
@@ -461,9 +467,14 @@
     {
 	struct sigaction action;
 	sigemptyset (&action.sa_mask);
+#ifndef SA_NOMASK
+#define SA_NOMASK 0
+#endif
 	action.sa_flags = SA_SIGINFO | SA_NOMASK;
 	action.sa_sigaction = (void (*) (int, siginfo_t *, void *)) catchSigFpe;
+#ifndef __FreeBSD__
 	action.sa_restorer = 0;
+#endif
 
 	sigaction (SIGFPE, &action, 0);
     }
Index: IlmThread/CMakeLists.txt
--- IlmThread/CMakeLists.txt.orig	2014-08-10 04:03:38.000000000 +0200
+++ IlmThread/CMakeLists.txt	2016-01-14 20:59:12.519555500 +0100
@@ -18,6 +18,7 @@
 	)
 ENDIF()
 
+FIND_PACKAGE(Threads)
 
 IF(BUILD_SHARED_LIBS)
   ADD_DEFINITIONS(-DILMTHREAD_EXPORTS)
@@ -26,7 +27,7 @@
 ADD_LIBRARY ( IlmThread ${LIB_TYPE}
   ${ILMTHREAD_LIBRARY_SOURCES}
   )
-TARGET_LINK_LIBRARIES(IlmThread Iex)
+TARGET_LINK_LIBRARIES(IlmThread Iex ${CMAKE_THREAD_LIBS_INIT})
 
 INSTALL ( TARGETS
   IlmThread
Index: Imath/ImathFun.cpp
--- Imath/ImathFun.cpp.orig	2014-08-10 04:03:39.000000000 +0200
+++ Imath/ImathFun.cpp	2016-01-14 20:59:12.519555500 +0100
@@ -33,6 +33,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 
+#include <inttypes.h>
 #include "ImathFun.h"
 
 IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER
@@ -41,14 +42,14 @@
 float
 succf (float f)
 {
-    union {float f; int i;} u;
+    union {float f; int32_t i;} u;
     u.f = f;
 
     if ((u.i & 0x7f800000) == 0x7f800000)
     {
         // Nan or infinity; don't change value.
     }
-    else if (u.i == 0x00000000 || u.i == 0x80000000)
+    else if (u.i == (int32_t)0x00000000 || u.i == (int32_t)0x80000000)
     {
         // Plus or minus zero.
 
@@ -76,14 +77,14 @@
 float
 predf (float f)
 {
-    union {float f; int i;} u;
+    union {float f; int32_t i;} u;
     u.f = f;
 
     if ((u.i & 0x7f800000) == 0x7f800000)
     {
         // Nan or infinity; don't change value.
     }
-    else if (u.i == 0x00000000 || u.i == 0x80000000)
+    else if (u.i == (int32_t)0x00000000 || u.i == (int32_t)0x80000000)
     {
         // Plus or minus zero.
 
Index: ImathTest/testBoxAlgo.cpp
--- ImathTest/testBoxAlgo.cpp.orig	2014-08-10 04:03:40.000000000 +0200
+++ ImathTest/testBoxAlgo.cpp	2016-01-14 20:59:12.519555500 +0100
@@ -356,7 +356,7 @@
 	Box3f ()
     };
 
-    for (int i = 0; i < sizeof (boxes) / sizeof (boxes[0]); ++i)
+    for (unsigned int i = 0; i < sizeof (boxes) / sizeof (boxes[0]); ++i)
 	testEntryAndExitPoints (boxes[i]);
 }
 
Index: ImathTest/testShear.cpp
--- ImathTest/testShear.cpp.orig	2014-08-10 04:03:41.000000000 +0200
+++ ImathTest/testShear.cpp	2016-01-14 20:59:12.519555500 +0100
@@ -54,7 +54,6 @@
 
     const float         epsilon = IMATH_INTERNAL_NAMESPACE::limits< float >::epsilon();
 
-    float    	        array[6] = { 1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F };
     IMATH_INTERNAL_NAMESPACE::Shear6f    	testConstructor1;
     IMATH_INTERNAL_NAMESPACE::Shear6f    	testConstructor2( testConstructor1 );
 
