You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I had to build and link RDKit & dependencies into another project as static libs. The other project used CMake, so I tried to import RDKit's exports to configure the project, and found a problem that broke the build of the other project:
When we use external builds of maeparser and coordgen, RDKit's mechanism to build static libraries is breaking the export target. Looking into rdkit-targets.cmake (generated under rdkit/build/CMakeFiles/Export/lib/cmake/rdkit), it contains the following (I added line breaks after each semicolon, to make it more readable):
The problem here is that neither /tmp/deps/coordgen-install/lib/libcoordgen.a_static nor /tmp/deps/maeparser-install/lib/libmaeparser.a_static exist: the actual lib filenames (libcoordgen.a and libmaeparser.a) have been added a "_static" suffix). So, importing this CMake targets file will cause the parent project to fail building, since we won't be able to link against these libraries.
I know where this comes from, and I think I can improve/fix it, so I'll post a PR soon.
Also, there's a second issue, which is that having explicit file names in the CMake export target prevents it from being relocatable, but that's a different issue (the exports will work, as long as the explicitly mentioned dependencies aren't moved).
The text was updated successfully, but these errors were encountered:
Recently, I had to build and link RDKit & dependencies into another project as static libs. The other project used CMake, so I tried to import RDKit's exports to configure the project, and found a problem that broke the build of the other project:
When we use external builds of maeparser and coordgen, RDKit's mechanism to build static libraries is breaking the export target. Looking into rdkit-targets.cmake (generated under
rdkit/build/CMakeFiles/Export/lib/cmake/rdkit
), it contains the following (I added line breaks after each semicolon, to make it more readable):The problem here is that neither
/tmp/deps/coordgen-install/lib/libcoordgen.a_static
nor/tmp/deps/maeparser-install/lib/libmaeparser.a_static
exist: the actual lib filenames (libcoordgen.a
andlibmaeparser.a
) have been added a "_static" suffix). So, importing this CMake targets file will cause the parent project to fail building, since we won't be able to link against these libraries.I know where this comes from, and I think I can improve/fix it, so I'll post a PR soon.
Also, there's a second issue, which is that having explicit file names in the CMake export target prevents it from being relocatable, but that's a different issue (the exports will work, as long as the explicitly mentioned dependencies aren't moved).
The text was updated successfully, but these errors were encountered: