$OpenBSD: patch-Modules_Platform_UnixPaths_cmake,v 1.1 2013/05/30 08:34:32 dcoppa Exp $
--- Modules/Platform/UnixPaths.cmake.orig	Tue Nov 27 14:26:32 2012
+++ Modules/Platform/UnixPaths.cmake	Wed May 29 16:02:08 2013
@@ -24,6 +24,19 @@ set(__UNIX_PATHS_INCLUDED 1)
 
 set(UNIX 1)
 
+if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+  if($ENV{LOCALBASE})
+    set(OPENBSD_LOCALBASE $ENV{LOCALBASE})
+  else()
+    set(OPENBSD_LOCALBASE /usr/local)
+  endif()
+  if($ENV{X11BASE})
+    set(OPENBSD_X11BASE $ENV{X11BASE})
+  else()
+    set(OPENBSD_X11BASE /usr/X11R6)
+  endif()
+endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+
 # also add the install directory of the running cmake to the search directories
 # CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up
 get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
@@ -83,6 +96,19 @@ list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
 list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
   /usr/include
   )
+
+if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+  list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+    ${OPENBSD_LOCALBASE}/include
+    )
+  list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+    ${OPENBSD_LOCALBASE}/lib
+    )
+  list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+    ${OPENBSD_LOCALBASE}/bin
+    ${OPENBSD_LOCALBASE}/sbin
+    )
+endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 
 # Enable use of lib64 search path variants by default.
 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
