diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a7e627c49afd35a67a8331a8eca1cc2a71f966d..7761f0c8d380a7237582dc6a8d6cc5f4b244d48e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,6 +109,21 @@ ELSE(DEFINED PackageOnly)
   include_directories(${PROJECT_SOURCE_DIR})
   include_directories(${CMAKE_BINARY_DIR})
 
+  # OCCI support is on by default
+  set (OCCI_SUPPORT ON)
+
+  # Switch OCCI support off if using gcc 5.1 or higher
+  if (CMAKE_COMPILER_IS_GNUCC)
+    if (GCC_VERSION VERSION_GREATER 5.0)
+      message (STATUS "Detected gcc >= 5.1 - Switching off OCCI support")
+      set (OCCI_SUPPORT OFF)
+    endif (GCC_VERSION VERSION_GREATER 5.0)
+  endif (CMAKE_COMPILER_IS_GNUCC)
+
+  if (OCCI_SUPPORT)
+    find_package (oracle-instantclient REQUIRED)
+  endif (OCCI_SUPPORT)
+
   if(BUILD_CMDLINE_ONLY)
     message(STATUS "Build cmdline only")
     add_subdirectory(cmdline)
diff --git a/catalogue/CMakeLists.txt b/catalogue/CMakeLists.txt
index 78425a90a3c3fcc074d29417be8901b81111f05b..ccffaf89fcd73af32c7d86d041a96cac7a9d63bd 100644
--- a/catalogue/CMakeLists.txt
+++ b/catalogue/CMakeLists.txt
@@ -15,21 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 cmake_minimum_required (VERSION 2.6)
 
-# OCCI support is on by default
-set (OCCI_SUPPORT ON)
-
-# Switch OCCI support off if using gcc 5.1 or higher
-if (CMAKE_COMPILER_IS_GNUCC)
-  if (GCC_VERSION VERSION_GREATER 5.0)
-    message(STATUS "Detected gcc >= 5.1 - Switching off OCCI support")
-    set (OCCI_SUPPORT OFF)
-  endif (GCC_VERSION VERSION_GREATER 5.0)
-endif (CMAKE_COMPILER_IS_GNUCC)
-
-if(OCCI_SUPPORT)
-  find_package (oracle-instantclient REQUIRED)
+if (OCCI_SUPPORT)
   include_directories (${ORACLE-INSTANTCLIENT_INCLUDE_DIRS})
-endif(OCCI_SUPPORT)
+endif (OCCI_SUPPORT)
 
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")