0

I am trying to build SOCI on Windows with a different library suffix using the CMAKE_SHARED_LIBRARY_SUFFIX option, but the script seems to ignore it.

Here is the command I run in a batch file:

cmake^
 -G "NMake Makefiles"^
 -DCMAKE_BUILD_TYPE=Release^
 -DCMAKE_SHARED_LIBRARY_SUFFIX="-vc140-x64-mt.dll"^
 ..\soci.3.2.3

The documentation does not say anything about the CMAKE_SHARED_LIBRARY_SUFFIX option, but the core/CMakeLists.txt script uses it to define the SOCI_LIB_SUFFIX option, which is reported on the screen when cmake is run. However, its value is always ".dll" instead of "-vc140-x64-mt.dll", so it must be overwritten somewhere I don't know.

Any idea why is this happening and how fix it?

eXe
  • 186
  • 2
  • 9
  • Looks like SOCI changes variable `CMAKE_SHARED_LIBRARY_SUFFIX` for its own purposes. You may find this usage (e.g. with help of command [variable_watch](https://cmake.org/cmake/help/v3.0/command/variable_watch.html) at the beginning of the script) and modify it as you need. – Tsyvarev Jul 31 '16 at 18:59
  • Thanks for your reply. Your comment gave me insights and I could find the problem and a solution. But the problem is more related to CMake than SOCI. So I think I should rewrite the question to use SOCI just as an example project. After that I could post a more suitable answer. – eXe Oct 03 '16 at 01:45

0 Answers0