sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.

Home Page:https://sbml.org/software/libsbml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent CMake package and target names

dg0yt opened this issue · comments

The installed CMake config package and target names vary depending on platform. On windows, users need:

find_package(libsbml)
target_link_libraries(main PRIVATE libsbml)

but on other platforms, it is:

find_package(sbml)
target_link_libraries(main PRIVATE sbml)

This is extremely inconvenient for cross-platforms users, and against of the intention of CMake config to abstract from implementation details. (And I do not refer to the fact that static library linkage adds a -static suffix.)

I suggest to standardize on sbml for both package and target basename.
If there is a desire to add a lib prefix to MSVC import or runtime libraries, this can be achieved e.g. by adjusting the OUTPUT_NAME target property.
Alternatively, standardize on libsbml if there is also sbml tool.

Maybe this opportunity could be used to add an sbml:: namespace prefix to the exported target names,
and to move the sbml-target into the sbml cmake package, too.