Re: [CMake] Version in name of shared library

2012-09-06 Thread Michael Stürmer

Am 06.09.2012 09:43, schrieb Anton Sibilev:

Hi all!

I'm making shared library with add_library(xxx SHARED xxx.c) and as
result I got 'libxxx.so'.
I want to create lib with name like 'libxxx.so.1', can you please help,
how to make this?

Point is not to create link or copy libxxx.so - libxxx.so.1, but to
create it initially.

Thanks!




--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



Try the SUFFIX target property

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:SUFFIX

For me that works well even changing .dll to .some-other-ext

regards,
Michael

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Version in name of shared library

2012-09-06 Thread Michael Wild
On 09/06/2012 09:43 AM, Anton Sibilev wrote:
 Hi all!
 
 I'm making shared library with add_library(xxx SHARED xxx.c) and as
 result I got 'libxxx.so'.
 I want to create lib with name like 'libxxx.so.1', can you please help,
 how to make this?
 
 Point is not to create link or copy libxxx.so - libxxx.so.1, but to
 create it initially.
 
 Thanks!

You need to set the VERSION and SOVERSION target properties:

http://cmake.org/cmake/help/v2.8.8/cmake.html#command:set_target_properties

Michael

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Version in name of shared library

2012-09-06 Thread Michael Stürmer

Am 06.09.2012 09:43, schrieb Anton Sibilev:

Hi all!

I'm making shared library with add_library(xxx SHARED xxx.c) and as 
result I got 'libxxx.so'.
I want to create lib with name like 'libxxx.so.1', can you please 
help, how to make this?


Point is not to create link or copy libxxx.so - libxxx.so.1, but to 
create it initially.


Thanks!




--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Try the SUFFIX target property

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:SUFFIX

For me that works well even changing .dll to .some-other-ext

regards,
Michael
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Version in name of shared library

2012-09-06 Thread Eric Noulard
2012/9/6 Anton Sibilev anton.sibi...@gmail.com:
 Hi all!

 I'm making shared library with add_library(xxx SHARED xxx.c) and as result I
 got 'libxxx.so'.
 I want to create lib with name like 'libxxx.so.1', can you please help, how
 to make this?

set_target_properties(xxx PROPERTIES VERSION 1.0.0 SOVERSION 1)

see:
cmake --help-property SOVERSION

 Point is not to create link or copy libxxx.so - libxxx.so.1, but to create
 it initially.

VERSION mangle the name with version
SOVERSION creates the link

You can drive the [output] name of a target (either library or executable)
using OUTPUT_NAME property
cmake --help-property OUTPUT_NAME

But I don't think you c
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Version in name of shared library

2012-09-06 Thread Benjamin Eikel
Am Donnerstag, 6. September 2012 um 10:01:36 schrieb Michael Wild:
 On 09/06/2012 09:43 AM, Anton Sibilev wrote:
  Hi all!
  
  I'm making shared library with add_library(xxx SHARED xxx.c) and as
  result I got 'libxxx.so'.
  I want to create lib with name like 'libxxx.so.1', can you please help,
  how to make this?
  
  Point is not to create link or copy libxxx.so - libxxx.so.1, but to
  create it initially.
  
  Thanks!
 
 You need to set the VERSION and SOVERSION target properties:
 
 http://cmake.org/cmake/help/v2.8.8/cmake.html#command:set_target_properties

Right. One example:

set(MYLIB_VERSION_MAJOR 0)
set(MYLIB_VERSION_MINOR 1)
set(MYLIB_VERSION_PATCH 1)
set(MYLIB_VERSION_STRING 
${MYLIB_VERSION_MAJOR}.${MYLIB_VERSION_MINOR}.${MYLIB_VERSION_PATCH})

set_target_properties(MyLib PROPERTIES VERSION ${MYLIB_VERSION_STRING}
  SOVERSION ${MYLIB_VERSION_MAJOR})

 
 Michael
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Version in name of shared library

