[CMake] Can't unset suffix

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 21 12:59:41 EDT 2008


On 2008-05-21 09:03-0500 Wade Williams wrote:

> Using Cmake 2.4.7 on Ubuntu.
>
> My project produces a shared library on Unix which is a plugin.  Therefore, 
> it does not need the standard "libxxx.so" naming.   I want the name to be 
> "xsb_vatsim.xpl"
>
> I've changed the suffix to what I want, but now I'm trying to eliminate the 
> prefix and finding it impossible.
>
> If I use:
>
> SET_TARGET_PROPERTIES(xsb_vatsim PROPERTIES PREFIX "")
>
> I get:
>
> ""xsb_vatsim.xpl
>
> as an output file.
>
> If I use:
>
> SET_TARGET_PROPERTIES(xsb_vatsim PROPERTIES PREFIX)
>
> I get:
>
> SET_TARGET_PROPERTIES called with incorrect number of arguments
>
> any thoughts on how I can correct this?

The PLplot project uses the following construct all the time without
problems for exactly this situation (building plugin shared objects) on
Unix systems.

set_target_properties(targetname PROPERTIES PREFIX "" SUFFIX ${DYNAMIC_SUFFIX})

where $DYNAMIC_SUFFIX is platform-dependent (".dll" on CYGWIN and ".so" for
Mac OS X and Linux).  (Note, these suffixes are demanded by the libltdl
library and should probably be something else if you are using some other
alternative for your dynamic loading.)

The only real difference with what you have done above, is both PREFIX and
SUFFIX are set at the same time, but that shouldn't matter.  Since I don't
observe the behaviour you have found, I suggest you put together an
extremely simple but complete example (hello-world plugin build).  If the
problem occurs in that context, then that simple example could be used by
others to verify/fix the problem.  OTOH, on a number of occasions I have
prepared a simple but complete example of a CMake "problem" only to find the
problem disappeared in the simple context, i.e., I had introduced some CMake
logic bug in the more complex context.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list