Hi, all,

Thanks for taking your time to review my email. I have a demo project and
it's structure like as below:

top_dir
    CMakeLists.txt
    sub_dir1
        CMakeLists.txt
    sub_dir2
        CMakeLists.txt

top_dir/sub_dir1/CMakeLists.txt used to build `lib1` by using
`add_library(lib1 ...)`, 
top_dir/sub_dir2/CMakeLists.txt used to build `exe1` with linking lib1 by
`target_link_library(exe1 lib1)`. 
And the content of top_dir/CMakeLists.txt is as below:

add_subdirectory(sub_dir2)
add_subdirectory(sub_dir1)

Normally, when build target exe1, cmake will check dependency so `lib1` will
be built before building exe1. The problem is I am transfering an existed
makefile project into CMake, and there are many gcc link options, like
"whole-archive ... no-whole-archive, allow-mutiple-definition", if use like
`target_link_library(exe1 "-Wl, --whole-archive ../sub_dir1/liblib1.a
--no-whole-archive")`(The form like this, and this may not work, it just a
e.g.), cmake seem don't built `lib1` any more. Is there any way i can use
target_link_library like `target_link_library(exe1 "-Wl, --whole-archive
../sub_dir1/liblib1.a")` and cmake link dependency checking still work, or
other way i can transfer these gcc link options into cmake?

Thanks a lot,
Chao



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/How-to-hundle-gcc-link-options-like-whole-archive-allow-multiple-definition-in-CMake-tp7593563.html
Sent from the CMake mailing list archive at Nabble.com.
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to