2012-09-06 Thread Michael Wild
On 09/06/2012 10:05 AM, Benjamin Eikel wrote:
 Am Donnerstag, 6. September 2012 um 10:01:36 schrieb Michael Wild:
 On 09/06/2012 09:43 AM, Anton Sibilev wrote:
 Hi all!

 I'm making shared library with add_library(xxx SHARED xxx.c) and as
 result I got 'libxxx.so'.
 I want to create lib with name like 'libxxx.so.1', can you please help,
 how to make this?

 Point is not to create link or copy libxxx.so - libxxx.so.1, but to
 create it initially.

 Thanks!

 You need to set the VERSION and SOVERSION target properties:

 http://cmake.org/cmake/help/v2.8.8/cmake.html#command:set_target_properties
 
 Right. One example:
 
 set(MYLIB_VERSION_MAJOR 0)
 set(MYLIB_VERSION_MINOR 1)
 set(MYLIB_VERSION_PATCH 1)
 set(MYLIB_VERSION_STRING 
 ${MYLIB_VERSION_MAJOR}.${MYLIB_VERSION_MINOR}.${MYLIB_VERSION_PATCH})
 
 set_target_properties(MyLib PROPERTIES VERSION ${MYLIB_VERSION_STRING}
   SOVERSION ${MYLIB_VERSION_MAJOR})
 

As an added remark: The SOVERSION is not necessarily the same as the
major version. The rule is that any breakage of the ABI must be
indicated by incrementing the SOVERSION. So, adding e.g. functions is no
problem, modifying argument lists or removing functions would required
the SOVERSION to be incremented. Similar rules hold of course for
non-opaque data-structures. For C++ the whole issue is infinitely more
complicated, as determining whether the ABI was changed in an
incompatible way is AFAIK nearly impossible.

Michael

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Version in name of shared library

2012-09-06 Thread Michael Wild
On 09/06/2012 10:09 AM, Michael Wild wrote:
 On 09/06/2012 10:05 AM, Benjamin Eikel wrote:
 Am Donnerstag, 6. September 2012 um 10:01:36 schrieb Michael Wild:
 On 09/06/2012 09:43 AM, Anton Sibilev wrote:
 Hi all!

 I'm making shared library with add_library(xxx SHARED xxx.c) and as
 result I got 'libxxx.so'.
 I want to create lib with name like 'libxxx.so.1', can you please help,
 how to make this?

 Point is not to create link or copy libxxx.so - libxxx.so.1, but to
 create it initially.

 Thanks!

 You need to set the VERSION and SOVERSION target properties:

 http://cmake.org/cmake/help/v2.8.8/cmake.html#command:set_target_properties

 Right. One example:

 set(MYLIB_VERSION_MAJOR 0)
 set(MYLIB_VERSION_MINOR 1)
 set(MYLIB_VERSION_PATCH 1)
 set(MYLIB_VERSION_STRING 
 ${MYLIB_VERSION_MAJOR}.${MYLIB_VERSION_MINOR}.${MYLIB_VERSION_PATCH})

 set_target_properties(MyLib PROPERTIES VERSION ${MYLIB_VERSION_STRING}
   SOVERSION ${MYLIB_VERSION_MAJOR})

 
 As an added remark: The SOVERSION is not necessarily the same as the
 major version. The rule is that any breakage of the ABI must be
 indicated by incrementing the SOVERSION. So, adding e.g. functions is no
 problem, modifying argument lists or removing functions would required
 the SOVERSION to be incremented. Similar rules hold of course for
 non-opaque data-structures. For C++ the whole issue is infinitely more
 complicated, as determining whether the ABI was changed in an
 incompatible way is AFAIK nearly impossible.
 
 Michael
 

For the interested, [1] is a very valuable resource for C++ programmers
concerned about ABI compatibility.

[1]
http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake