http://sourceforge.net/p/tora/bugs/867/ http://sourceforge.net/p/tora/code/4555/ http://sourceforge.net/p/tora/code/4561/ http://sourceforge.net/p/tora/code/4578/ --- cmake/modules/FindOracle.cmake.orig 2010-09-19 04:27:37.000000000 -0500 +++ cmake/modules/FindOracle.cmake 2013-03-22 20:48:28.000000000 -0500 @@ -11,7 +11,7 @@ # # copyright (c) 2007 Petr Vanek # copyright (c) 2009 Ivan Brezina -# Redistribution and use is allowed according to the terms of the GPLv2 license. +# Redistribution and use is allowed according to the terms of the BSD license. # SET(ORACLE_FOUND "NO") @@ -30,11 +30,6 @@ SET(ORACLE_USE_CLNTSH 1) ENDIF (NOT ORACLE_USE_CLNTSH) - # it looks like it's mandatory on macosx - IF (APPLE) - SET(ORACLE_USE_OCIEI 1) - ENDIF (APPLE) - ENDIF( Oracle_FIND_COMPONENTS ) @@ -77,6 +72,43 @@ SET(FORCE_ERROR 0) +# guess OCI version +# we need it before lib checking because of OS X bugs in instant client (see below) +IF (NOT DEFINED ORACLE_OCI_VERSION AND ORACLE_INCLUDES) + TRY_RUN(OCIVER_TYPE OCIVER_COMPILED + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/cmake/modules/OCIVersion.c + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${ORACLE_INCLUDES}" + OUTPUT_VARIABLE OCIVER) + + IF (${OCIVER_TYPE} GREATER "110") + SET(ORACLE_OCI_VERSION "11G") + ELSEIF (${OCIVER_TYPE} EQUAL "102") + SET(ORACLE_OCI_VERSION "10G_R2") + ELSEIF (${OCIVER_TYPE} EQUAL "101") + SET(ORACLE_OCI_VERSION "10G") + ELSEIF (${OCIVER_TYPE} EQUAL "91") + SET(ORACLE_OCI_VERSION "9") + ELSEIF (${OCIVER_TYPE} EQUAL "92") + SET(ORACLE_OCI_VERSION "9") + ELSEIF (NOT ${OCIVER_TYPE} GREATER "90") + SET(ORACLE_OCI_VERSION "8I") + ELSE (${OCIVER_TYPE} GREATER "110") + SET(ORACLE_OCI_VERSION "10G_R2") + ENDIF (${OCIVER_TYPE} GREATER "110") + + MESSAGE(STATUS "Guessed ORACLE_OCI_VERSION value: ${ORACLE_OCI_VERSION} for ${OCIVER_TYPE}") + + IF (APPLE) + IF (${OCIVER_TYPE} LESS 110) + SET(ORACLE_USE_OCIEI 1) + message(STATUS " APPLE requires libociei for instantclient < 11, enforcing ociei") + ENDIF () + ENDIF (APPLE) + +ENDIF (NOT DEFINED ORACLE_OCI_VERSION AND ORACLE_INCLUDES) + + IF (ORACLE_USE_CLNTSH) FIND_LIBRARY( ORACLE_LIBRARY_CLNTSH @@ -171,33 +203,6 @@ LIST(APPEND ORACLE_INCLUDES ${ORACLE_INCLUDES_XML}) ENDIF (ORACLE_INCLUDES_XML AND ORACLE_LIBRARY_XML) -# guess OCI version -IF (NOT DEFINED ORACLE_OCI_VERSION AND ORACLE_INCLUDES) - TRY_RUN(OCIVER_TYPE OCIVER_COMPILED - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/cmake/modules/OCIVersion.c - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${ORACLE_INCLUDES}" - OUTPUT_VARIABLE OCIVER) - - IF (${OCIVER_TYPE} GREATER "110") - SET(ORACLE_OCI_VERSION "11G") - ELSEIF (${OCIVER_TYPE} EQUAL "102") - SET(ORACLE_OCI_VERSION "10G_R2") - ELSEIF (${OCIVER_TYPE} EQUAL "101") - SET(ORACLE_OCI_VERSION "10G") - ELSEIF (${OCIVER_TYPE} EQUAL "91") - SET(ORACLE_OCI_VERSION "9") - ELSEIF (${OCIVER_TYPE} EQUAL "92") - SET(ORACLE_OCI_VERSION "9") - ELSEIF (NOT ${OCIVER_TYPE} GREATER "90") - SET(ORACLE_OCI_VERSION "8I") - ELSE (${OCIVER_TYPE} GREATER "110") - SET(ORACLE_OCI_VERSION "10G_R2") - ENDIF (${OCIVER_TYPE} GREATER "110") - - MESSAGE(STATUS "Guessed ORACLE_OCI_VERSION value: ${ORACLE_OCI_VERSION} for ${OCIVER_TYPE}") -ENDIF (NOT DEFINED ORACLE_OCI_VERSION AND ORACLE_INCLUDES) - MESSAGE(STATUS "Found Oracle: ${ORACLE_LIBRARIES} (ORACLE_HOME='${ORACLE_HOME}')") MESSAGE(STATUS " includes: ${ORACLE_INCLUDES}") MESSAGE(STATUS "Found XML Oracle: ${ORACLE_INCLUDES_XML} ${ORACLE_LIBRARY_XML}")