Permalink
Browse files

Merge pull request #8 from snikulov/soci_cmake_build_update

cmake: updated backends build
  • Loading branch information...
mloskot committed Sep 28, 2012
2 parents d80b622 + 7b8baed commit 8eb4376c8065e8c28c45a46b67684120a6164203
Showing with 36 additions and 9 deletions.
  1. +31 −7 src/backends/CMakeLists.txt
  2. +5 −2 src/cmake/SociDependencies.cmake
@@ -1,9 +1,33 @@
colormsg(_HIBLUE_ "Configuring SOCI database backends:")
# TODO: Scan and add directories automatically --mloskot
add_subdirectory(empty)
add_subdirectory(mysql)
add_subdirectory(odbc)
add_subdirectory(oracle)
add_subdirectory(postgresql)
add_subdirectory(sqlite3)
# First, we'll investigate what can be found from database engines
foreach(dep ${SOCI_BACKENDS_DB_DEPENDENCIES})
string(TOUPPER ${dep} depUP)
find_package(${dep})
if(${dep}_FOUND OR ${depUP}_FOUND)
set(${depUP}_FOUND ON)
else()
set(${depUP}_FOUND OFF)
endif()
endforeach()
# get all files in backends
file(GLOB backend_dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
# empty backend always on by default
set(EMPTY_FOUND ON)
# enable only found backends
foreach(dir ${backend_dirs})
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${dir})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt)
string(TOUPPER ${dir} dirUP)
if(${dirUP}_FOUND)
add_subdirectory(${dir})
message("added backend: ${dir}")
endif()
endif()
endif()
endforeach()
message(STATUS "")
@@ -19,14 +19,17 @@
#
# List of SOCI dependncies
#
set(SOCI_BACKENDS_ALL_DEPENDENCIES
Boost
set(SOCI_BACKENDS_DB_DEPENDENCIES
MySQL
ODBC
Oracle
PostgreSQL
SQLite3)
set(SOCI_BACKENDS_ALL_DEPENDENCIES
Boost
${SOCI_BACKENDS_DB_DEPENDENCIES})
#
# Perform checks
#

0 comments on commit 8eb4376

Please sign in to comment.