Shared library building

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Shared library building

Rob Boehne

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

 

 

cid:image002.png@01D3D0E3.DCFE6710

Rob Boehne

Senior Software Architect | Datalogics, Inc.

<a href="tel:(312)%20853-8351">+1.312.853.8351 | [hidden email]

datalogics.com | blogs.datalogics.com

Connect with us: Facebook | Twitter | LinkedIn | YouTube

 

 


--

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
Reply | Threaded
Open this post in threaded view
|

Re: Shared library building

Craig Scott-3
Perhaps the BUILD_RPATH and INSTALL_RPATH 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 <[hidden email]> 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

 

 

Rob Boehne

Senior Software Architect | Datalogics, Inc.

<a href="tel:(312)%20853-8351" target="_blank">+1.312.853.8351 | [hidden email]

datalogics.com | blogs.datalogics.com

Connect with us: Facebook | Twitter | LinkedIn | YouTube

 

 

--

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


--

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

image001.png (166K) Download Attachment
image001.png (166K) Download Attachment