Hello,

I want to use custom executable linking command in my CMake script, namely
Synopsys VCS. VCS is a wrapper over GCC, but it uses special syntax for
passing LD options:

vcs -LDFLAGS "<LINK_FLAGS>" <LINK_LIBRARIES> <OBJECTS>

I've tried to play with CMAKE_CXX_LINK_EXECUTABLE:

set(CMAKE_CXX_LINK_EXECUTABLE "echo CXXFLAGS: <CMAKE_CXX_LINK_FLAGS>
LINK_FLAGS: <LINKER_FLAGS> LINK_LIBRARIES: <LINK_LIBRARIES> OBJECTS:
<OBJECTS> ")

When I build project i got:

CXXFLAGS:
LINK_FLAGS:
LINK_LIBRARIES: -rdynamic ../slib/libslib.a ../dlib/libdlib.so
-Wl,-rpath,/home/ripopov/proj_cmake/build/dlib
OBJECTS: CMakeFiles/sim.dir/sc_main.cpp.o

So all linker flags together with libraries are in <LINK_LIBRARIES>.  And
<LINK_FLAGS> is empty.

Why it works this way? And how can I extract linker flags from
LINK_LIBRARIES?

I've posted same question on stackoverflow:
http://stackoverflow.com/questions/37368434/cmake-custom-link-executable-command-how-to-extract-linker-options


-- 
Best regards,
Roman
-- 

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