Hello, we are facing an issue while using cmake and we have no idea how to solve or debug it. We have a complex and huge project (about 50 subdirectories and dependencies everywhere), and we are facing issue regarding the link order. There is a lot of dependencies between those projects, and to summarize, we have two libraries A and B A is an imported library from headers and shared lib .so declared like this ``` add_library(A SHARED IMPORTED GLOBAL) set_target_properties(A PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION ${A_LIBRARY}) ```
B is a system library part of a package. We need to link A before B in every case. In every project, we include A before B using ``` find_package(B) target_link_libraries(${library_produced} PUBLIC A) target_link_libraries(${library_produced} PUBLIC B) ``` but from time to time, we don't know why, the library produced link in the wrong order (checked with ldd and make VERBOSE=1). it links B before A. Is there a way to find out what happens and why cmake change the link order for some project and not all projects ? Best regards, Bill
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake