1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-29 01:33:46 +00:00

Make symlink to postgresql backend

This is helpful so when running dindexer in a dev environment you don't
need to list all the possible paths to every backend. Symlinks to all
backends will all be in the same place.
This commit is contained in:
King_DuckZ 2016-06-06 20:24:05 +02:00
parent 624bba121f
commit 3fe962a8e5
4 changed files with 12 additions and 2 deletions

View file

@ -7,3 +7,4 @@ postgresql_settings:
dbname: dindexer
port: 5432
address: 200.100.200.100
backend_paths: path to your build_dir/src/backend

View file

@ -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 $<TARGET_FILE:${backend_name}> ${BACKEND_BINARY_DIR}/$<TARGET_FILE_NAME:${backend_name}>
DEPENDS ${BACKEND_BINARY_DIR}/$<TARGET_FILE_NAME:${backend_name}>
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)

View file

@ -23,3 +23,4 @@ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib/static
)
ln_backend(${PROJECT_NAME})

View file

@ -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);