I want my libraries to be generated as lib-something.so.1.0.0 and not liblib-something.so.1.0.0. For this, I used the proposals from this link: stop_preppending_'lib'_to_libs. But it seems that CMake is not able to find the library anymore.
This is what I did:
lib-something/src/CMakeLists.txt:
add_library(lib-something SHARED
${CMAKE_CURRENT_SOURCE_DIR}/Something.cpp )
set_target_properties(lib-something PROPERTIES PREFIX "")
lib-another/src/CMakeLists.txt:
add_dependencies(lib-another lib-something)
It is able to find it if I do:
add_dependencies(lib-another something)
altough my target is named 'lib-something'. I don't want that. If I were okey with having to add dependencies as 'something' I would have removed the 'lib' from the target name and it would have been enough. I find this an easy way to be identified by the users as libraries and not executables.
Any ideas?
Edited: I also tried this:
add_library(something SHARED
${CMAKE_CURRENT_SOURCE_DIR}/Something.cpp )
set_target_properties(something PROPERTIES OUTPUT_NAME "lib-something")
In other projects:
add_dependencies(lib-another lib-something)
It works, but it looks that the generation of the libraries is also liblib...
As far as I have seen, there is no way to avoid this 'liblib' thing without changing the prefix into "", and if this prefix is changed then the library is not found no matter what.