diff --git a/dindexer.yml b/dindexer.yml index 38242d4..0f1330f 100644 --- a/dindexer.yml +++ b/dindexer.yml @@ -7,3 +7,4 @@ postgresql_settings: dbname: dindexer port: 5432 address: 200.100.200.100 +backend_paths: path to your build_dir/src/backend diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt index 0ac6613..302b2e8 100644 --- a/src/backends/CMakeLists.txt +++ b/src/backends/CMakeLists.txt @@ -1,5 +1,14 @@ project(${bare_name}-backend CXX) +set(BACKEND_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") +function(ln_backend backend_name) + add_custom_command(TARGET "${backend_name}" POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink $ ${BACKEND_BINARY_DIR}/$ + DEPENDS ${BACKEND_BINARY_DIR}/$ + COMMENT "Creating symlink to ${backend_name}" + ) +endfunction() + add_library(${PROJECT_NAME} STATIC backend_loader.cpp ) @@ -25,5 +34,4 @@ target_link_libraries(${PROJECT_NAME} #) add_subdirectory(postgresql) - add_dependencies(${PROJECT_NAME} ${bare_name}-backend-postgresql) diff --git a/src/backends/postgresql/CMakeLists.txt b/src/backends/postgresql/CMakeLists.txt index 89b8680..486d5b0 100644 --- a/src/backends/postgresql/CMakeLists.txt +++ b/src/backends/postgresql/CMakeLists.txt @@ -23,3 +23,4 @@ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/static ) +ln_backend(${PROJECT_NAME}) diff --git a/src/common/settings.cpp b/src/common/settings.cpp index cf68d48..95b6b45 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -35,7 +35,7 @@ namespace dinlib { void load_settings (const std::string& parPath, dinlib::Settings& parOut, bool parExpand) { const std::string path = (parExpand ? expand(parPath.c_str()) : parPath); - std::string search_paths(ACTIONS_SEARCH_PATH); + std::string search_paths; auto settings = YAML::LoadFile(path);