Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters