diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt index f091a99..2b73dc9 100644 --- a/src/backends/CMakeLists.txt +++ b/src/backends/CMakeLists.txt @@ -1,6 +1,8 @@ project(${bare_name}-backend CXX) set(BACKEND_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") +set(DINDEXER_ENABLED_BACKENDS "postgresql" CACHE STRING "Comma separated list of enabled backends. See directories in backends source directory for a list of known backends.") + function(ln_backend backend_name) add_custom_command(TARGET "${backend_name}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink $ ${BACKEND_BINARY_DIR}/$ @@ -27,13 +29,9 @@ target_link_libraries(${PROJECT_NAME} INTERFACE ${bare_name}-machinery ) -#install(TARGETS ${PROJECT_NAME} -# LIBRARY DESTINATION lib -# RUNTIME DESTINATION bin -# ARCHIVE DESTINATION lib/static -#) - -add_subdirectory(postgresql) -add_subdirectory(redis) -add_dependencies(${PROJECT_NAME} ${bare_name}-backend-postgresql) -add_dependencies(${PROJECT_NAME} ${bare_name}-backend-redis) +string(REPLACE "," ";" backend_list "${DINDEXER_ENABLED_BACKENDS}") +foreach(backend ${backend_list}) + add_subdirectory(${backend}) + add_dependencies(${PROJECT_NAME} ${bare_name}-backend-${backend}) +endforeach() +unset(backend)