[CMake] Shared library building

Craig Scott craig.scott at crascit.com
Fri Sep 14 21:52:06 EDT 2018


Perhaps the BUILD_RPATH
<https://cmake.org/cmake/help/latest/prop_tgt/BUILD_RPATH.html> and
INSTALL_RPATH
<https://cmake.org/cmake/help/latest/prop_tgt/INSTALL_RPATH.html> target
properties are (at least partially) what you are looking for? There are
also other associated properties and variables, just search the CMake docs
for RPATH to see the full set.

You still have to handle differences between Apple platforms and other unix
derivatives, but that's typically a manageably small set of differences.

On Sat, Sep 15, 2018 at 4:06 AM Rob Boehne <robb at datalogics.com> wrote:

> All,
>
>
>
> I’m switching to CMake for a complex project that supports many operating
> systems, and consists of C++ shared libraries and plugins.
>
>
>
> I tend to use ${ORIGIN} (in Linux/Solaris parlance) and -z defs at library
> creation time to support relative hard-coded library lookup paths and
> prevent problems with unresolved symbols (respectively).
>
>
>
> Both of these translate into many different flags for different compilers
> and linkers, and I was curious if there were facilities in CMake for
> handling this, or a home-grown module that can take care of that for me.
>
>
>
> Thanks,
>
>
>
> Rob
>
>
>
>
>
> [image: cid:image002.png at 01D3D0E3.DCFE6710]
>
> *Rob Boehne*
>
> Senior Software Architect | Datalogics, Inc.
>
> +1.312.853.8351 <(312)%20853-8351> | robb at datalogics.com
>
> datalogics.com <http://www.datalogics.com/> | blogs.datalogics.com
>
> Connect with us: Facebook <https://www.facebook.com/DatalogicsInc> |
> Twitter <https://twitter.com/DatalogicsInc> | LinkedIn
> <https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG>
>  | YouTube <https://www.youtube.com/user/Datalogics>
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide
<https://crascit.com/professional-cmake/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180915/3a56dcd2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 124449 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20180915/3a56dcd2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 124449 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20180915/3a56dcd2/attachment-0003.png>


More information about the CMake mailing list