Hello,

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 ...

?

This is the behavior that I am seeing in the CMake version that I am using but 
there is no mention of this in the documentation for target_link_libraries(...) 
at:

    
http://www.cmake.org/cmake/help/cmake2.6docs.html#command:target_link_libraries

This is important because I have some arbitrary third partly libraries and some 
of them have some internal dependencies.  I am happy to list these in the right 
order in one place to take are of the dependency ordering.

I am nervous to rely on the ordering that I am seeing without some assurance 
that this ordering is guaranteed.

Thanks,

- Ross

---------------------------------------------------------
Dr. Roscoe A. Bartlett
Senior Member of the Technical Staff
Trilinos Software Engineering Technologies and Integration Lead
Sandia National Laboratories
Phone: (505) 275-6147



_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to