On 18 February 2013 15:04, Viacheslav Naydenov <[email protected]> wrote:
> 18.02.2013, 18:57, "Mateusz Loskot" <[email protected]>:
>> On 18 February 2013 14:07, Vadim Zeitlin <[email protected]> wrote:
>>
>>>  I can't make it work on my
>>>  system because there doesn't seem to be any way to install libfbembed.so as
>>>  libfbclient.so, and as soci_firebird_test depends on the latter and not on
>>>  the former, the only way to make it work I can see is to copy
>>>  /usr/lib/libedit.so.2 to ~/tmp/libfbclient.so and put ~/tmp as the first
>>>  directory of LD_LIBRARY_PATH when running the test. But surely there must
>>>  be some other, better way?
>>
>> As you can see in the .travis.yml, I don't play any such advanced games 
>> really.
>> I can't give any Firebird-specific advice here, but if there are two
>> types of clients
>> for Firebird, perhaps we can update CMake to allow users to choose.
>> I think similar thing will need to be added for MySQL, as we already detect
>> embedded MySQL in FindMySQL.cmake.
>
> Yes, cmake/modules/FindFirebird.cmake we are using is just not smart enough 
> to find
> anything other than libfbclient.so.
> Maybe we should add a configure option to look for libfbembed.so instead.

I remember Vadim's thread, we've been talking about it already.
Simplest option is to try to find either of the client libs:

find_library(FIREBIRD_LIBRARY
   NAMES fbembed fbclient
   ...
)

and don't give user to control which one he wants to use with SOCI :)

Flexible option is to find both and expose separate CMake variables
similarly to what we do for MySQL now:

https://github.com/SOCI/soci/blob/master/src/cmake/modules/FindMySQL.cmake

In SOCI-specific CMake scripts, we offer two mutually exclusive
options for users:

SOCI_FIREBIRD_USE_CLIENT (default)
SOCI_FIREBIRD_USE_EMBED

Then, we do something likethis to configure Firebird support:

if (SOCI_FIREBIRD)
   if (SOCI_FIREBIRD_USE_CLIENT AND FIREBIRD_LIBRARIES)
          # Use fbclient
   elseif (SOCI_FIREBIRD_USE_EMBED AND FIREBIRD_EMBEDDED_LIBRARIES)
          # Use fbembed
   else()
          # No Firebird support configured
   endif()
endif()

I guess, very similar approach would be used for MySQL.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to