Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake output name for dynamic-loaded library?

I'm trying to write cmake rules to build dynamic-loaded library for python using boost.python on linux. I'd like to use 'foo' for python module name. So, the library must be called foo.so. But by default, cmake uses standard rules for library naming, so if I write

add_library(foo foo.cpp) 

I will get libfoo.so on output. Even set_target_properties(foo PROPERTIES OUTPUT_NAME "foobar") will create libfoobar.so.

How to change this behavior?

like image 968
Anton Kazennikov Avatar asked Oct 14 '09 07:10

Anton Kazennikov


1 Answers

You can unset the prefix with this line:

set_target_properties(foo PROPERTIES PREFIX "") 
like image 156
richq Avatar answered Sep 19 '22 23:09

richq