[CMake] How to get suffix of shared library file?

Brandon Van Every bvanevery at gmail.com
Wed Jun 13 21:04:11 EDT 2007


On 6/13/07, Clark J. Wang <dearvoid at gmail.com> wrote:
> Shared libs have different suffixes on different OSes. For example on Linux
> the suffix is `.so' and on Mac OS X it's `.dylib'. I want to use `dlopen()'
> in my code so I want to get the suffix and then define it in a header file.
> Can I do that in CMake? And how?

The docs for SET_TARGET_PROPERTIES talk about the SUFFIX property.
You can get any of those properties using GET_TARGET_PROPERTIES.

I suppose the relationship between GET_TARGET_PROPERTIES and
SET_TARGET_PROPERTIES is not exactly clear in the docs, although one
might infer it.


Cheers,
Brandon Van Every


More information about the CMake mailing list