Re: [CMake] --start-group, --end-group
Thanks, Michael. TARGET_LINK_LIBRARIES and link flags work fine! 2011/5/19 Michael Hertling : > On 05/19/2011 11:11 AM, Anton Sibilev wrote: >> Hello! >> I'm wondering how I can use "--start-group archives --end-group" >> linker flags with "Unix Makefiles". >> May be somebody know the right way? > > You might specify these flags immediately in TARGET_LINK_LIBRARIES(): > > CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) > PROJECT(LINKERGROUPS C) > SET(CMAKE_VERBOSE_MAKEFILE ON) > FILE(WRITE ${CMAKE_BINARY_DIR}/f.c "void f(void){}\n") > FILE(WRITE ${CMAKE_BINARY_DIR}/g1.c "void g1(void){}\n") > FILE(WRITE ${CMAKE_BINARY_DIR}/g2.c "void g2(void){}\n") > FILE(WRITE ${CMAKE_BINARY_DIR}/h.c "void h(void){}\n") > ADD_LIBRARY(f STATIC f.c) > ADD_LIBRARY(g1 STATIC g1.c) > ADD_LIBRARY(g2 STATIC g2.c) > ADD_LIBRARY(h STATIC h.c) > FILE(WRITE ${CMAKE_BINARY_DIR}/main.c "int main(void){return 0;}\n") > ADD_EXECUTABLE(main main.c) > TARGET_LINK_LIBRARIES(main f -Wl,--start-group g1 g2 -Wl,--end-group h) > > However, do you really need these flags? Refer to the target properties > [IMPORTED_]LINK_INTERFACE_MULTIPLICITY[_] and the documentation > of TARGET_LINK_LIBRARIES(). > > Regards, > > Michael > ___ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] --start-group, --end-group
On 05/19/2011 11:11 AM, Anton Sibilev wrote: > Hello! > I'm wondering how I can use "--start-group archives --end-group" > linker flags with "Unix Makefiles". > May be somebody know the right way? You might specify these flags immediately in TARGET_LINK_LIBRARIES(): CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(LINKERGROUPS C) SET(CMAKE_VERBOSE_MAKEFILE ON) FILE(WRITE ${CMAKE_BINARY_DIR}/f.c "void f(void){}\n") FILE(WRITE ${CMAKE_BINARY_DIR}/g1.c "void g1(void){}\n") FILE(WRITE ${CMAKE_BINARY_DIR}/g2.c "void g2(void){}\n") FILE(WRITE ${CMAKE_BINARY_DIR}/h.c "void h(void){}\n") ADD_LIBRARY(f STATIC f.c) ADD_LIBRARY(g1 STATIC g1.c) ADD_LIBRARY(g2 STATIC g2.c) ADD_LIBRARY(h STATIC h.c) FILE(WRITE ${CMAKE_BINARY_DIR}/main.c "int main(void){return 0;}\n") ADD_EXECUTABLE(main main.c) TARGET_LINK_LIBRARIES(main f -Wl,--start-group g1 g2 -Wl,--end-group h) However, do you really need these flags? Refer to the target properties [IMPORTED_]LINK_INTERFACE_MULTIPLICITY[_] and the documentation of TARGET_LINK_LIBRARIES(). Regards, Michael ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] --start-group, --end-group
Hello! I'm wondering how I can use "--start-group archives --end-group" linker flags with "Unix Makefiles". May be somebody know the right way? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake