Commit cf76df6c authored by Mateusz Loskot's avatar Mateusz Loskot

Patch from Alex Ott to allow loading of backends from default install directory.

parent 0ecdbfa6
......@@ -71,6 +71,11 @@ set(SOCI_CORE_TARGET ${PROJECTNAMEL}_core)
soci_target_output_name(${SOCI_CORE_TARGET} SOCI_CORE_TARGET_OUTPUT_NAME)
# Configure SOCI backend loader to also use default install directory.
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
configure_file(soci_backends_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/soci_backends_config.h)
#
# Core shared library
#
......
......@@ -17,6 +17,8 @@
#include <stdint.h>
#endif
#include "soci_backends_config.h"
using namespace soci;
using namespace soci::dynamic_backends;
......@@ -102,6 +104,7 @@ std::vector<std::string> get_default_paths()
if (0 == penv)
{
paths.push_back(".");
paths.push_back(DEFAULT_BACKENDS_PATH);
return paths;
}
......@@ -109,6 +112,7 @@ std::vector<std::string> get_default_paths()
if (env.empty())
{
paths.push_back(".");
paths.push_back(DEFAULT_BACKENDS_PATH);
return paths;
}
......
//
// Copyright (C) 2011 Alex Ott <alexott@gmail.com>
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef SOCI_BACKENDS_CONFIG_H
#define SOCI_BACKENDS_CONFIG_H
#define DEFAULT_BACKENDS_PATH "@CMAKE_INSTALL_PREFIX@/@LIBDIR@"
#endif // SOCI_BACKENDS_CONFIG_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment