Bartlett, Roscoe A wrote:
Does CMake guarantee that the order of the libraries passed into target_link_libraries(...) is preserved on the actual link line? For example, If I have: target_link_libraries(sometarget lib1 lib2 lib3 ...) does CMake guarantee that the link line will have the ordering: g++ ... -llib1 -llib2 -llib3 ...
[snip]
I am nervous to rely on the ordering that I am seeing without some assurance that this ordering is guaranteed.
It is preserved for exactly your reason (unknown third-party inter-dependencies). CMake might add libraries to the end of the list to satisfy known dependencies but always starts with the exact order (and multiplicity) provided by the user.
-Brad _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake