WSL/SLF GitLab Repository

Commit a80fc311 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Necessary adjustments in order to be able to detect Oracle OCCI on Windows....

Necessary adjustments in order to be able to detect Oracle OCCI on Windows. But since OCCI's installation is mostly broken / messy, this might not be the end of the story!
parent 836e7b0f
......@@ -8,42 +8,75 @@
include(LibFindMacros)
# Finally the library itself
find_library(OCCI_LIBRARY
NAMES occi
#HINTS $ENV{ORACLE_HOME}/client_1/lib $ENV{ORACLE_BASE}/client_1/lib
PATHS
"$ENV{ORACLE_HOME}/client_1/lib"
"$ENV{ORACLE_BASE}/client_1/lib"
ENV LD_LIBRARY_PATH
"~/usr/lib"
"/usr/local/lib"
"/usr/lib"
"/opt/lib"
PATH_SUFFIXES "oracle/*/client_1/lib"
)
IF(WIN32)
STRING(REGEX MATCHALL "([^;]+;|[^;]+$)" ENV_PATH "$ENV{PATH}")
FOREACH(dir ${ENV_PATH})
IF (("${dir}" MATCHES "(O|o)racle") AND (NOT "${dir}" MATCHES "(J|j)ava"))
FILE(TO_CMAKE_PATH ${dir} TMP)
LIST(APPEND OCCI_HINT ${TMP})
ENDIF()
ENDFOREACH()
FIND_LIBRARY(OCCI_LIBRARY
NAMES oraocci10.lib oraocci11.lib oraocci12.lib
PATHS
"./"
"lib"
PATH_SUFFIXES
"${OCCI_HINT}"
)
#build ORACLE_ROOT so we can provide a hint for searching for the header file
IF ("${OCCI_LIBRARY}" MATCHES "^(.+)oraocci[0-9]+\\.dll$")
SET(ORACLE_ROOT "${CMAKE_MATCH_1}")
ENDIF ("${OCCI_LIBRARY}" MATCHES "^(.+)oraocci[0-9]+\\.dll$")
SET(CLNTSH_LIBRARY ${OCCI_LIBRARY})
# locate header files
FIND_PATH(OCCI_INCLUDE_DIR
NAMES occi.h
PATHS
"${ORACLE_ROOT}/rdbms/public"
)
ELSE(WIN32)
find_library(OCCI_LIBRARY
NAMES occi
#HINTS $ENV{ORACLE_HOME}/client_1/lib $ENV{ORACLE_BASE}/client_1/lib
PATHS
"$ENV{ORACLE_HOME}/client_1/lib"
"$ENV{ORACLE_BASE}/client_1/lib"
ENV LD_LIBRARY_PATH
"~/usr/lib"
"/usr/local/lib"
"/usr/lib"
"/opt/lib"
PATH_SUFFIXES "oracle/*/client_1/lib"
)
#build ORACLE_ROOT so we can provide a hint for searching for the header file
if ("${OCCI_LIBRARY}" MATCHES "^(.+)lib[\\/]libocci\\.(.+)$")
set(ORACLE_ROOT "${CMAKE_MATCH_1}")
endif ("${OCCI_LIBRARY}" MATCHES "^(.+)lib[\\/]libocci\\.(.+)$")
#build ORACLE_ROOT so we can provide a hint for searching for the header file
if ("${OCCI_LIBRARY}" MATCHES "^(.+)lib[\\/]libocci\\.(.+)$")
set(ORACLE_ROOT "${CMAKE_MATCH_1}")
endif ("${OCCI_LIBRARY}" MATCHES "^(.+)lib[\\/]libocci\\.(.+)$")
#libclntsh comes with libocci, in the same directory, but we need to explicitly reference it
find_library(CLNTSH_LIBRARY NAMES clntsh PATHS "${ORACLE_ROOT}/lib")
#libclntsh comes with libocci, in the same directory, but we need to explicitly reference it
find_library(CLNTSH_LIBRARY NAMES clntsh PATHS "${ORACLE_ROOT}/lib")
# locate header files
find_path(OCCI_INCLUDE_DIR
NAMES occi.h
#HINTS ${ORACLE_ROOT}/include
PATHS
"${ORACLE_ROOT}/include"
"~/usr/include"
"/usr/local/include"
"/usr/local"
"/usr/include"
"/opt/include"
PATH_SUFFIXES "oracle/*/client_1/include"
)
# locate header files
find_path(OCCI_INCLUDE_DIR
NAMES occi.h
#HINTS ${ORACLE_ROOT}/include
PATHS
"${ORACLE_ROOT}/include"
"~/usr/include"
"/usr/local/include"
"/usr/local"
"/usr/include"
"/opt/include"
PATH_SUFFIXES "oracle/*/client_1/include"
)
ENDIF(WIN32)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment