[Liblas-commits] hg: Added FindOracle.cmake macro for CMake based build configura...

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Jan 7 19:29:01 EST 2010


changeset 9a87edbc56c7 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9a87edbc56c7
summary: Added FindOracle.cmake macro for CMake based build configuration

diffstat:

 build/cmake/FindOracle.cmake |  78 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 0 deletions(-)

diffs (82 lines):

diff -r b2f6a8113ba4 -r 9a87edbc56c7 build/cmake/FindOracle.cmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/cmake/FindOracle.cmake	Fri Jan 08 00:28:50 2010 +0000
@@ -0,0 +1,78 @@
+###############################################################################
+#
+# CMake module to search for Oracle client library (OCI)
+#
+# On success, the macro sets the following variables:
+# ORACLE_FOUND       = if the library found
+# ORACLE_LIBRARIES   = full path to the library
+# ORACLE_INCLUDE_DIR = where to find the library headers also defined,
+#                       but not for general use are
+# ORACLE_VERSION     = version of library which was found, e.g. "1.2.5"
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
+#
+# Developed with inspiration from Petr Vanek <petr at scribus.info>
+# who wrote similar macro for TOra - http://torasql.com/
+#
+# Module source: http://github.com/mloskot/workshop/tree/master/cmake/
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+###############################################################################
+message(STATUS "Searching for Oracle ${Oracle_FIND_VERSION}+ OCI client library")
+
+if(ORACLE_INCLUDE_DIR)
+  # Already in cache, be silent
+  set(ORACLE_FIND_QUIETLY TRUE)
+endif()
+
+if(NOT DEFINED ENV{ORACLE_HOME})
+  message(FATAL_ERROR "Missing environment variable ORACLE_HOME with location of Oracle installation")
+endif()
+
+set(ORACLE_HOME $ENV{ORACLE_HOME})
+
+find_path(ORACLE_INCLUDE_DIR
+  oci.h
+  PATHS
+  ${ORACLE_HOME}/rdbms/public
+  ${ORACLE_HOME}/include
+  ${ORACLE_HOME}/sdk/include # Oracle SDK
+  ${ORACLE_HOME}/OCI/include # Oracle XE on Windows
+  )
+
+set(ORACLE_OCI_NAMES libclntsh clntsh oci)
+set(ORACLE_NNZ_NAMES libnnz10 nnz10 libnnz11 nnz11 ociw32)
+# TODO: Not used at the moment
+#set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11)
+
+set(ORACLE_LIB_DIR 
+  ${ORACLE_HOME}/lib
+  ${ORACLE_HOME}/OCI/lib/MSVC # Oracle XE on Windows
+)
+
+find_library(ORACLE_OCI_LIBRARY  NAMES ${ORACLE_OCI_NAMES} PATHS ${ORACLE_LIB_DIR})
+#find_library(ORACLE_OCCI_LIBRARY NAMES ${ORACLE_OCCI_NAMES} PATHS ${ORACLE_LIB_DIR})
+find_library(ORACLE_NNZ_LIBRARY NAMES ${ORACLE_NNZ_NAMES} PATHS ${ORACLE_LIB_DIR})
+
+set(ORACLE_LIBRARY ${ORACLE_OCI_LIBRARY} ${ORACLE_OCCI_LIBRARY} ${ORACLE_NNZ_LIBRARY})
+
+if(APPLE)
+  set(ORACLE_OCIEI_NAMES libociei ociei)
+
+  find_library(ORACLE_OCIEI_LIBRARY
+    NAMES libociei ociei
+    PATHS ${ORACLE_LIB_DIR})
+
+  if(ORACLE_OCIEI_LIBRARY)
+    set(ORACLE_LIBRARY ${ORACLE_LIBRARY} ${ORACLE_OCIEI_LIBRARY})
+  else(ORACLE_OCIEI_LIBRARY)
+    message(STATUS "libociei.dylib is not found. It may cause crash if you are building BUNDLE")
+  endif()
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE
+# if all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Oracle DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR)


More information about the Liblas-commits mailing list